trapster 1.2.2__tar.gz → 1.2.3__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {trapster-1.2.2/trapster.egg-info → trapster-1.2.3}/PKG-INFO +1 -1
- trapster-1.2.3/trapster/__init__.py +1 -0
- {trapster-1.2.2 → trapster-1.2.3}/trapster/modules/http.py +33 -0
- {trapster-1.2.2 → trapster-1.2.3}/trapster/modules/https.py +7 -7
- {trapster-1.2.2 → trapster-1.2.3/trapster.egg-info}/PKG-INFO +1 -1
- trapster-1.2.2/trapster/__init__.py +0 -1
- {trapster-1.2.2 → trapster-1.2.3}/LICENSE +0 -0
- {trapster-1.2.2 → trapster-1.2.3}/MANIFEST.in +0 -0
- {trapster-1.2.2 → trapster-1.2.3}/README.md +0 -0
- {trapster-1.2.2 → trapster-1.2.3}/requirements.txt +0 -0
- {trapster-1.2.2 → trapster-1.2.3}/setup.cfg +0 -0
- {trapster-1.2.2 → trapster-1.2.3}/setup.py +0 -0
- {trapster-1.2.2 → trapster-1.2.3}/tests/test_ftp_server.py +0 -0
- {trapster-1.2.2 → trapster-1.2.3}/tests/test_ssh_server.py +0 -0
- {trapster-1.2.2 → trapster-1.2.3}/trapster/ai/__init__.py +0 -0
- {trapster-1.2.2 → trapster-1.2.3}/trapster/ai/base.py +0 -0
- {trapster-1.2.2 → trapster-1.2.3}/trapster/ai/http.py +0 -0
- {trapster-1.2.2 → trapster-1.2.3}/trapster/ai/ssh.py +0 -0
- {trapster-1.2.2 → trapster-1.2.3}/trapster/data/trapster.conf +0 -0
- {trapster-1.2.2 → trapster-1.2.3}/trapster/libs/__init__.py +0 -0
- {trapster-1.2.2 → trapster-1.2.3}/trapster/libs/dns.py +0 -0
- {trapster-1.2.2 → trapster-1.2.3}/trapster/libs/ldapasn1.py +0 -0
- {trapster-1.2.2 → trapster-1.2.3}/trapster/libs/ntlm.py +0 -0
- {trapster-1.2.2 → trapster-1.2.3}/trapster/logger/__init__.py +0 -0
- {trapster-1.2.2 → trapster-1.2.3}/trapster/logger/api.py +0 -0
- {trapster-1.2.2 → trapster-1.2.3}/trapster/logger/base.py +0 -0
- {trapster-1.2.2 → trapster-1.2.3}/trapster/logger/ecs.py +0 -0
- {trapster-1.2.2 → trapster-1.2.3}/trapster/logger/factory.py +0 -0
- {trapster-1.2.2 → trapster-1.2.3}/trapster/logger/file.py +0 -0
- {trapster-1.2.2 → trapster-1.2.3}/trapster/logger/formatters.py +0 -0
- {trapster-1.2.2 → trapster-1.2.3}/trapster/logger/json.py +0 -0
- {trapster-1.2.2 → trapster-1.2.3}/trapster/logger/output.py +0 -0
- {trapster-1.2.2 → trapster-1.2.3}/trapster/logger/redis.py +0 -0
- {trapster-1.2.2 → trapster-1.2.3}/trapster/modules/__init__.py +0 -0
- {trapster-1.2.2 → trapster-1.2.3}/trapster/modules/base.py +0 -0
- {trapster-1.2.2 → trapster-1.2.3}/trapster/modules/dns.py +0 -0
- {trapster-1.2.2 → trapster-1.2.3}/trapster/modules/ftp.py +0 -0
- {trapster-1.2.2 → trapster-1.2.3}/trapster/modules/ldap.py +0 -0
- {trapster-1.2.2 → trapster-1.2.3}/trapster/modules/ldaps.py +0 -0
- {trapster-1.2.2 → trapster-1.2.3}/trapster/modules/mssql.py +0 -0
- {trapster-1.2.2 → trapster-1.2.3}/trapster/modules/mysql.py +0 -0
- {trapster-1.2.2 → trapster-1.2.3}/trapster/modules/postgres.py +0 -0
- {trapster-1.2.2 → trapster-1.2.3}/trapster/modules/rdp.py +0 -0
- {trapster-1.2.2 → trapster-1.2.3}/trapster/modules/resources/VNC_ascii.hcchr +0 -0
- {trapster-1.2.2 → trapster-1.2.3}/trapster/modules/rsync.py +0 -0
- {trapster-1.2.2 → trapster-1.2.3}/trapster/modules/snmp.py +0 -0
- {trapster-1.2.2 → trapster-1.2.3}/trapster/modules/socks5.py +0 -0
- {trapster-1.2.2 → trapster-1.2.3}/trapster/modules/ssh.py +0 -0
- {trapster-1.2.2 → trapster-1.2.3}/trapster/modules/telnet.py +0 -0
- {trapster-1.2.2 → trapster-1.2.3}/trapster/modules/vnc.py +0 -0
- {trapster-1.2.2 → trapster-1.2.3}/trapster/trapster.py +0 -0
- {trapster-1.2.2 → trapster-1.2.3}/trapster.egg-info/SOURCES.txt +0 -0
- {trapster-1.2.2 → trapster-1.2.3}/trapster.egg-info/dependency_links.txt +0 -0
- {trapster-1.2.2 → trapster-1.2.3}/trapster.egg-info/entry_points.txt +0 -0
- {trapster-1.2.2 → trapster-1.2.3}/trapster.egg-info/requires.txt +0 -0
- {trapster-1.2.2 → trapster-1.2.3}/trapster.egg-info/top_level.txt +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__="1.2.3"
|
|
@@ -66,7 +66,40 @@ def _patch_hypercorn_reason():
|
|
|
66
66
|
hyper_h11.H11Protocol._send_h11_event = _send_h11_event
|
|
67
67
|
|
|
68
68
|
|
|
69
|
+
def _patch_hypercorn_ssl_shutdown():
|
|
70
|
+
"""Swallow TimeoutError from TLS wait_closed
|
|
71
|
+
|
|
72
|
+
Clients that drop TLS without a clean close_notify raise TimeoutError: "SSL shutdown timed out".
|
|
73
|
+
Hypercorn leaves it uncaught in TCPServer._close, so this function catches it and aborts the connection.
|
|
74
|
+
|
|
75
|
+
REMOVE when fixed upstream:
|
|
76
|
+
https://github.com/pgjones/hypercorn/pull/342 (TimeoutError + abort)
|
|
77
|
+
https://github.com/pgjones/hypercorn/issues/202
|
|
78
|
+
After a hypercorn release that catches TimeoutError, delete this function and its call.
|
|
79
|
+
"""
|
|
80
|
+
try:
|
|
81
|
+
from hypercorn.asyncio.tcp_server import TCPServer
|
|
82
|
+
except Exception:
|
|
83
|
+
return
|
|
84
|
+
|
|
85
|
+
original = TCPServer._close
|
|
86
|
+
|
|
87
|
+
async def _close(self):
|
|
88
|
+
try:
|
|
89
|
+
await original(self)
|
|
90
|
+
except TimeoutError:
|
|
91
|
+
try:
|
|
92
|
+
transport = self.writer.transport
|
|
93
|
+
if transport is not None:
|
|
94
|
+
transport.abort()
|
|
95
|
+
except Exception:
|
|
96
|
+
pass
|
|
97
|
+
|
|
98
|
+
TCPServer._close = _close
|
|
99
|
+
|
|
100
|
+
|
|
69
101
|
_patch_hypercorn_reason()
|
|
102
|
+
_patch_hypercorn_ssl_shutdown()
|
|
70
103
|
|
|
71
104
|
# Optional AI import - gracefully handle when AI dependencies aren't installed
|
|
72
105
|
try:
|
|
@@ -12,6 +12,11 @@ from cryptography import x509
|
|
|
12
12
|
from cryptography.x509.oid import NameOID
|
|
13
13
|
|
|
14
14
|
|
|
15
|
+
def _has_content(path):
|
|
16
|
+
"""True when *path* is an existing file with data (empty files don't count)."""
|
|
17
|
+
return path.is_file() and path.stat().st_size > 0
|
|
18
|
+
|
|
19
|
+
|
|
15
20
|
class HttpsHandler(HttpHandler):
|
|
16
21
|
def __init__(self, config=None, logger=None):
|
|
17
22
|
super().__init__(config, logger)
|
|
@@ -24,8 +29,6 @@ class HttpsHoneypot(HttpHoneypot):
|
|
|
24
29
|
def __init__(self, config, logger, bindaddr="0.0.0.0"):
|
|
25
30
|
super().__init__(config, logger, bindaddr)
|
|
26
31
|
self.handler = HttpsHandler(config=config, logger=logger)
|
|
27
|
-
# Check if the user has set the TLS key and certificate
|
|
28
|
-
self.user_set_tls = config.get("key") and config.get("certificate")
|
|
29
32
|
config.setdefault("country_name", None)
|
|
30
33
|
config.setdefault("state_or_province_name", None)
|
|
31
34
|
config.setdefault("locality_name", None)
|
|
@@ -64,11 +67,8 @@ class HttpsHoneypot(HttpHoneypot):
|
|
|
64
67
|
Use the configured key/certificate files when both already exist.
|
|
65
68
|
Otherwise generate a self-signed pair (and write it to those paths).
|
|
66
69
|
'''
|
|
67
|
-
if self.
|
|
68
|
-
|
|
69
|
-
return
|
|
70
|
-
else:
|
|
71
|
-
raise ValueError(f"HTTPS key/certificate configured but missing: key={self.key_path} certificate={self.certificate_path}")
|
|
70
|
+
if _has_content(self.key_path) and _has_content(self.certificate_path):
|
|
71
|
+
return
|
|
72
72
|
|
|
73
73
|
self.key_path.parent.mkdir(parents=True, exist_ok=True)
|
|
74
74
|
self.certificate_path.parent.mkdir(parents=True, exist_ok=True)
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__="1.2.2"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|