dementor 1.0.0.dev22__tar.gz → 1.0.0.dev24__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.
- {dementor-1.0.0.dev22 → dementor-1.0.0.dev24}/PKG-INFO +1 -1
- {dementor-1.0.0.dev22 → dementor-1.0.0.dev24}/dementor/__init__.py +1 -1
- {dementor-1.0.0.dev22 → dementor-1.0.0.dev24}/dementor/protocols/http.py +19 -8
- {dementor-1.0.0.dev22 → dementor-1.0.0.dev24}/dementor/protocols/mdns.py +1 -0
- {dementor-1.0.0.dev22 → dementor-1.0.0.dev24}/dementor.egg-info/PKG-INFO +1 -1
- {dementor-1.0.0.dev22 → dementor-1.0.0.dev24}/pyproject.toml +38 -38
- {dementor-1.0.0.dev22 → dementor-1.0.0.dev24}/LICENSE +0 -0
- {dementor-1.0.0.dev22 → dementor-1.0.0.dev24}/README.md +0 -0
- {dementor-1.0.0.dev22 → dementor-1.0.0.dev24}/dementor/__main__.py +0 -0
- {dementor-1.0.0.dev22 → dementor-1.0.0.dev24}/dementor/assets/Dementor.toml +0 -0
- {dementor-1.0.0.dev22 → dementor-1.0.0.dev24}/dementor/assets/banner.txt +0 -0
- {dementor-1.0.0.dev22 → dementor-1.0.0.dev24}/dementor/assets/www/error_page.html +0 -0
- {dementor-1.0.0.dev22 → dementor-1.0.0.dev24}/dementor/assets/www/upnp-default/dd.xml +0 -0
- {dementor-1.0.0.dev22 → dementor-1.0.0.dev24}/dementor/assets/www/upnp-default/present.html +0 -0
- {dementor-1.0.0.dev22 → dementor-1.0.0.dev24}/dementor/assets/www/upnp-default/scpd.xml +0 -0
- {dementor-1.0.0.dev22 → dementor-1.0.0.dev24}/dementor/assets/www/wpad.dat +0 -0
- {dementor-1.0.0.dev22 → dementor-1.0.0.dev24}/dementor/config/__init__.py +0 -0
- {dementor-1.0.0.dev22 → dementor-1.0.0.dev24}/dementor/config/attr.py +0 -0
- {dementor-1.0.0.dev22 → dementor-1.0.0.dev24}/dementor/config/session.py +0 -0
- {dementor-1.0.0.dev22 → dementor-1.0.0.dev24}/dementor/config/tls.py +0 -0
- {dementor-1.0.0.dev22 → dementor-1.0.0.dev24}/dementor/config/toml.py +0 -0
- {dementor-1.0.0.dev22 → dementor-1.0.0.dev24}/dementor/config/util.py +0 -0
- {dementor-1.0.0.dev22 → dementor-1.0.0.dev24}/dementor/db/__init__.py +0 -0
- {dementor-1.0.0.dev22 → dementor-1.0.0.dev24}/dementor/db/connector.py +0 -0
- {dementor-1.0.0.dev22 → dementor-1.0.0.dev24}/dementor/db/model.py +0 -0
- {dementor-1.0.0.dev22 → dementor-1.0.0.dev24}/dementor/filters.py +0 -0
- {dementor-1.0.0.dev22 → dementor-1.0.0.dev24}/dementor/loader.py +0 -0
- {dementor-1.0.0.dev22 → dementor-1.0.0.dev24}/dementor/log/__init__.py +0 -0
- {dementor-1.0.0.dev22 → dementor-1.0.0.dev24}/dementor/log/hexdump.py +0 -0
- {dementor-1.0.0.dev22 → dementor-1.0.0.dev24}/dementor/log/logger.py +0 -0
- {dementor-1.0.0.dev22 → dementor-1.0.0.dev24}/dementor/log/stream.py +0 -0
- {dementor-1.0.0.dev22 → dementor-1.0.0.dev24}/dementor/paths.py +0 -0
- {dementor-1.0.0.dev22 → dementor-1.0.0.dev24}/dementor/protocols/__init__.py +0 -0
- {dementor-1.0.0.dev22 → dementor-1.0.0.dev24}/dementor/protocols/ftp.py +0 -0
- {dementor-1.0.0.dev22 → dementor-1.0.0.dev24}/dementor/protocols/imap.py +0 -0
- {dementor-1.0.0.dev22 → dementor-1.0.0.dev24}/dementor/protocols/ipp.py +0 -0
- {dementor-1.0.0.dev22 → dementor-1.0.0.dev24}/dementor/protocols/kerberos.py +0 -0
- {dementor-1.0.0.dev22 → dementor-1.0.0.dev24}/dementor/protocols/ldap.py +0 -0
- {dementor-1.0.0.dev22 → dementor-1.0.0.dev24}/dementor/protocols/llmnr.py +0 -0
- {dementor-1.0.0.dev22 → dementor-1.0.0.dev24}/dementor/protocols/mailslot.py +0 -0
- {dementor-1.0.0.dev22 → dementor-1.0.0.dev24}/dementor/protocols/msrpc/__init__.py +0 -0
- {dementor-1.0.0.dev22 → dementor-1.0.0.dev24}/dementor/protocols/msrpc/dcom.py +0 -0
- {dementor-1.0.0.dev22 → dementor-1.0.0.dev24}/dementor/protocols/msrpc/epm.py +0 -0
- {dementor-1.0.0.dev22 → dementor-1.0.0.dev24}/dementor/protocols/msrpc/rpc.py +0 -0
- {dementor-1.0.0.dev22 → dementor-1.0.0.dev24}/dementor/protocols/msrpc.py +0 -0
- {dementor-1.0.0.dev22 → dementor-1.0.0.dev24}/dementor/protocols/mssql.py +0 -0
- {dementor-1.0.0.dev22 → dementor-1.0.0.dev24}/dementor/protocols/mysql.py +0 -0
- {dementor-1.0.0.dev22 → dementor-1.0.0.dev24}/dementor/protocols/netbios.py +0 -0
- {dementor-1.0.0.dev22 → dementor-1.0.0.dev24}/dementor/protocols/netlogon.py +0 -0
- {dementor-1.0.0.dev22 → dementor-1.0.0.dev24}/dementor/protocols/ntlm.py +0 -0
- {dementor-1.0.0.dev22 → dementor-1.0.0.dev24}/dementor/protocols/pop3.py +0 -0
- {dementor-1.0.0.dev22 → dementor-1.0.0.dev24}/dementor/protocols/quic.py +0 -0
- {dementor-1.0.0.dev22 → dementor-1.0.0.dev24}/dementor/protocols/smb.py +0 -0
- {dementor-1.0.0.dev22 → dementor-1.0.0.dev24}/dementor/protocols/smtp.py +0 -0
- {dementor-1.0.0.dev22 → dementor-1.0.0.dev24}/dementor/protocols/spnego.py +0 -0
- {dementor-1.0.0.dev22 → dementor-1.0.0.dev24}/dementor/protocols/ssdp.py +0 -0
- {dementor-1.0.0.dev22 → dementor-1.0.0.dev24}/dementor/protocols/upnp.py +0 -0
- {dementor-1.0.0.dev22 → dementor-1.0.0.dev24}/dementor/protocols/x11.py +0 -0
- {dementor-1.0.0.dev22 → dementor-1.0.0.dev24}/dementor/servers.py +0 -0
- {dementor-1.0.0.dev22 → dementor-1.0.0.dev24}/dementor/standalone.py +0 -0
- {dementor-1.0.0.dev22 → dementor-1.0.0.dev24}/dementor/tui/__init__.py +0 -0
- {dementor-1.0.0.dev22 → dementor-1.0.0.dev24}/dementor/tui/action.py +0 -0
- {dementor-1.0.0.dev22 → dementor-1.0.0.dev24}/dementor/tui/commands/__init__.py +0 -0
- {dementor-1.0.0.dev22 → dementor-1.0.0.dev24}/dementor/tui/commands/config.py +0 -0
- {dementor-1.0.0.dev22 → dementor-1.0.0.dev24}/dementor/tui/commands/database.py +0 -0
- {dementor-1.0.0.dev22 → dementor-1.0.0.dev24}/dementor/tui/commands/env.py +0 -0
- {dementor-1.0.0.dev22 → dementor-1.0.0.dev24}/dementor/tui/commands/help.py +0 -0
- {dementor-1.0.0.dev22 → dementor-1.0.0.dev24}/dementor/tui/commands/ipconfig.py +0 -0
- {dementor-1.0.0.dev22 → dementor-1.0.0.dev24}/dementor/tui/commands/proto.py +0 -0
- {dementor-1.0.0.dev22 → dementor-1.0.0.dev24}/dementor/tui/completer.py +0 -0
- {dementor-1.0.0.dev22 → dementor-1.0.0.dev24}/dementor/tui/repl.py +0 -0
- {dementor-1.0.0.dev22 → dementor-1.0.0.dev24}/dementor.egg-info/SOURCES.txt +0 -0
- {dementor-1.0.0.dev22 → dementor-1.0.0.dev24}/dementor.egg-info/dependency_links.txt +0 -0
- {dementor-1.0.0.dev22 → dementor-1.0.0.dev24}/dementor.egg-info/entry_points.txt +0 -0
- {dementor-1.0.0.dev22 → dementor-1.0.0.dev24}/dementor.egg-info/requires.txt +0 -0
- {dementor-1.0.0.dev22 → dementor-1.0.0.dev24}/dementor.egg-info/top_level.txt +0 -0
- {dementor-1.0.0.dev22 → dementor-1.0.0.dev24}/docs/README.pypi.md +0 -0
- {dementor-1.0.0.dev22 → dementor-1.0.0.dev24}/setup.cfg +0 -0
- {dementor-1.0.0.dev22 → dementor-1.0.0.dev24}/tests/test_db.py +0 -0
- {dementor-1.0.0.dev22 → dementor-1.0.0.dev24}/tests/test_db_concurrency.py +0 -0
- {dementor-1.0.0.dev22 → dementor-1.0.0.dev24}/tests/test_filters.py +0 -0
- {dementor-1.0.0.dev22 → dementor-1.0.0.dev24}/tests/test_logger.py +0 -0
- {dementor-1.0.0.dev22 → dementor-1.0.0.dev24}/tests/test_ntlm.py +0 -0
- {dementor-1.0.0.dev22 → dementor-1.0.0.dev24}/tests/test_smb.py +0 -0
- {dementor-1.0.0.dev22 → dementor-1.0.0.dev24}/tests/test_version.py +0 -0
|
@@ -74,7 +74,9 @@ class ProxyAutoConfig(TomlConfig):
|
|
|
74
74
|
if typing.TYPE_CHECKING:
|
|
75
75
|
proxy_script: str | None
|
|
76
76
|
|
|
77
|
-
def set_proxy_script(
|
|
77
|
+
def set_proxy_script(
|
|
78
|
+
self, script: str | dict[str, dict[str, str]] | object | None
|
|
79
|
+
) -> None:
|
|
78
80
|
self.proxy_script = None
|
|
79
81
|
match script:
|
|
80
82
|
case str():
|
|
@@ -94,11 +96,15 @@ class ProxyAutoConfig(TomlConfig):
|
|
|
94
96
|
|
|
95
97
|
path = pathlib.Path(script["file"])
|
|
96
98
|
if not path.exists() or not path.is_file():
|
|
97
|
-
dm_logger.error(
|
|
99
|
+
dm_logger.error(
|
|
100
|
+
f"WPAD script at {path} does not exist - ignoring..."
|
|
101
|
+
)
|
|
98
102
|
return
|
|
99
103
|
|
|
100
104
|
if not path.is_file():
|
|
101
|
-
dm_logger.error(
|
|
105
|
+
dm_logger.error(
|
|
106
|
+
f"WPAD script at {path} is not a file - ignoring..."
|
|
107
|
+
)
|
|
102
108
|
return
|
|
103
109
|
|
|
104
110
|
self.proxy_script = path.read_text()
|
|
@@ -276,10 +282,10 @@ class HTTPHandler(BaseHTTPRequestHandler):
|
|
|
276
282
|
client_address: tuple[str, int],
|
|
277
283
|
server,
|
|
278
284
|
) -> None:
|
|
279
|
-
self.config = session
|
|
280
|
-
self.server_config = server_config
|
|
285
|
+
self.config: SessionConfig = session
|
|
286
|
+
self.server_config: HTTPServerConfig = server_config
|
|
281
287
|
self.client_address = client_address
|
|
282
|
-
self.challenge = None
|
|
288
|
+
self.challenge: bytes | None = None
|
|
283
289
|
self.setup_proto_logger()
|
|
284
290
|
for http_method in server_config.http_methods:
|
|
285
291
|
if http_method in ("OPTIONS", "PROPFIND"):
|
|
@@ -335,7 +341,9 @@ class HTTPHandler(BaseHTTPRequestHandler):
|
|
|
335
341
|
def log_message(self, format: str, *args) -> None:
|
|
336
342
|
# let us log mssages
|
|
337
343
|
text = format % args
|
|
338
|
-
msg = text.translate(
|
|
344
|
+
msg = text.translate(
|
|
345
|
+
self._control_char_table
|
|
346
|
+
) # ty:ignore[unresolved-attribute]
|
|
339
347
|
self.logger.debug(msg)
|
|
340
348
|
|
|
341
349
|
def send_response(self, code: int, message: str | None = None) -> None:
|
|
@@ -506,7 +514,9 @@ class HTTPHandler(BaseHTTPRequestHandler):
|
|
|
506
514
|
|
|
507
515
|
case _:
|
|
508
516
|
logger.fail(f"Invalid negotiate authentication: {token}")
|
|
509
|
-
self.send_error(
|
|
517
|
+
self.send_error(
|
|
518
|
+
HTTPStatus.INTERNAL_SERVER_ERROR, "Internal Server Error"
|
|
519
|
+
)
|
|
510
520
|
|
|
511
521
|
def auth_bearer(self, token: str, logger: "ProtocolLogger") -> None:
|
|
512
522
|
self.display_request("Bearer", logger)
|
|
@@ -565,6 +575,7 @@ class HTTPHandler(BaseHTTPRequestHandler):
|
|
|
565
575
|
|
|
566
576
|
class WinRMHandler(HTTPHandler):
|
|
567
577
|
def setup_proto_logger(self) -> None:
|
|
578
|
+
super().setup_proto_logger()
|
|
568
579
|
self.logger = ProtocolLogger(
|
|
569
580
|
extra={
|
|
570
581
|
"protocol": "WinRM",
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "dementor"
|
|
7
|
-
version = "1.0.0.
|
|
7
|
+
version = "1.0.0.dev24"
|
|
8
8
|
# REVISIT: dynamic version
|
|
9
9
|
# dynamic = ["version"]
|
|
10
10
|
description = "LLMNR/NBT-NS/mDNS Poisoner and rogue service provider"
|
|
@@ -96,104 +96,104 @@ src = ["dementor", "tests"]
|
|
|
96
96
|
select = ["ALL"]
|
|
97
97
|
ignore = [
|
|
98
98
|
# --- A: flake8-builtins ---
|
|
99
|
-
"A001", # builtin-variable-shadowing
|
|
100
|
-
"A002", # builtin-argument-shadowing
|
|
99
|
+
"A001", # builtin-variable-shadowing
|
|
100
|
+
"A002", # builtin-argument-shadowing
|
|
101
101
|
|
|
102
|
-
# --- ANN: flake8-annotations
|
|
102
|
+
# --- ANN: flake8-annotations
|
|
103
103
|
"ANN",
|
|
104
104
|
|
|
105
105
|
# --- ARG: flake8-unused-arguments ---
|
|
106
|
-
"ARG001", # unused-function-argument
|
|
107
|
-
"ARG002", # unused-method-argument
|
|
106
|
+
"ARG001", # unused-function-argument
|
|
107
|
+
"ARG002", # unused-method-argument
|
|
108
108
|
|
|
109
109
|
# --- ASYNC: flake8-async ---
|
|
110
|
-
"ASYNC240", # blocking-path-method-in-async
|
|
110
|
+
"ASYNC240", # blocking-path-method-in-async
|
|
111
111
|
|
|
112
112
|
# --- BLE: flake8-blind-except ---
|
|
113
|
-
"BLE001", # blind-except
|
|
113
|
+
"BLE001", # blind-except
|
|
114
114
|
|
|
115
115
|
# --- C90: mccabe ---
|
|
116
|
-
"C901", # complex-structure
|
|
116
|
+
"C901", # complex-structure
|
|
117
117
|
|
|
118
118
|
# --- COM: flake8-commas ---
|
|
119
|
-
"COM812", # missing-trailing-comma
|
|
119
|
+
"COM812", # missing-trailing-comma
|
|
120
120
|
|
|
121
121
|
# --- D: pydocstyle ---
|
|
122
122
|
"D100", "D101", "D102", "D103", "D104", "D105", "D107", # missing docstrings
|
|
123
123
|
"D203", # conflicts with D211
|
|
124
124
|
"D212", # conflicts with D213 (must pick one)
|
|
125
125
|
"D213", # conflicts with D212 (must pick one)
|
|
126
|
-
"D401", # non-imperative-mood
|
|
126
|
+
"D401", # non-imperative-mood
|
|
127
127
|
|
|
128
128
|
# --- E: pycodestyle ---
|
|
129
|
-
"E501", # line-too-long
|
|
129
|
+
"E501", # line-too-long
|
|
130
130
|
|
|
131
131
|
# --- EM: flake8-errmsg ---
|
|
132
|
-
"EM101", # raw-string-in-exception
|
|
133
|
-
"EM102", # f-string-in-exception
|
|
132
|
+
"EM101", # raw-string-in-exception
|
|
133
|
+
"EM102", # f-string-in-exception
|
|
134
134
|
|
|
135
135
|
# --- ERA: eradicate ---
|
|
136
136
|
"ERA001", # REVISIT notes, protocol reference tables, placeholders
|
|
137
137
|
|
|
138
138
|
# --- EXE: flake8-executable ---
|
|
139
|
-
"EXE002", # shebang-missing-executable-file
|
|
139
|
+
"EXE002", # shebang-missing-executable-file
|
|
140
140
|
|
|
141
141
|
# --- FBT: flake8-boolean-trap ---
|
|
142
|
-
"FBT",
|
|
142
|
+
"FBT",
|
|
143
143
|
|
|
144
144
|
# --- FIX: flake8-fixme ---
|
|
145
|
-
"FIX002", # line-contains-todo
|
|
145
|
+
"FIX002", # line-contains-todo
|
|
146
146
|
|
|
147
147
|
# --- G: flake8-logging-format ---
|
|
148
|
-
"G004", # logging-f-string
|
|
148
|
+
"G004", # logging-f-string
|
|
149
149
|
|
|
150
150
|
# --- I: isort ---
|
|
151
|
-
"I001", # unsorted-imports
|
|
151
|
+
"I001", # unsorted-imports
|
|
152
152
|
|
|
153
153
|
# --- INP: flake8-no-pep420 ---
|
|
154
|
-
"INP001",
|
|
154
|
+
"INP001",
|
|
155
155
|
|
|
156
156
|
# --- ISC: flake8-implicit-str-concat ---
|
|
157
|
-
"ISC003", # explicit-string-concatenation
|
|
157
|
+
"ISC003", # explicit-string-concatenation
|
|
158
158
|
|
|
159
159
|
# --- N: pep8-naming ---
|
|
160
160
|
"N801", "N802", "N803", "N806", # protocol code uses non-standard names
|
|
161
161
|
"N811", "N812", "N815", "N817", # import/variable naming conventions
|
|
162
|
-
"N818", # error-suffix
|
|
162
|
+
"N818", # error-suffix
|
|
163
163
|
|
|
164
164
|
# --- PL: Pylint ---
|
|
165
|
-
"PLR0912", # too-many-branches
|
|
166
|
-
"PLR0913", # too-many-arguments
|
|
167
|
-
"PLR0915", # too-many-statements
|
|
168
|
-
"PLR2004", # magic-value-comparison
|
|
165
|
+
"PLR0912", # too-many-branches
|
|
166
|
+
"PLR0913", # too-many-arguments
|
|
167
|
+
"PLR0915", # too-many-statements
|
|
168
|
+
"PLR2004", # magic-value-comparison
|
|
169
169
|
|
|
170
170
|
# --- PTH: flake8-use-pathlib ---
|
|
171
|
-
"PTH", # os.path -> pathlib
|
|
171
|
+
"PTH", # os.path -> pathlib
|
|
172
172
|
|
|
173
173
|
# --- RET: flake8-return ---
|
|
174
|
-
"RET503", # implicit-return
|
|
174
|
+
"RET503", # implicit-return
|
|
175
175
|
|
|
176
176
|
# --- RUF: Ruff-specific rules ---
|
|
177
|
-
"RUF003", # ambiguous-unicode-character-comment
|
|
178
|
-
"RUF012", # mutable-class-default
|
|
177
|
+
"RUF003", # ambiguous-unicode-character-comment
|
|
178
|
+
"RUF012", # mutable-class-default
|
|
179
179
|
|
|
180
180
|
# --- S: flake8-bandit ---
|
|
181
|
-
"S101", # assert
|
|
182
|
-
"S104", # hardcoded-bind-all-interfaces
|
|
183
|
-
"S311", # suspicious-non-cryptographic-random
|
|
181
|
+
"S101", # assert
|
|
182
|
+
"S104", # hardcoded-bind-all-interfaces
|
|
183
|
+
"S311", # suspicious-non-cryptographic-random
|
|
184
184
|
|
|
185
185
|
# --- SLF: flake8-self ---
|
|
186
|
-
"SLF001", # private-member-access
|
|
186
|
+
"SLF001", # private-member-access
|
|
187
187
|
|
|
188
188
|
# --- T20: flake8-print ---
|
|
189
|
-
"T201", # print
|
|
189
|
+
"T201", # print
|
|
190
190
|
|
|
191
191
|
# --- TD: flake8-todos ---
|
|
192
|
-
"TD002", # missing-todo-author
|
|
193
|
-
"TD003", # missing-todo-link
|
|
192
|
+
"TD002", # missing-todo-author
|
|
193
|
+
"TD003", # missing-todo-link
|
|
194
194
|
|
|
195
195
|
# --- TRY: tryceratops ---
|
|
196
|
-
"TRY003", # raise-vanilla-args
|
|
196
|
+
"TRY003", # raise-vanilla-args
|
|
197
197
|
]
|
|
198
198
|
|
|
199
199
|
[tool.ruff.format]
|
|
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
|
|
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
|