mirror of
https://github.com/gnh1201/caterpillar.git
synced 2024-11-26 15:31:45 +00:00
ruff checked
This commit is contained in:
parent
b845fe9356
commit
c23d2adefa
4
base.py
4
base.py
|
@ -115,7 +115,7 @@ def find_openssl_binpath():
|
|||
path = result.stdout.decode().strip()
|
||||
if path:
|
||||
return path
|
||||
except Exception as e:
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
return "openssl"
|
||||
|
@ -143,7 +143,7 @@ class Extension:
|
|||
module = importlib.import_module(module_path)
|
||||
_class = getattr(module, class_name)
|
||||
cls.extensions.append(_class())
|
||||
except (ImportError, AttributeError) as e:
|
||||
except (ImportError, AttributeError):
|
||||
raise ImportError(class_name + " in the extension " + module_name)
|
||||
|
||||
@classmethod
|
||||
|
|
|
@ -124,7 +124,7 @@ class AlwaysOnline(Extension):
|
|||
def __init__(self):
|
||||
self.type = "connector" # this is a connector
|
||||
self.connection_type = "alwaysonline"
|
||||
self.buffer_size = 8192;
|
||||
self.buffer_size = 8192
|
||||
|
||||
def connect(self, conn, data, webserver, port, scheme, method, url):
|
||||
logger.info("[*] Connecting... Connecting...")
|
||||
|
|
|
@ -9,7 +9,6 @@
|
|||
# Updated at: 2024-07-02
|
||||
#
|
||||
|
||||
import json
|
||||
from Bio.Seq import Seq
|
||||
from Bio.SeqUtils import gc_fraction
|
||||
|
||||
|
|
|
@ -11,7 +11,6 @@
|
|||
#
|
||||
import sys
|
||||
import nmap
|
||||
import json
|
||||
|
||||
from base import Extension
|
||||
|
||||
|
|
|
@ -20,13 +20,11 @@ import base64
|
|||
import json
|
||||
import ssl
|
||||
import time
|
||||
import hashlib
|
||||
import traceback
|
||||
import textwrap
|
||||
from datetime import datetime
|
||||
from platform import python_version
|
||||
|
||||
import re
|
||||
import requests
|
||||
from requests.auth import HTTPBasicAuth
|
||||
from urllib.parse import urlparse
|
||||
|
@ -35,9 +33,7 @@ from decouple import config
|
|||
from base import (
|
||||
Extension,
|
||||
extract_credentials,
|
||||
jsonrpc2_create_id,
|
||||
jsonrpc2_encode,
|
||||
jsonrpc2_result_encode,
|
||||
find_openssl_binpath,
|
||||
Logger,
|
||||
)
|
||||
|
@ -467,7 +463,7 @@ def proxy_server(webserver, port, scheme, method, url, conn, addr, data):
|
|||
result = query.json()["result"]
|
||||
resolved_address_list.append(result["data"])
|
||||
logger.info("[*] resolved IP: %s" % (result["data"]))
|
||||
except requests.exceptions.ReadTimeout as e:
|
||||
except requests.exceptions.ReadTimeout:
|
||||
pass
|
||||
proxy_data["data"]["client_address"] = resolved_address_list[0]
|
||||
|
||||
|
@ -503,7 +499,7 @@ def proxy_server(webserver, port, scheme, method, url, conn, addr, data):
|
|||
logger.info("[*] waiting for the relay... %s" % id)
|
||||
max_reties = 30
|
||||
t = 0
|
||||
while t < max_reties and not id in accepted_relay:
|
||||
while t < max_reties and id not in accepted_relay:
|
||||
time.sleep(1)
|
||||
t += 1
|
||||
if t < max_reties:
|
||||
|
|
5
smtp.py
5
smtp.py
|
@ -11,20 +11,15 @@
|
|||
#
|
||||
import asyncio
|
||||
from aiosmtpd.controller import Controller
|
||||
from aiosmtpd.handlers import Message
|
||||
from email.message import EmailMessage
|
||||
import re
|
||||
import sys
|
||||
import json
|
||||
import requests
|
||||
from platform import python_version
|
||||
from decouple import config
|
||||
from requests.auth import HTTPBasicAuth
|
||||
from base import (
|
||||
extract_credentials,
|
||||
jsonrpc2_create_id,
|
||||
jsonrpc2_encode,
|
||||
jsonrpc2_result_encode,
|
||||
Logger,
|
||||
)
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user