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.
Files changed (85) hide show
  1. {dementor-1.0.0.dev22 → dementor-1.0.0.dev24}/PKG-INFO +1 -1
  2. {dementor-1.0.0.dev22 → dementor-1.0.0.dev24}/dementor/__init__.py +1 -1
  3. {dementor-1.0.0.dev22 → dementor-1.0.0.dev24}/dementor/protocols/http.py +19 -8
  4. {dementor-1.0.0.dev22 → dementor-1.0.0.dev24}/dementor/protocols/mdns.py +1 -0
  5. {dementor-1.0.0.dev22 → dementor-1.0.0.dev24}/dementor.egg-info/PKG-INFO +1 -1
  6. {dementor-1.0.0.dev22 → dementor-1.0.0.dev24}/pyproject.toml +38 -38
  7. {dementor-1.0.0.dev22 → dementor-1.0.0.dev24}/LICENSE +0 -0
  8. {dementor-1.0.0.dev22 → dementor-1.0.0.dev24}/README.md +0 -0
  9. {dementor-1.0.0.dev22 → dementor-1.0.0.dev24}/dementor/__main__.py +0 -0
  10. {dementor-1.0.0.dev22 → dementor-1.0.0.dev24}/dementor/assets/Dementor.toml +0 -0
  11. {dementor-1.0.0.dev22 → dementor-1.0.0.dev24}/dementor/assets/banner.txt +0 -0
  12. {dementor-1.0.0.dev22 → dementor-1.0.0.dev24}/dementor/assets/www/error_page.html +0 -0
  13. {dementor-1.0.0.dev22 → dementor-1.0.0.dev24}/dementor/assets/www/upnp-default/dd.xml +0 -0
  14. {dementor-1.0.0.dev22 → dementor-1.0.0.dev24}/dementor/assets/www/upnp-default/present.html +0 -0
  15. {dementor-1.0.0.dev22 → dementor-1.0.0.dev24}/dementor/assets/www/upnp-default/scpd.xml +0 -0
  16. {dementor-1.0.0.dev22 → dementor-1.0.0.dev24}/dementor/assets/www/wpad.dat +0 -0
  17. {dementor-1.0.0.dev22 → dementor-1.0.0.dev24}/dementor/config/__init__.py +0 -0
  18. {dementor-1.0.0.dev22 → dementor-1.0.0.dev24}/dementor/config/attr.py +0 -0
  19. {dementor-1.0.0.dev22 → dementor-1.0.0.dev24}/dementor/config/session.py +0 -0
  20. {dementor-1.0.0.dev22 → dementor-1.0.0.dev24}/dementor/config/tls.py +0 -0
  21. {dementor-1.0.0.dev22 → dementor-1.0.0.dev24}/dementor/config/toml.py +0 -0
  22. {dementor-1.0.0.dev22 → dementor-1.0.0.dev24}/dementor/config/util.py +0 -0
  23. {dementor-1.0.0.dev22 → dementor-1.0.0.dev24}/dementor/db/__init__.py +0 -0
  24. {dementor-1.0.0.dev22 → dementor-1.0.0.dev24}/dementor/db/connector.py +0 -0
  25. {dementor-1.0.0.dev22 → dementor-1.0.0.dev24}/dementor/db/model.py +0 -0
  26. {dementor-1.0.0.dev22 → dementor-1.0.0.dev24}/dementor/filters.py +0 -0
  27. {dementor-1.0.0.dev22 → dementor-1.0.0.dev24}/dementor/loader.py +0 -0
  28. {dementor-1.0.0.dev22 → dementor-1.0.0.dev24}/dementor/log/__init__.py +0 -0
  29. {dementor-1.0.0.dev22 → dementor-1.0.0.dev24}/dementor/log/hexdump.py +0 -0
  30. {dementor-1.0.0.dev22 → dementor-1.0.0.dev24}/dementor/log/logger.py +0 -0
  31. {dementor-1.0.0.dev22 → dementor-1.0.0.dev24}/dementor/log/stream.py +0 -0
  32. {dementor-1.0.0.dev22 → dementor-1.0.0.dev24}/dementor/paths.py +0 -0
  33. {dementor-1.0.0.dev22 → dementor-1.0.0.dev24}/dementor/protocols/__init__.py +0 -0
  34. {dementor-1.0.0.dev22 → dementor-1.0.0.dev24}/dementor/protocols/ftp.py +0 -0
  35. {dementor-1.0.0.dev22 → dementor-1.0.0.dev24}/dementor/protocols/imap.py +0 -0
  36. {dementor-1.0.0.dev22 → dementor-1.0.0.dev24}/dementor/protocols/ipp.py +0 -0
  37. {dementor-1.0.0.dev22 → dementor-1.0.0.dev24}/dementor/protocols/kerberos.py +0 -0
  38. {dementor-1.0.0.dev22 → dementor-1.0.0.dev24}/dementor/protocols/ldap.py +0 -0
  39. {dementor-1.0.0.dev22 → dementor-1.0.0.dev24}/dementor/protocols/llmnr.py +0 -0
  40. {dementor-1.0.0.dev22 → dementor-1.0.0.dev24}/dementor/protocols/mailslot.py +0 -0
  41. {dementor-1.0.0.dev22 → dementor-1.0.0.dev24}/dementor/protocols/msrpc/__init__.py +0 -0
  42. {dementor-1.0.0.dev22 → dementor-1.0.0.dev24}/dementor/protocols/msrpc/dcom.py +0 -0
  43. {dementor-1.0.0.dev22 → dementor-1.0.0.dev24}/dementor/protocols/msrpc/epm.py +0 -0
  44. {dementor-1.0.0.dev22 → dementor-1.0.0.dev24}/dementor/protocols/msrpc/rpc.py +0 -0
  45. {dementor-1.0.0.dev22 → dementor-1.0.0.dev24}/dementor/protocols/msrpc.py +0 -0
  46. {dementor-1.0.0.dev22 → dementor-1.0.0.dev24}/dementor/protocols/mssql.py +0 -0
  47. {dementor-1.0.0.dev22 → dementor-1.0.0.dev24}/dementor/protocols/mysql.py +0 -0
  48. {dementor-1.0.0.dev22 → dementor-1.0.0.dev24}/dementor/protocols/netbios.py +0 -0
  49. {dementor-1.0.0.dev22 → dementor-1.0.0.dev24}/dementor/protocols/netlogon.py +0 -0
  50. {dementor-1.0.0.dev22 → dementor-1.0.0.dev24}/dementor/protocols/ntlm.py +0 -0
  51. {dementor-1.0.0.dev22 → dementor-1.0.0.dev24}/dementor/protocols/pop3.py +0 -0
  52. {dementor-1.0.0.dev22 → dementor-1.0.0.dev24}/dementor/protocols/quic.py +0 -0
  53. {dementor-1.0.0.dev22 → dementor-1.0.0.dev24}/dementor/protocols/smb.py +0 -0
  54. {dementor-1.0.0.dev22 → dementor-1.0.0.dev24}/dementor/protocols/smtp.py +0 -0
  55. {dementor-1.0.0.dev22 → dementor-1.0.0.dev24}/dementor/protocols/spnego.py +0 -0
  56. {dementor-1.0.0.dev22 → dementor-1.0.0.dev24}/dementor/protocols/ssdp.py +0 -0
  57. {dementor-1.0.0.dev22 → dementor-1.0.0.dev24}/dementor/protocols/upnp.py +0 -0
  58. {dementor-1.0.0.dev22 → dementor-1.0.0.dev24}/dementor/protocols/x11.py +0 -0
  59. {dementor-1.0.0.dev22 → dementor-1.0.0.dev24}/dementor/servers.py +0 -0
  60. {dementor-1.0.0.dev22 → dementor-1.0.0.dev24}/dementor/standalone.py +0 -0
  61. {dementor-1.0.0.dev22 → dementor-1.0.0.dev24}/dementor/tui/__init__.py +0 -0
  62. {dementor-1.0.0.dev22 → dementor-1.0.0.dev24}/dementor/tui/action.py +0 -0
  63. {dementor-1.0.0.dev22 → dementor-1.0.0.dev24}/dementor/tui/commands/__init__.py +0 -0
  64. {dementor-1.0.0.dev22 → dementor-1.0.0.dev24}/dementor/tui/commands/config.py +0 -0
  65. {dementor-1.0.0.dev22 → dementor-1.0.0.dev24}/dementor/tui/commands/database.py +0 -0
  66. {dementor-1.0.0.dev22 → dementor-1.0.0.dev24}/dementor/tui/commands/env.py +0 -0
  67. {dementor-1.0.0.dev22 → dementor-1.0.0.dev24}/dementor/tui/commands/help.py +0 -0
  68. {dementor-1.0.0.dev22 → dementor-1.0.0.dev24}/dementor/tui/commands/ipconfig.py +0 -0
  69. {dementor-1.0.0.dev22 → dementor-1.0.0.dev24}/dementor/tui/commands/proto.py +0 -0
  70. {dementor-1.0.0.dev22 → dementor-1.0.0.dev24}/dementor/tui/completer.py +0 -0
  71. {dementor-1.0.0.dev22 → dementor-1.0.0.dev24}/dementor/tui/repl.py +0 -0
  72. {dementor-1.0.0.dev22 → dementor-1.0.0.dev24}/dementor.egg-info/SOURCES.txt +0 -0
  73. {dementor-1.0.0.dev22 → dementor-1.0.0.dev24}/dementor.egg-info/dependency_links.txt +0 -0
  74. {dementor-1.0.0.dev22 → dementor-1.0.0.dev24}/dementor.egg-info/entry_points.txt +0 -0
  75. {dementor-1.0.0.dev22 → dementor-1.0.0.dev24}/dementor.egg-info/requires.txt +0 -0
  76. {dementor-1.0.0.dev22 → dementor-1.0.0.dev24}/dementor.egg-info/top_level.txt +0 -0
  77. {dementor-1.0.0.dev22 → dementor-1.0.0.dev24}/docs/README.pypi.md +0 -0
  78. {dementor-1.0.0.dev22 → dementor-1.0.0.dev24}/setup.cfg +0 -0
  79. {dementor-1.0.0.dev22 → dementor-1.0.0.dev24}/tests/test_db.py +0 -0
  80. {dementor-1.0.0.dev22 → dementor-1.0.0.dev24}/tests/test_db_concurrency.py +0 -0
  81. {dementor-1.0.0.dev22 → dementor-1.0.0.dev24}/tests/test_filters.py +0 -0
  82. {dementor-1.0.0.dev22 → dementor-1.0.0.dev24}/tests/test_logger.py +0 -0
  83. {dementor-1.0.0.dev22 → dementor-1.0.0.dev24}/tests/test_ntlm.py +0 -0
  84. {dementor-1.0.0.dev22 → dementor-1.0.0.dev24}/tests/test_smb.py +0 -0
  85. {dementor-1.0.0.dev22 → dementor-1.0.0.dev24}/tests/test_version.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: dementor
