dementor 1.0.0.dev0__tar.gz → 1.0.0.dev2__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.
Potentially problematic release.
This version of dementor might be problematic. Click here for more details.
- {dementor-1.0.0.dev0 → dementor-1.0.0.dev2}/PKG-INFO +1 -1
- dementor-1.0.0.dev2/README.md +58 -0
- {dementor-1.0.0.dev0 → dementor-1.0.0.dev2}/dementor/__init__.py +1 -1
- {dementor-1.0.0.dev0 → dementor-1.0.0.dev2}/dementor/config.py +3 -1
- {dementor-1.0.0.dev0 → dementor-1.0.0.dev2}/dementor/database.py +26 -8
- {dementor-1.0.0.dev0 → dementor-1.0.0.dev2}/dementor/loader.py +15 -6
- {dementor-1.0.0.dev0 → dementor-1.0.0.dev2}/dementor/paths.py +1 -0
- dementor-1.0.0.dev2/dementor/protocols/http.py +494 -0
- {dementor-1.0.0.dev0 → dementor-1.0.0.dev2}/dementor/protocols/llmnr.py +2 -1
- {dementor-1.0.0.dev0 → dementor-1.0.0.dev2}/dementor/protocols/mdns.py +3 -1
- dementor-1.0.0.dev2/dementor/protocols/msrpc/__init__.py +0 -0
- dementor-1.0.0.dev2/dementor/protocols/msrpc/dcom.py +65 -0
- dementor-1.0.0.dev2/dementor/protocols/msrpc/epm.py +72 -0
- dementor-1.0.0.dev2/dementor/protocols/msrpc/rpc.py +374 -0
- dementor-1.0.0.dev2/dementor/protocols/msrpc.py +34 -0
- {dementor-1.0.0.dev0 → dementor-1.0.0.dev2}/dementor/protocols/netbios.py +11 -2
- {dementor-1.0.0.dev0 → dementor-1.0.0.dev2}/dementor/protocols/ntlm.py +4 -0
- {dementor-1.0.0.dev0 → dementor-1.0.0.dev2}/dementor/protocols/quic.py +4 -6
- {dementor-1.0.0.dev0 → dementor-1.0.0.dev2}/dementor/protocols/smtp.py +2 -4
- {dementor-1.0.0.dev0 → dementor-1.0.0.dev2}/dementor/servers.py +11 -11
- {dementor-1.0.0.dev0 → dementor-1.0.0.dev2}/dementor.egg-info/PKG-INFO +1 -1
- {dementor-1.0.0.dev0 → dementor-1.0.0.dev2}/dementor.egg-info/SOURCES.txt +10 -1
- {dementor-1.0.0.dev0 → dementor-1.0.0.dev2}/pyproject.toml +1 -1
- dementor-1.0.0.dev2/test/test_dcerpc.py +15 -0
- dementor-1.0.0.dev2/test/test_dcom.py +51 -0
- dementor-1.0.0.dev2/test/test_epm.py +40 -0
- dementor-1.0.0.dev0/README.md +0 -42
- {dementor-1.0.0.dev0 → dementor-1.0.0.dev2}/LICENSE +0 -0
- {dementor-1.0.0.dev0 → dementor-1.0.0.dev2}/dementor/__main__.py +0 -0
- {dementor-1.0.0.dev0 → dementor-1.0.0.dev2}/dementor/filters.py +0 -0
- {dementor-1.0.0.dev0 → dementor-1.0.0.dev2}/dementor/logger.py +0 -0
- {dementor-1.0.0.dev0 → dementor-1.0.0.dev2}/dementor/protocols/__init__.py +0 -0
- {dementor-1.0.0.dev0 → dementor-1.0.0.dev2}/dementor/protocols/ftp.py +0 -0
- {dementor-1.0.0.dev0 → dementor-1.0.0.dev2}/dementor/protocols/kerberos.py +0 -0
- {dementor-1.0.0.dev0 → dementor-1.0.0.dev2}/dementor/protocols/ldap.py +0 -0
- {dementor-1.0.0.dev0 → dementor-1.0.0.dev2}/dementor/protocols/smb.py +0 -0
- {dementor-1.0.0.dev0 → dementor-1.0.0.dev2}/dementor/protocols/spnego.py +0 -0
- {dementor-1.0.0.dev0 → dementor-1.0.0.dev2}/dementor/standalone.py +2 -2
- {dementor-1.0.0.dev0 → dementor-1.0.0.dev2}/dementor.egg-info/dependency_links.txt +0 -0
- {dementor-1.0.0.dev0 → dementor-1.0.0.dev2}/dementor.egg-info/entry_points.txt +0 -0
- {dementor-1.0.0.dev0 → dementor-1.0.0.dev2}/dementor.egg-info/top_level.txt +0 -0
- {dementor-1.0.0.dev0 → dementor-1.0.0.dev2}/docs/README.pypi.md +0 -0
- {dementor-1.0.0.dev0 → dementor-1.0.0.dev2}/setup.cfg +0 -0
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
# Dementor
|
|
2
|
+
|
|
3
|
+
IPv6/IPv4 LLMNR/NBT-NS/mDNS Poisoner and rogue service provider - you can think if it as Responder 2.0. Get more information
|
|
4
|
+
on the [Documentation](https://matrixeditor.github.io/dementor/) page.
|
|
5
|
+
|
|
6
|
+
### Offers
|
|
7
|
+
|
|
8
|
+
- No reliance on hardcoded or precomputed packets
|
|
9
|
+
- Fine-grained, per-protocol configuration using a modular system (see [Docs - Configuration](https://matrixeditor.github.io/dementor/config/index.html))
|
|
10
|
+
- Near-complete protocol parity with Responder (see [Docs - Compatibility](https://matrixeditor.github.io/dementor/compat.html))
|
|
11
|
+
- Easy integration of new protocols via the extension system
|
|
12
|
+
|
|
13
|
+
## Installation
|
|
14
|
+
|
|
15
|
+
Installation via `pip` from GitHub or PyPI:
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
pip install dementor
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## Usage
|
|
22
|
+
|
|
23
|
+
Just type in _Dementor_, specify the target interface and you are good to go! It is recommended
|
|
24
|
+
to run _Dementor_ with `sudo` as most protocol servers use privileged ports.
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
sudo Dementor -I "$INTERFACE_NAME"
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
Let's take a look.
|
|
31
|
+
|
|
32
|
+

|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
### CLI Options
|
|
36
|
+
|
|
37
|
+
```
|
|
38
|
+
Usage: Dementor [OPTIONS]
|
|
39
|
+
|
|
40
|
+
╭─ Options ──────────────────────────────────────────────────────────────────────────────────────────╮
|
|
41
|
+
│ * --interface -I NAME Network interface to use (required for poisoning) [required] │
|
|
42
|
+
│ --analyze -A Only analyze traffic, don't respond to requests │
|
|
43
|
+
│ --config -c PATH Path to a configuration file (otherwise standard path is used) │
|
|
44
|
+
│ --option -O KEY=VALUE Add an extra option to the global configuration file. │
|
|
45
|
+
│ --quiet -q Don't print banner at startup │
|
|
46
|
+
│ --help Show this message and exit. │
|
|
47
|
+
╰────────────────────────────────────────────────────────────────────────────────────────────────────╯
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
## You need more?
|
|
52
|
+
|
|
53
|
+
Take a look at the [Documentation on GitHub-Pages](https://matrixeditor.github.io/dementor/)
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
## License
|
|
57
|
+
|
|
58
|
+
Distributed under the MIT License. See LICENSE for more information.
|
|
@@ -149,7 +149,9 @@ class SessionConfig(TomlConfig):
|
|
|
149
149
|
Attribute("kdc_enabled", "KDC", True, factory=is_true),
|
|
150
150
|
Attribute("ldap_enabled", "LDAP", True, factory=is_true),
|
|
151
151
|
Attribute("quic_enabled", "QUIC", True, factory=is_true),
|
|
152
|
-
Attribute("mdns_enabled", "
|
|
152
|
+
Attribute("mdns_enabled", "mDNS", True, factory=is_true),
|
|
153
|
+
Attribute("http_enabled", "HTTP", True, factory=is_true),
|
|
154
|
+
Attribute("msrpc_enabled", "RPC", True, factory=is_true),
|
|
153
155
|
Attribute("extra_modules", "ExtraModules", list),
|
|
154
156
|
Attribute("workspace_path", "Workspace", DEMENTOR_PATH),
|
|
155
157
|
]
|
|
@@ -18,12 +18,12 @@
|
|
|
18
18
|
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
19
19
|
# SOFTWARE.
|
|
20
20
|
import threading
|
|
21
|
-
import os
|
|
22
21
|
import sqlite3
|
|
23
22
|
import pathlib
|
|
24
23
|
|
|
25
24
|
from datetime import datetime
|
|
26
25
|
from typing import Any, Tuple
|
|
26
|
+
from rich import markup
|
|
27
27
|
|
|
28
28
|
from sqlalchemy.engine import Engine, create_engine
|
|
29
29
|
from sqlalchemy.orm import scoped_session, sessionmaker
|
|
@@ -86,6 +86,7 @@ def normalize_client_address(client: str) -> str:
|
|
|
86
86
|
|
|
87
87
|
|
|
88
88
|
_CLEARTEXT = "Cleartext"
|
|
89
|
+
_NO_USER = "<missing-user>"
|
|
89
90
|
|
|
90
91
|
|
|
91
92
|
class DementorDB:
|
|
@@ -165,6 +166,7 @@ class DementorDB:
|
|
|
165
166
|
protocol: str | None = None,
|
|
166
167
|
domain: str | None = None,
|
|
167
168
|
hostname: str | None = None,
|
|
169
|
+
extras: dict | None = None,
|
|
168
170
|
) -> None:
|
|
169
171
|
if not logger and not protocol:
|
|
170
172
|
dm_logger.error(
|
|
@@ -196,7 +198,9 @@ class DementorDB:
|
|
|
196
198
|
results = self.db_exec(q).all()
|
|
197
199
|
text = "Password" if credtype == _CLEARTEXT else "Hash"
|
|
198
200
|
full_name = (
|
|
199
|
-
f"[b]{username}[/]/[b]{domain}[/]"
|
|
201
|
+
f"[b]{markup.escape(username)}[/]/[b]{markup.escape(domain)}[/]"
|
|
202
|
+
if domain
|
|
203
|
+
else f"[b]{markup.escape(username)}[/]"
|
|
200
204
|
)
|
|
201
205
|
if not results or self.config.db_config.db_duplicate_creds:
|
|
202
206
|
# just insert a new row
|
|
@@ -219,17 +223,31 @@ class DementorDB:
|
|
|
219
223
|
host=hostname or client_address,
|
|
220
224
|
locked=True,
|
|
221
225
|
)
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
226
|
+
if username != _NO_USER:
|
|
227
|
+
target_logger.highlight(
|
|
228
|
+
f"{credtype} Username: {markup.escape(username)}",
|
|
229
|
+
host=hostname or client_address,
|
|
230
|
+
locked=True,
|
|
231
|
+
)
|
|
227
232
|
|
|
228
233
|
target_logger.highlight(
|
|
229
|
-
f"{credtype} {text}: {password}",
|
|
234
|
+
f"{credtype} {text}: {markup.escape(password)}",
|
|
230
235
|
host=hostname or client_address,
|
|
231
236
|
locked=True,
|
|
232
237
|
)
|
|
238
|
+
if extras:
|
|
239
|
+
target_logger.highlight(
|
|
240
|
+
f"{credtype} Extras:",
|
|
241
|
+
host=hostname or client_address,
|
|
242
|
+
locked=True,
|
|
243
|
+
)
|
|
244
|
+
|
|
245
|
+
for name, value in (extras or {}).items():
|
|
246
|
+
target_logger.highlight(
|
|
247
|
+
f" {name}: {markup.escape(value)}",
|
|
248
|
+
host=hostname or client_address,
|
|
249
|
+
locked=True,
|
|
250
|
+
)
|
|
233
251
|
|
|
234
252
|
else:
|
|
235
253
|
target_logger.highlight(
|
|
@@ -18,6 +18,7 @@
|
|
|
18
18
|
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
19
19
|
# SOFTWARE.
|
|
20
20
|
import argparse
|
|
21
|
+
from ntpath import isfile
|
|
21
22
|
import types
|
|
22
23
|
import os
|
|
23
24
|
import dementor
|
|
@@ -30,6 +31,10 @@ from dementor.paths import DEMENTOR_PATH
|
|
|
30
31
|
class ProtocolLoader:
|
|
31
32
|
def __init__(self) -> None:
|
|
32
33
|
self.rs_path = os.path.join(DEMENTOR_PATH, "protocols")
|
|
34
|
+
self.search_path = [
|
|
35
|
+
os.path.join(os.path.dirname(dementor.__file__), "protocols"),
|
|
36
|
+
self.rs_path,
|
|
37
|
+
]
|
|
33
38
|
|
|
34
39
|
def load_protocol(self, protocol_path: str) -> types.ModuleType:
|
|
35
40
|
loader = SourceFileLoader("protocol", protocol_path)
|
|
@@ -39,10 +44,7 @@ class ProtocolLoader:
|
|
|
39
44
|
|
|
40
45
|
def get_protocols(self, session=None):
|
|
41
46
|
protocols = {}
|
|
42
|
-
protocol_paths =
|
|
43
|
-
os.path.join(os.path.dirname(dementor.__file__), "protocols"),
|
|
44
|
-
self.rs_path,
|
|
45
|
-
]
|
|
47
|
+
protocol_paths = list(self.search_path)
|
|
46
48
|
|
|
47
49
|
if session is not None:
|
|
48
50
|
protocol_paths.extend(session.extra_modules)
|
|
@@ -51,8 +53,16 @@ class ProtocolLoader:
|
|
|
51
53
|
if not os.path.exists(path):
|
|
52
54
|
continue
|
|
53
55
|
|
|
54
|
-
|
|
56
|
+
if os.path.isfile(path):
|
|
57
|
+
if not path.endswith(".py"):
|
|
58
|
+
continue
|
|
59
|
+
|
|
60
|
+
protocol_path = path
|
|
61
|
+
name = os.path.basename(path)[:-3]
|
|
62
|
+
protocols[name] = protocol_path
|
|
63
|
+
continue
|
|
55
64
|
|
|
65
|
+
# TODO: check for directory
|
|
56
66
|
for filename in os.listdir(path):
|
|
57
67
|
if not filename.endswith(".py") or filename == "__init__.py":
|
|
58
68
|
continue
|
|
@@ -87,4 +97,3 @@ class ProtocolLoader:
|
|
|
87
97
|
return protocol.create_server_threads(session)
|
|
88
98
|
|
|
89
99
|
return []
|
|
90
|
-
|
|
@@ -24,3 +24,4 @@ DEMENTOR_PATH = os.path.expanduser("~/.dementor")
|
|
|
24
24
|
CONFIG_PATH = os.path.join(DEMENTOR_PATH, "Dementor.conf")
|
|
25
25
|
ASSETS_PATH = os.path.join(os.path.dirname(dementor.__file__), "assets")
|
|
26
26
|
BANNER_PATH = os.path.join(ASSETS_PATH, "banner.txt")
|
|
27
|
+
HTTP_TEMPLATES_PATH = os.path.join(ASSETS_PATH, "www")
|