adpentest 1.0.0__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.
- adpentest-1.0.0/LICENSE +21 -0
- adpentest-1.0.0/PKG-INFO +215 -0
- adpentest-1.0.0/README.md +177 -0
- adpentest-1.0.0/adpentest/__init__.py +1 -0
- adpentest-1.0.0/adpentest/__main__.py +3 -0
- adpentest-1.0.0/adpentest/core.py +4013 -0
- adpentest-1.0.0/adpentest.egg-info/PKG-INFO +215 -0
- adpentest-1.0.0/adpentest.egg-info/SOURCES.txt +12 -0
- adpentest-1.0.0/adpentest.egg-info/dependency_links.txt +1 -0
- adpentest-1.0.0/adpentest.egg-info/entry_points.txt +2 -0
- adpentest-1.0.0/adpentest.egg-info/requires.txt +9 -0
- adpentest-1.0.0/adpentest.egg-info/top_level.txt +1 -0
- adpentest-1.0.0/pyproject.toml +82 -0
- adpentest-1.0.0/setup.cfg +4 -0
adpentest-1.0.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Netanel Cyber
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
adpentest-1.0.0/PKG-INFO
ADDED
|
@@ -0,0 +1,215 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: adpentest
|
|
3
|
+
Version: 1.0.0
|
|
4
|
+
Summary: Active Directory penetration testing framework with automatic Domain Controller detection
|
|
5
|
+
Author-email: Netanel Cyber <nsh531@gmail.com>
|
|
6
|
+
License: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/netanelcyber/AdPentestAI-Python
|
|
8
|
+
Project-URL: Repository, https://github.com/netanelcyber/AdPentestAI-Python.git
|
|
9
|
+
Project-URL: Issues, https://github.com/netanelcyber/AdPentestAI-Python/issues
|
|
10
|
+
Project-URL: Documentation, https://github.com/netanelcyber/AdPentestAI-Python/blob/main/README.md
|
|
11
|
+
Keywords: active-directory,penetration-testing,ad-enumeration,kerberos,smb,ldap,security,offensive-security,red-team
|
|
12
|
+
Classifier: Development Status :: 4 - Beta
|
|
13
|
+
Classifier: Environment :: Console
|
|
14
|
+
Classifier: Intended Audience :: Information Technology
|
|
15
|
+
Classifier: Intended Audience :: System Administrators
|
|
16
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
17
|
+
Classifier: Natural Language :: English
|
|
18
|
+
Classifier: Operating System :: OS Independent
|
|
19
|
+
Classifier: Programming Language :: Python :: 3
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
22
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
23
|
+
Classifier: Topic :: System :: Networking
|
|
24
|
+
Classifier: Topic :: System :: Systems Administration
|
|
25
|
+
Classifier: Topic :: Security
|
|
26
|
+
Requires-Python: >=3.10
|
|
27
|
+
Description-Content-Type: text/markdown
|
|
28
|
+
License-File: LICENSE
|
|
29
|
+
Requires-Dist: httpx<1,>=0.27
|
|
30
|
+
Requires-Dist: dnspython<3,>=2.4
|
|
31
|
+
Requires-Dist: ldap3<3,>=2.9
|
|
32
|
+
Provides-Extra: dev
|
|
33
|
+
Requires-Dist: pytest>=7.0; extra == "dev"
|
|
34
|
+
Requires-Dist: black>=23.0; extra == "dev"
|
|
35
|
+
Requires-Dist: flake8>=6.0; extra == "dev"
|
|
36
|
+
Requires-Dist: mypy>=1.0; extra == "dev"
|
|
37
|
+
Dynamic: license-file
|
|
38
|
+
|
|
39
|
+
# AdPentestAI-Python
|
|
40
|
+
|
|
41
|
+
Active Directory penetration testing framework with **automatic Domain Controller detection**.
|
|
42
|
+
|
|
43
|
+
## Features
|
|
44
|
+
|
|
45
|
+
- **Auto DC Detection** — discovers Domain Controllers via DNS SRV records, LDAP RootDSE probes, and port fingerprinting
|
|
46
|
+
- **Subnet expansion** — scans /24 first, widens to /23 if no DC found
|
|
47
|
+
- **Domain auto-discovery** — extracts domain name from LDAP RootDSE defaultNamingContext
|
|
48
|
+
- **DC FQDN resolution** — multi-source FQDN lookup with live LDAP probe fallback, forward DNS verification
|
|
49
|
+
- **DC-aware tool execution** — passes discovered domain, DC IP, and FQDN to tools
|
|
50
|
+
- **29 AD/SMB/Kerberos/ADCS/Email tools** — 12 cross-platform binaries + 3 Windows-native PowerShell + 3 Kerberos attack + 4 ADCS certificate attacks + 5 Email protocol enumeration
|
|
51
|
+
- **SMB pentesting** — null session detection, share enumeration, SMB signing detection, credential testing
|
|
52
|
+
- **Windows-native tools** — built-in PowerShell enumeration for LDAP, SMB, and AD forest discovery (no external dependencies on Windows)
|
|
53
|
+
- **Cross-platform** — runs on Linux, macOS, and Windows with platform-specific optimizations
|
|
54
|
+
- **Auto-install** — missing tools installed automatically via apt/pip/git (or native on Windows)
|
|
55
|
+
- **Safety** — `dry-run` is the default; `--scope-confirmed` required for authorization
|
|
56
|
+
|
|
57
|
+
## DC Detection Strategies
|
|
58
|
+
|
|
59
|
+
1. **DNS SRV** — queries `_ldap._tcp.dc._msdcs.<domain>`, `_kerberos._tcp.dc._msdcs.<domain>`, etc.
|
|
60
|
+
2. **LDAP RootDSE** — anonymous bind to extract domain, forest level, hostname
|
|
61
|
+
3. **Port fingerprint** — checks Kerberos (88), LDAP (389/636), Global Catalog (3268/3269)
|
|
62
|
+
4. **Subnet sweep** — Kerberos port 88 quick-scan on /24, expands to /23, then /22 if no DCs found
|
|
63
|
+
|
|
64
|
+
## SMB Pentesting Capabilities
|
|
65
|
+
|
|
66
|
+
- **Null session detection** — checks if targets allow anonymous SMB access (IPC$)
|
|
67
|
+
- **Share enumeration** — discovers available SMB shares via CrackMapExec and smbmap
|
|
68
|
+
- **SMB signing detection** — identifies if SMB message signing is enforced (via nmap scripts)
|
|
69
|
+
- **Credential testing** — attempts connection with guest/empty credentials via impacket tools
|
|
70
|
+
- **Secretsdump** — extracts NTLM hashes and session keys when null credentials work
|
|
71
|
+
- **PsExec simulation** — tests command execution capability via impacket psexec
|
|
72
|
+
|
|
73
|
+
## Kerberos/Kerberoasting Attack Vectors
|
|
74
|
+
|
|
75
|
+
- **GetUserSPNs** — enumerates service principal names (SPN) via LDAP (custom implementation, no impacket needed)
|
|
76
|
+
- **AS-REP Roasting** — targets accounts with DONT_REQUIRE_PREAUTH flag for offline cracking
|
|
77
|
+
- **Kerberoasting** — extracts and cracks service account tickets via TGS-REQ requests
|
|
78
|
+
- **Requires:** null/guest credentials or valid domain account (LDAP access for SPN enumeration)
|
|
79
|
+
- **Output formats:** .txt files compatible with Hashcat/John for cracking
|
|
80
|
+
- **Implementation:** Pure Python LDAP-based tools (ldap3, no external binaries)
|
|
81
|
+
|
|
82
|
+
## ADCS Certificate Attack Vectors
|
|
83
|
+
|
|
84
|
+
- **Shadow Credentials** — exploits ADCS to inject shadow credentials for account takeover via certificate-based authentication
|
|
85
|
+
- **ESC1** — template misconfiguration allowing client authentication without enrollment agent
|
|
86
|
+
- **ESC3** — enrollment agent misconfig enabling privilege escalation via certificate requests
|
|
87
|
+
- **ESC9** — object control abuse via ADCS certificate manipulation
|
|
88
|
+
- **Tools:** Certipy-AD automated enumeration and exploitation
|
|
89
|
+
- **Attack chain:** certificate enumeration → template analysis → credential extraction → privilege escalation
|
|
90
|
+
|
|
91
|
+
## Windows-Native Tools
|
|
92
|
+
|
|
93
|
+
**PowerShell enumeration (built-in, no external dependencies on Windows):**
|
|
94
|
+
- **powershell_ldap_enum** — LDAP RootDSE queries via .NET DirectoryServices
|
|
95
|
+
- **powershell_smb_enum** — SMB share enumeration via Get-SmbShare
|
|
96
|
+
- **powershell_ad_recon** — Forest/domain/DC discovery via AD API
|
|
97
|
+
|
|
98
|
+
**Python-based Enumeration Engines:**
|
|
99
|
+
- **enum_windows_py** — Pure Python enum4linux-ng replacement (LDAP + SMB + policy enumeration)
|
|
100
|
+
- Null session detection and exploitation
|
|
101
|
+
- Domain policy extraction (password complexity, lockout settings)
|
|
102
|
+
- SMB share discovery via impacket
|
|
103
|
+
- Works on Windows, Linux, macOS
|
|
104
|
+
- Uses ldap3 + impacket (already required dependencies)
|
|
105
|
+
|
|
106
|
+
- **SPNEnumerator** — Custom LDAP-based Service Principal Name enumeration
|
|
107
|
+
- Direct LDAP queries to extract SPNs without impacket.examples.GetUserSPNs
|
|
108
|
+
- Anonymous LDAP bind capability
|
|
109
|
+
- Hashcat/John compatible output format
|
|
110
|
+
- Pure Python implementation (ldap3 only)
|
|
111
|
+
|
|
112
|
+
**Cross-platform Tools:**
|
|
113
|
+
- 12 binary tools (nmap, masscan, crackmapexec, smbmap, bloodhound, etc.)
|
|
114
|
+
- All tools auto-install via apt/pip/git based on platform
|
|
115
|
+
|
|
116
|
+
## Email Protocol Enumeration & Credential Testing
|
|
117
|
+
|
|
118
|
+
**Pure Python email enumeration (no external dependencies):**
|
|
119
|
+
|
|
120
|
+
- **SMTP User Enumeration** — Discover valid email addresses via:
|
|
121
|
+
- SMTP VRFY command (traditional user discovery)
|
|
122
|
+
- SMTP RCPT TO validation (validate recipient addresses)
|
|
123
|
+
- Service banner detection (Exchange/Postfix/Sendmail identification)
|
|
124
|
+
- Ports: 25 (plain), 465 (SMTPS), 587 (SMTP TLS)
|
|
125
|
+
|
|
126
|
+
- **Credential Testing with Protocol Fallback** — Automatic fallback chain:
|
|
127
|
+
- **Primary:** SMTP AUTH (ports 25, 465, 587)
|
|
128
|
+
- **Fallback:** POP3 AUTH (ports 110, 995)
|
|
129
|
+
- **Fallback:** IMAP AUTH (ports 143, 993)
|
|
130
|
+
- Tests multiple credentials until success or all protocols exhausted
|
|
131
|
+
- Supports TLS/SSL connections for secure ports
|
|
132
|
+
|
|
133
|
+
- **Email Service Detection** — Identify email infrastructure:
|
|
134
|
+
- Exchange on-premises (2016, 2019, 2021)
|
|
135
|
+
- Office 365 cloud detection (outlook.office365.com routing)
|
|
136
|
+
- Server banner parsing and version detection
|
|
137
|
+
- Concurrent port scanning for email services
|
|
138
|
+
|
|
139
|
+
- **Implementation:** Pure Python using standard library (smtplib, poplib, imaplib)
|
|
140
|
+
- No external tool dependencies
|
|
141
|
+
- Cross-platform (Windows, Linux, macOS)
|
|
142
|
+
- Works on any Python 3.10+ environment
|
|
143
|
+
|
|
144
|
+
**Output Format:**
|
|
145
|
+
- Valid users discovered via SMTP enumeration
|
|
146
|
+
- Working credentials (username, password, protocol, server, port)
|
|
147
|
+
- Email service type and version
|
|
148
|
+
- Protocol availability (which protocols respond on target)
|
|
149
|
+
- Comprehensive failure logging for debugging
|
|
150
|
+
|
|
151
|
+
## Run
|
|
152
|
+
|
|
153
|
+
```bash
|
|
154
|
+
# Dry-run (check tools, detect DCs, preview commands)
|
|
155
|
+
python -m adpentest --target 10.0.0.1 --mode dry-run --scope-confirmed
|
|
156
|
+
|
|
157
|
+
# Active scan with auto DC detection
|
|
158
|
+
python -m adpentest --target corp.local --mode active --scope-confirmed
|
|
159
|
+
|
|
160
|
+
# With custom timeout, no auto-install
|
|
161
|
+
python -m adpentest --target 192.168.1.10 --mode active --scope-confirmed --timeout 600 --no-auto-install
|
|
162
|
+
|
|
163
|
+
# With custom DNS servers (fallback to public DNS on failure)
|
|
164
|
+
python -m adpentest --target 192.168.1.10 --mode active --scope-confirmed --dns-server 1.1.1.1,1.0.0.1
|
|
165
|
+
|
|
166
|
+
# With custom DNS timeout (in seconds)
|
|
167
|
+
python -m adpentest --target 192.168.1.10 --mode active --scope-confirmed --dns-timeout 5.0
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
## DNS Configuration
|
|
171
|
+
|
|
172
|
+
The framework supports flexible DNS resolver configuration with automatic fallback:
|
|
173
|
+
|
|
174
|
+
### CLI Arguments
|
|
175
|
+
- `--dns-server <servers>` — Comma-separated list of custom DNS servers (e.g., `8.8.8.8,8.8.4.4`)
|
|
176
|
+
- `--dns-timeout <seconds>` — DNS query timeout in seconds (default: 3.0)
|
|
177
|
+
|
|
178
|
+
### Environment Variables
|
|
179
|
+
- `DNS_SERVERS` — Comma-separated DNS servers (e.g., `export DNS_SERVERS=8.8.8.8,8.8.4.4`)
|
|
180
|
+
- `DNS_TIMEOUT` — DNS query timeout in seconds (e.g., `export DNS_TIMEOUT=5.0`)
|
|
181
|
+
|
|
182
|
+
### Priority Order
|
|
183
|
+
1. **CLI Arguments** (`--dns-server`, `--dns-timeout`) — Highest priority
|
|
184
|
+
2. **Environment Variables** (`DNS_SERVERS`, `DNS_TIMEOUT`)
|
|
185
|
+
3. **System Default DNS** — Automatically detected from system configuration
|
|
186
|
+
4. **Public DNS Fallback** — Automatically uses `8.8.8.8`, `8.8.4.4`, `1.1.1.1`, `1.0.0.1` if others fail
|
|
187
|
+
|
|
188
|
+
### Examples
|
|
189
|
+
|
|
190
|
+
```bash
|
|
191
|
+
# Use custom DNS servers from CLI
|
|
192
|
+
python -m adpentest --target corp.local --mode active --scope-confirmed --dns-server 192.168.1.1,8.8.8.8
|
|
193
|
+
|
|
194
|
+
# Use environment variables for DNS
|
|
195
|
+
export DNS_SERVERS=192.168.1.1,1.1.1.1
|
|
196
|
+
export DNS_TIMEOUT=5.0
|
|
197
|
+
python -m adpentest --target corp.local --mode active --scope-confirmed
|
|
198
|
+
|
|
199
|
+
# Combine CLI with custom timeout
|
|
200
|
+
python -m adpentest --target corp.local --mode active --scope-confirmed --dns-server 8.8.8.8 --dns-timeout 10.0
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
## Resolver Behavior
|
|
204
|
+
|
|
205
|
+
- **System DNS** is queried first by default
|
|
206
|
+
- **Automatic fallback** to public DNS (Cloudflare, Google) on timeout or resolution failure
|
|
207
|
+
- **Detailed logging** shows which resolver is used and why (system, environment, CLI, or fallback)
|
|
208
|
+
- **All DNS functions** (SRV records, PTR lookups, forward resolution) use centralized configuration
|
|
209
|
+
|
|
210
|
+
## Requirements
|
|
211
|
+
|
|
212
|
+
- Python 3.10+
|
|
213
|
+
- `dnspython`, `ldap3`, `httpx`
|
|
214
|
+
|
|
215
|
+
This project does not authorize testing by itself. Operators must supply an explicitly authorized scope.
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
# AdPentestAI-Python
|
|
2
|
+
|
|
3
|
+
Active Directory penetration testing framework with **automatic Domain Controller detection**.
|
|
4
|
+
|
|
5
|
+
## Features
|
|
6
|
+
|
|
7
|
+
- **Auto DC Detection** — discovers Domain Controllers via DNS SRV records, LDAP RootDSE probes, and port fingerprinting
|
|
8
|
+
- **Subnet expansion** — scans /24 first, widens to /23 if no DC found
|
|
9
|
+
- **Domain auto-discovery** — extracts domain name from LDAP RootDSE defaultNamingContext
|
|
10
|
+
- **DC FQDN resolution** — multi-source FQDN lookup with live LDAP probe fallback, forward DNS verification
|
|
11
|
+
- **DC-aware tool execution** — passes discovered domain, DC IP, and FQDN to tools
|
|
12
|
+
- **29 AD/SMB/Kerberos/ADCS/Email tools** — 12 cross-platform binaries + 3 Windows-native PowerShell + 3 Kerberos attack + 4 ADCS certificate attacks + 5 Email protocol enumeration
|
|
13
|
+
- **SMB pentesting** — null session detection, share enumeration, SMB signing detection, credential testing
|
|
14
|
+
- **Windows-native tools** — built-in PowerShell enumeration for LDAP, SMB, and AD forest discovery (no external dependencies on Windows)
|
|
15
|
+
- **Cross-platform** — runs on Linux, macOS, and Windows with platform-specific optimizations
|
|
16
|
+
- **Auto-install** — missing tools installed automatically via apt/pip/git (or native on Windows)
|
|
17
|
+
- **Safety** — `dry-run` is the default; `--scope-confirmed` required for authorization
|
|
18
|
+
|
|
19
|
+
## DC Detection Strategies
|
|
20
|
+
|
|
21
|
+
1. **DNS SRV** — queries `_ldap._tcp.dc._msdcs.<domain>`, `_kerberos._tcp.dc._msdcs.<domain>`, etc.
|
|
22
|
+
2. **LDAP RootDSE** — anonymous bind to extract domain, forest level, hostname
|
|
23
|
+
3. **Port fingerprint** — checks Kerberos (88), LDAP (389/636), Global Catalog (3268/3269)
|
|
24
|
+
4. **Subnet sweep** — Kerberos port 88 quick-scan on /24, expands to /23, then /22 if no DCs found
|
|
25
|
+
|
|
26
|
+
## SMB Pentesting Capabilities
|
|
27
|
+
|
|
28
|
+
- **Null session detection** — checks if targets allow anonymous SMB access (IPC$)
|
|
29
|
+
- **Share enumeration** — discovers available SMB shares via CrackMapExec and smbmap
|
|
30
|
+
- **SMB signing detection** — identifies if SMB message signing is enforced (via nmap scripts)
|
|
31
|
+
- **Credential testing** — attempts connection with guest/empty credentials via impacket tools
|
|
32
|
+
- **Secretsdump** — extracts NTLM hashes and session keys when null credentials work
|
|
33
|
+
- **PsExec simulation** — tests command execution capability via impacket psexec
|
|
34
|
+
|
|
35
|
+
## Kerberos/Kerberoasting Attack Vectors
|
|
36
|
+
|
|
37
|
+
- **GetUserSPNs** — enumerates service principal names (SPN) via LDAP (custom implementation, no impacket needed)
|
|
38
|
+
- **AS-REP Roasting** — targets accounts with DONT_REQUIRE_PREAUTH flag for offline cracking
|
|
39
|
+
- **Kerberoasting** — extracts and cracks service account tickets via TGS-REQ requests
|
|
40
|
+
- **Requires:** null/guest credentials or valid domain account (LDAP access for SPN enumeration)
|
|
41
|
+
- **Output formats:** .txt files compatible with Hashcat/John for cracking
|
|
42
|
+
- **Implementation:** Pure Python LDAP-based tools (ldap3, no external binaries)
|
|
43
|
+
|
|
44
|
+
## ADCS Certificate Attack Vectors
|
|
45
|
+
|
|
46
|
+
- **Shadow Credentials** — exploits ADCS to inject shadow credentials for account takeover via certificate-based authentication
|
|
47
|
+
- **ESC1** — template misconfiguration allowing client authentication without enrollment agent
|
|
48
|
+
- **ESC3** — enrollment agent misconfig enabling privilege escalation via certificate requests
|
|
49
|
+
- **ESC9** — object control abuse via ADCS certificate manipulation
|
|
50
|
+
- **Tools:** Certipy-AD automated enumeration and exploitation
|
|
51
|
+
- **Attack chain:** certificate enumeration → template analysis → credential extraction → privilege escalation
|
|
52
|
+
|
|
53
|
+
## Windows-Native Tools
|
|
54
|
+
|
|
55
|
+
**PowerShell enumeration (built-in, no external dependencies on Windows):**
|
|
56
|
+
- **powershell_ldap_enum** — LDAP RootDSE queries via .NET DirectoryServices
|
|
57
|
+
- **powershell_smb_enum** — SMB share enumeration via Get-SmbShare
|
|
58
|
+
- **powershell_ad_recon** — Forest/domain/DC discovery via AD API
|
|
59
|
+
|
|
60
|
+
**Python-based Enumeration Engines:**
|
|
61
|
+
- **enum_windows_py** — Pure Python enum4linux-ng replacement (LDAP + SMB + policy enumeration)
|
|
62
|
+
- Null session detection and exploitation
|
|
63
|
+
- Domain policy extraction (password complexity, lockout settings)
|
|
64
|
+
- SMB share discovery via impacket
|
|
65
|
+
- Works on Windows, Linux, macOS
|
|
66
|
+
- Uses ldap3 + impacket (already required dependencies)
|
|
67
|
+
|
|
68
|
+
- **SPNEnumerator** — Custom LDAP-based Service Principal Name enumeration
|
|
69
|
+
- Direct LDAP queries to extract SPNs without impacket.examples.GetUserSPNs
|
|
70
|
+
- Anonymous LDAP bind capability
|
|
71
|
+
- Hashcat/John compatible output format
|
|
72
|
+
- Pure Python implementation (ldap3 only)
|
|
73
|
+
|
|
74
|
+
**Cross-platform Tools:**
|
|
75
|
+
- 12 binary tools (nmap, masscan, crackmapexec, smbmap, bloodhound, etc.)
|
|
76
|
+
- All tools auto-install via apt/pip/git based on platform
|
|
77
|
+
|
|
78
|
+
## Email Protocol Enumeration & Credential Testing
|
|
79
|
+
|
|
80
|
+
**Pure Python email enumeration (no external dependencies):**
|
|
81
|
+
|
|
82
|
+
- **SMTP User Enumeration** — Discover valid email addresses via:
|
|
83
|
+
- SMTP VRFY command (traditional user discovery)
|
|
84
|
+
- SMTP RCPT TO validation (validate recipient addresses)
|
|
85
|
+
- Service banner detection (Exchange/Postfix/Sendmail identification)
|
|
86
|
+
- Ports: 25 (plain), 465 (SMTPS), 587 (SMTP TLS)
|
|
87
|
+
|
|
88
|
+
- **Credential Testing with Protocol Fallback** — Automatic fallback chain:
|
|
89
|
+
- **Primary:** SMTP AUTH (ports 25, 465, 587)
|
|
90
|
+
- **Fallback:** POP3 AUTH (ports 110, 995)
|
|
91
|
+
- **Fallback:** IMAP AUTH (ports 143, 993)
|
|
92
|
+
- Tests multiple credentials until success or all protocols exhausted
|
|
93
|
+
- Supports TLS/SSL connections for secure ports
|
|
94
|
+
|
|
95
|
+
- **Email Service Detection** — Identify email infrastructure:
|
|
96
|
+
- Exchange on-premises (2016, 2019, 2021)
|
|
97
|
+
- Office 365 cloud detection (outlook.office365.com routing)
|
|
98
|
+
- Server banner parsing and version detection
|
|
99
|
+
- Concurrent port scanning for email services
|
|
100
|
+
|
|
101
|
+
- **Implementation:** Pure Python using standard library (smtplib, poplib, imaplib)
|
|
102
|
+
- No external tool dependencies
|
|
103
|
+
- Cross-platform (Windows, Linux, macOS)
|
|
104
|
+
- Works on any Python 3.10+ environment
|
|
105
|
+
|
|
106
|
+
**Output Format:**
|
|
107
|
+
- Valid users discovered via SMTP enumeration
|
|
108
|
+
- Working credentials (username, password, protocol, server, port)
|
|
109
|
+
- Email service type and version
|
|
110
|
+
- Protocol availability (which protocols respond on target)
|
|
111
|
+
- Comprehensive failure logging for debugging
|
|
112
|
+
|
|
113
|
+
## Run
|
|
114
|
+
|
|
115
|
+
```bash
|
|
116
|
+
# Dry-run (check tools, detect DCs, preview commands)
|
|
117
|
+
python -m adpentest --target 10.0.0.1 --mode dry-run --scope-confirmed
|
|
118
|
+
|
|
119
|
+
# Active scan with auto DC detection
|
|
120
|
+
python -m adpentest --target corp.local --mode active --scope-confirmed
|
|
121
|
+
|
|
122
|
+
# With custom timeout, no auto-install
|
|
123
|
+
python -m adpentest --target 192.168.1.10 --mode active --scope-confirmed --timeout 600 --no-auto-install
|
|
124
|
+
|
|
125
|
+
# With custom DNS servers (fallback to public DNS on failure)
|
|
126
|
+
python -m adpentest --target 192.168.1.10 --mode active --scope-confirmed --dns-server 1.1.1.1,1.0.0.1
|
|
127
|
+
|
|
128
|
+
# With custom DNS timeout (in seconds)
|
|
129
|
+
python -m adpentest --target 192.168.1.10 --mode active --scope-confirmed --dns-timeout 5.0
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
## DNS Configuration
|
|
133
|
+
|
|
134
|
+
The framework supports flexible DNS resolver configuration with automatic fallback:
|
|
135
|
+
|
|
136
|
+
### CLI Arguments
|
|
137
|
+
- `--dns-server <servers>` — Comma-separated list of custom DNS servers (e.g., `8.8.8.8,8.8.4.4`)
|
|
138
|
+
- `--dns-timeout <seconds>` — DNS query timeout in seconds (default: 3.0)
|
|
139
|
+
|
|
140
|
+
### Environment Variables
|
|
141
|
+
- `DNS_SERVERS` — Comma-separated DNS servers (e.g., `export DNS_SERVERS=8.8.8.8,8.8.4.4`)
|
|
142
|
+
- `DNS_TIMEOUT` — DNS query timeout in seconds (e.g., `export DNS_TIMEOUT=5.0`)
|
|
143
|
+
|
|
144
|
+
### Priority Order
|
|
145
|
+
1. **CLI Arguments** (`--dns-server`, `--dns-timeout`) — Highest priority
|
|
146
|
+
2. **Environment Variables** (`DNS_SERVERS`, `DNS_TIMEOUT`)
|
|
147
|
+
3. **System Default DNS** — Automatically detected from system configuration
|
|
148
|
+
4. **Public DNS Fallback** — Automatically uses `8.8.8.8`, `8.8.4.4`, `1.1.1.1`, `1.0.0.1` if others fail
|
|
149
|
+
|
|
150
|
+
### Examples
|
|
151
|
+
|
|
152
|
+
```bash
|
|
153
|
+
# Use custom DNS servers from CLI
|
|
154
|
+
python -m adpentest --target corp.local --mode active --scope-confirmed --dns-server 192.168.1.1,8.8.8.8
|
|
155
|
+
|
|
156
|
+
# Use environment variables for DNS
|
|
157
|
+
export DNS_SERVERS=192.168.1.1,1.1.1.1
|
|
158
|
+
export DNS_TIMEOUT=5.0
|
|
159
|
+
python -m adpentest --target corp.local --mode active --scope-confirmed
|
|
160
|
+
|
|
161
|
+
# Combine CLI with custom timeout
|
|
162
|
+
python -m adpentest --target corp.local --mode active --scope-confirmed --dns-server 8.8.8.8 --dns-timeout 10.0
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
## Resolver Behavior
|
|
166
|
+
|
|
167
|
+
- **System DNS** is queried first by default
|
|
168
|
+
- **Automatic fallback** to public DNS (Cloudflare, Google) on timeout or resolution failure
|
|
169
|
+
- **Detailed logging** shows which resolver is used and why (system, environment, CLI, or fallback)
|
|
170
|
+
- **All DNS functions** (SRV records, PTR lookups, forward resolution) use centralized configuration
|
|
171
|
+
|
|
172
|
+
## Requirements
|
|
173
|
+
|
|
174
|
+
- Python 3.10+
|
|
175
|
+
- `dnspython`, `ldap3`, `httpx`
|
|
176
|
+
|
|
177
|
+
This project does not authorize testing by itself. Operators must supply an explicitly authorized scope.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "0.1.0"
|