3
- Version: 1.0.0.dev22
3
+ Version: 1.0.0.dev24
4
4
  Summary: LLMNR/NBT-NS/mDNS Poisoner and rogue service provider
5
5
  Author: MatrixEditor
6
6
  Maintainer: MatrixEditor
@@ -18,5 +18,5 @@
18
18
  # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
19
19
  # SOFTWARE.
20
20
 
21
- __version__ = "1.0.0.dev22"
21
+ __version__ = "1.0.0.dev24"
22
22
  __author__ = "MatrixEditor"
@@ -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(self, script: str | None) -> None:
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(f"WPAD script at {path} does not exist - ignoring...")
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(f"WPAD script at {path} is not a file - ignoring...")
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(self._control_char_table) # ty:ignore[unresolved-attribute]
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(HTTPStatus.INTERNAL_SERVER_ERROR, "Internal Server 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",
@@ -111,6 +111,7 @@ class MDNSPoisoner(BaseProtoHandler):
111
111
  def proto_logger(self) -> ProtocolLogger:
112
112
  return ProtocolLogger(
113
113
  {
114
+ "protocol": "mDNS",
114
115
  "protocol_color": "deep_sky_blue1",
115
116
  "host": self.client_host,
116
117
  "port": self.client_port,
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: dementor
3
- Version: 1.0.0.dev22
3
+ Version: 1.0.0.dev24
4
4
  Summary: LLMNR/NBT-NS/mDNS Poisoner and rogue service provider
5
5
  Author: MatrixEditor
6
6
  Maintainer: MatrixEditor
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "dementor"
7
- version = "1.0.0.dev22"
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 -- unavoidable in Sphinx conf.py (copyright)
100
- "A002", # builtin-argument-shadowing -- common in protocol code (type, id)
99
+ "A001", # builtin-variable-shadowing
100
+ "A002", # builtin-argument-shadowing
101
101
 
102
- # --- ANN: flake8-annotations -- use ty for gradual typing ---
102
+ # --- ANN: flake8-annotations
103
103
  "ANN",
104
104
 
105
105
  # --- ARG: flake8-unused-arguments ---
106
- "ARG001", # unused-function-argument -- CLI/callback params required by framework
107
- "ARG002", # unused-method-argument -- interface/callback stubs
106
+ "ARG001", # unused-function-argument
107
+ "ARG002", # unused-method-argument
108
108
 
109
109
  # --- ASYNC: flake8-async ---
110
- "ASYNC240", # blocking-path-method-in-async -- startup-time checks, not hot path
110
+ "ASYNC240", # blocking-path-method-in-async
111
111
 
112
112
  # --- BLE: flake8-blind-except ---
113
- "BLE001", # blind-except -- legitimate in protocol handlers
113
+ "BLE001", # blind-except
114
114
 
115
115
  # --- C90: mccabe ---
116
- "C901", # complex-structure -- protocol handlers are inherently complex
116
+ "C901", # complex-structure
117
117
 
118
118
  # --- COM: flake8-commas ---
119
- "COM812", # missing-trailing-comma -- conflicts with formatter
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 -- too opinionated
126
+ "D401", # non-imperative-mood
127
127
 
128
128
  # --- E: pycodestyle ---
129
- "E501", # line-too-long -- formatter handles what it can
129
+ "E501", # line-too-long
130
130
 
131
131
  # --- EM: flake8-errmsg ---
132
- "EM101", # raw-string-in-exception -- too pedantic
133
- "EM102", # f-string-in-exception -- too pedantic
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 -- not relevant
139
+ "EXE002", # shebang-missing-executable-file
140
140
 
141
141
  # --- FBT: flake8-boolean-trap ---
142
- "FBT", # too strict for config-heavy protocol code
142
+ "FBT",
143
143
 
144
144
  # --- FIX: flake8-fixme ---
145
- "FIX002", # line-contains-todo -- TODOs are intentional
145
+ "FIX002", # line-contains-todo
146
146
 
147
147
  # --- G: flake8-logging-format ---
148
- "G004", # logging-f-string -- f-strings in logging are fine
148
+ "G004", # logging-f-string
149
149
 
150
150
  # --- I: isort ---
151
- "I001", # unsorted-imports -- custom import grouping
151
+ "I001", # unsorted-imports
152
152
 
153
153
  # --- INP: flake8-no-pep420 ---
154
- "INP001", # standalone script directories don't need __init__.py
154
+ "INP001",
155
155
 
156
156
  # --- ISC: flake8-implicit-str-concat ---
157
- "ISC003", # explicit-string-concatenation -- often more readable
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 -- control-flow exceptions are idiomatic
162
+ "N818", # error-suffix
163
163
 
164
164
  # --- PL: Pylint ---
165
- "PLR0912", # too-many-branches -- protocol handlers
166
- "PLR0913", # too-many-arguments -- protocol constructors
167
- "PLR0915", # too-many-statements -- protocol handlers
168
- "PLR2004", # magic-value-comparison -- protocol numeric constants
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 -- low priority
171
+ "PTH", # os.path -> pathlib
172
172
 
173
173
  # --- RET: flake8-return ---
174
- "RET503", # implicit-return -- idiomatic Python
174
+ "RET503", # implicit-return
175
175
 
176
176
  # --- RUF: Ruff-specific rules ---
177
- "RUF003", # ambiguous-unicode-character-comment -- intentional
178
- "RUF012", # mutable-class-default -- false positives with struct-like patterns
177
+ "RUF003", # ambiguous-unicode-character-comment
178
+ "RUF012", # mutable-class-default
179
179
 
180
180
  # --- S: flake8-bandit ---
181
- "S101", # assert -- valid in non-production paths
182
- "S104", # hardcoded-bind-all-interfaces -- intentional for network tool
183
- "S311", # suspicious-non-cryptographic-random -- not used for crypto
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 -- common in internal wiring
186
+ "SLF001", # private-member-access
187
187
 
188
188
  # --- T20: flake8-print ---
189
- "T201", # print -- intentional in CLI/diagnostic code
189
+ "T201", # print
190
190
 
191
191
  # --- TD: flake8-todos ---
192
- "TD002", # missing-todo-author -- not needed for small team
193
- "TD003", # missing-todo-link -- not needed for small team
192
+ "TD002", # missing-todo-author
193
+ "TD003", # missing-todo-link
194
194
 
195
195
  # --- TRY: tryceratops ---
196
- "TRY003", # raise-vanilla-args -- too pedantic
196
+ "TRY003", # raise-vanilla-args
197
197
  ]
198
198
 
199
199
  [tool.ruff.format]
File without changes
File without changes
File without changes