PyADRecon 0.11.1__py3-none-any.whl
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.
|
@@ -0,0 +1,231 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: PyADRecon
|
|
3
|
+
Version: 0.11.1
|
|
4
|
+
Summary: Python Active Directory Reconnaissance Tool (ADRecon port) with NTLM and Kerberos support.
|
|
5
|
+
Author: LRVT
|
|
6
|
+
License-Expression: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/l4rm4nd/PyADRecon
|
|
8
|
+
Project-URL: Repository, https://github.com/l4rm4nd/PyADRecon
|
|
9
|
+
Project-URL: Issues, https://github.com/l4rm4nd/PyADRecon/issues
|
|
10
|
+
Keywords: active-directory,active directory,ad,recon,reconnaissance,enum,enumeration,adrecon,pyadrecon,security,audit,pentest,ldap,kerberos,adcs,kerberoast
|
|
11
|
+
Requires-Python: >=3.9
|
|
12
|
+
Description-Content-Type: text/markdown
|
|
13
|
+
License-File: LICENSE
|
|
14
|
+
Requires-Dist: ldap3<3,>=2.9.1
|
|
15
|
+
Requires-Dist: openpyxl<4,>=3.1.5
|
|
16
|
+
Requires-Dist: impacket<1,>=0.13.0
|
|
17
|
+
Requires-Dist: gssapi<2,>=1.11.1; sys_platform != "win32"
|
|
18
|
+
Requires-Dist: winkerberos<1,>=0.13.0; sys_platform == "win32"
|
|
19
|
+
Dynamic: license-file
|
|
20
|
+
|
|
21
|
+
<img src=".github/pyadrecon.png" alt="pyadrecon" width="300"/>
|
|
22
|
+
|
|
23
|
+
Python3 implementation of an improved [ADRecon](https://github.com/sense-of-security/ADRecon) for Pentesters, Red and Blue Teams
|
|
24
|
+
|
|
25
|
+
> ADRecon is a tool which gathers information about MS Active Directory and generates an XSLX report to provide a holistic picture of the current state of the target AD environment.
|
|
26
|
+
|
|
27
|
+
## Table of Contents
|
|
28
|
+
|
|
29
|
+
- [Installation](#installation)
|
|
30
|
+
- [Usage](#usage)
|
|
31
|
+
- [Docker](#docker)
|
|
32
|
+
- [Collection Modules](#collection-modules)
|
|
33
|
+
- [Acknowledgements](#acknowledgements)
|
|
34
|
+
- [License](#license)
|
|
35
|
+
|
|
36
|
+
## Installation
|
|
37
|
+
|
|
38
|
+
Generic:
|
|
39
|
+
|
|
40
|
+
````bash
|
|
41
|
+
# clone the repo
|
|
42
|
+
git clone https://github.com/l4rm4nd/PyADRecon && cd PyADRecon
|
|
43
|
+
|
|
44
|
+
# create virtual environment
|
|
45
|
+
virtualenv venv && source venv/bin/activate
|
|
46
|
+
|
|
47
|
+
# install dependencies
|
|
48
|
+
pip install -r requirements.txt
|
|
49
|
+
````
|
|
50
|
+
|
|
51
|
+
[BlackArch Linux](https://blackarch.org/):
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
pacman -Syu pyadrecon
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
## Usage
|
|
58
|
+
|
|
59
|
+
````py
|
|
60
|
+
usage: pyadrecon.py [-h] [--generate-excel-from CSV_DIR] [-dc DOMAIN_CONTROLLER] [-u USERNAME] [-p [PASSWORD]] [-d DOMAIN] [--auth {ntlm,kerberos}] [--tgt-file TGT_FILE] [--tgt-base64 TGT_BASE64]
|
|
61
|
+
[--ssl] [--port PORT] [-o OUTPUT] [--page-size PAGE_SIZE] [--threads THREADS] [--dormant-days DORMANT_DAYS] [--password-age PASSWORD_AGE] [--only-enabled] [--collect COLLECT]
|
|
62
|
+
[--no-excel] [-v]
|
|
63
|
+
|
|
64
|
+
PyADRecon - Python Active Directory Reconnaissance Tool
|
|
65
|
+
|
|
66
|
+
options:
|
|
67
|
+
-h, --help show this help message and exit
|
|
68
|
+
--generate-excel-from CSV_DIR
|
|
69
|
+
Generate Excel report from CSV directory (standalone mode, no AD connection needed)
|
|
70
|
+
-dc, --domain-controller DOMAIN_CONTROLLER
|
|
71
|
+
Domain Controller IP or hostname
|
|
72
|
+
-u, --username USERNAME
|
|
73
|
+
Username for authentication
|
|
74
|
+
-p, --password [PASSWORD]
|
|
75
|
+
Password for authentication (optional if using TGT)
|
|
76
|
+
-d, --domain DOMAIN Domain name (e.g., DOMAIN.LOCAL) - Required for Kerberos auth
|
|
77
|
+
--auth {ntlm,kerberos}
|
|
78
|
+
Authentication method (default: ntlm)
|
|
79
|
+
--tgt-file TGT_FILE Path to Kerberos TGT ccache file (for Kerberos auth)
|
|
80
|
+
--tgt-base64 TGT_BASE64
|
|
81
|
+
Base64-encoded Kerberos TGT ccache (for Kerberos auth)
|
|
82
|
+
--ssl Force SSL/TLS (LDAPS). No LDAP fallback allowed.
|
|
83
|
+
--port PORT LDAP port (default: 389, use 636 for LDAPS)
|
|
84
|
+
-o, --output OUTPUT Output directory (default: PyADRecon-Report-<timestamp>)
|
|
85
|
+
--page-size PAGE_SIZE
|
|
86
|
+
LDAP page size (default: 500)
|
|
87
|
+
--dormant-days DORMANT_DAYS
|
|
88
|
+
Days for dormant account threshold (default: 90)
|
|
89
|
+
--password-age PASSWORD_AGE
|
|
90
|
+
Days for password age threshold (default: 180)
|
|
91
|
+
--only-enabled Only collect enabled objects
|
|
92
|
+
--collect COLLECT Comma-separated modules to collect (default: all)
|
|
93
|
+
--workstation WORKSTATION
|
|
94
|
+
Explicitly spoof workstation name for NTLM authentication (default: empty string, bypasses userWorkstations restrictions)
|
|
95
|
+
--no-excel Skip Excel report generation
|
|
96
|
+
-v, --verbose Verbose output
|
|
97
|
+
|
|
98
|
+
Examples:
|
|
99
|
+
# Basic usage with NTLM authentication
|
|
100
|
+
pyadrecon.py -dc 192.168.1.1 -u admin -p password123 -d DOMAIN.LOCAL
|
|
101
|
+
|
|
102
|
+
# With Kerberos authentication (bypasses channel binding)
|
|
103
|
+
pyadrecon.py -dc dc01.domain.local -u admin -p password123 -d DOMAIN.LOCAL --auth kerberos
|
|
104
|
+
|
|
105
|
+
# With Kerberos using TGT from file (bypasses channel binding)
|
|
106
|
+
pyadrecon.py -dc dc01.domain.local -u admin -d DOMAIN.LOCAL --auth kerberos --tgt-file /tmp/admin.ccache
|
|
107
|
+
|
|
108
|
+
# With Kerberos using TGT from base64 string (bypasses channel binding)
|
|
109
|
+
pyadrecon.py -dc dc01.domain.local -u admin -d DOMAIN.LOCAL --auth kerberos --tgt-base64 BQQAAAw...
|
|
110
|
+
|
|
111
|
+
# Only collect specific modules
|
|
112
|
+
pyadrecon.py -dc 192.168.1.1 -u admin -p pass -d DOMAIN.LOCAL --collect users,groups,computers
|
|
113
|
+
|
|
114
|
+
# Output to specific directory
|
|
115
|
+
pyadrecon.py -dc 192.168.1.1 -u admin -p pass -d DOMAIN.LOCAL -o /tmp/adrecon_output
|
|
116
|
+
|
|
117
|
+
# Generate Excel report from existing CSV files (standalone mode)
|
|
118
|
+
pyadrecon.py --generate-excel-from /path/to/CSV-Files -o report.xlsx
|
|
119
|
+
````
|
|
120
|
+
|
|
121
|
+
>[!TIP]
|
|
122
|
+
>PyADRecon always tries LDAPS on TCP/636 first.
|
|
123
|
+
>
|
|
124
|
+
>If flag `--ssl` is not used, LDAP on TCP/389 may be tried as fallback.
|
|
125
|
+
|
|
126
|
+
>[!WARNING]
|
|
127
|
+
>If LDAP channel binding is enabled, this script will fail with `automatic bind not successful - strongerAuthRequired`, as ldap3 does not support it (see [here](https://github.com/cannatag/ldap3/issues/1049#issuecomment-1222826803)). You must use Kerberos authentication instead.
|
|
128
|
+
>
|
|
129
|
+
>If you use Kerberos auth, please create a valid `/etc/krb5.conf` and DC hostname entry in `/etc/hosts`. May read [this](https://cwiki.apache.org/confluence/pages/viewpage.action?pageId=32628#KerberosClientConfiguration-*NIX/etc/krb5.confConfiguration).
|
|
130
|
+
>
|
|
131
|
+
>Note that you can provide an already existing TGT ticket to the script via `--tgt-file` or `--tgt-base64`. For example, obtained by Netexec via `netexec smb <TARGET> <ARGS> --generate-tgt <FILEMAME>`.
|
|
132
|
+
|
|
133
|
+
>[!NOTE]
|
|
134
|
+
>PyADRecon uses an **empty workstation name by default** (like Impacket/NetExec), which bypasses `userWorkstations` restrictions automatically. This means accounts restricted to specific computers will work without any special flags!
|
|
135
|
+
>
|
|
136
|
+
>If needed, you can explicitly spoof a workstation name using `--workstation <name>` flag during NTLM authentication.
|
|
137
|
+
|
|
138
|
+
## Docker
|
|
139
|
+
|
|
140
|
+
There is also a Docker image available on GHCR.IO.
|
|
141
|
+
|
|
142
|
+
````
|
|
143
|
+
docker run --rm -v /etc/krb5.conf:/etc/krb5.conf:ro -v /etc/hosts:/etc/hosts:ro -v ./:/tmp/pyadrecon_output ghcr.io/l4rm4nd/pyadrecon:latest -dc dc01.domain.local -u admin -p password123 -d DOMAIN.LOCAL -o /tmp/pyadrecon_output
|
|
144
|
+
````
|
|
145
|
+
|
|
146
|
+
## Collection Modules
|
|
147
|
+
|
|
148
|
+
As default, PyADRecon runs all collection modules. They are referenced to as `default` or `all`.
|
|
149
|
+
|
|
150
|
+
Though, you can freely select your own collection of modules to run:
|
|
151
|
+
|
|
152
|
+
| Icon | Meaning |
|
|
153
|
+
|------|---------|
|
|
154
|
+
| 🛑 | Requires administrative domain privileges (e.g. Domain Admins) |
|
|
155
|
+
| ✅ | Requires regular domain privileges (e.g. Authenticated Users) |
|
|
156
|
+
| 💥 | New collection modul in beta state. Results may be incorrect. |
|
|
157
|
+
|
|
158
|
+
**Forest & Domain**
|
|
159
|
+
- `forest` ✅
|
|
160
|
+
- `domain` ✅
|
|
161
|
+
- `trusts` ✅
|
|
162
|
+
- `sites` ✅
|
|
163
|
+
- `subnets` ✅
|
|
164
|
+
- `schema` or `schemahistory` ✅
|
|
165
|
+
|
|
166
|
+
**Domain Controllers**
|
|
167
|
+
- `dcs` or `domaincontrollers` ✅
|
|
168
|
+
|
|
169
|
+
**Users & Groups**
|
|
170
|
+
- `users` ✅
|
|
171
|
+
- `userspns` ✅
|
|
172
|
+
- `groups` ✅
|
|
173
|
+
- `groupmembers` ✅
|
|
174
|
+
- `protectedgroups` ✅💥
|
|
175
|
+
- `krbtgt` ✅
|
|
176
|
+
- `asreproastable` ✅
|
|
177
|
+
- `kerberoastable` ✅
|
|
178
|
+
|
|
179
|
+
**Computers & Printers**
|
|
180
|
+
- `computers` ✅
|
|
181
|
+
- `computerspns` ✅
|
|
182
|
+
- `printers` ✅
|
|
183
|
+
|
|
184
|
+
**OUs & Group Policy**
|
|
185
|
+
- `ous` ✅
|
|
186
|
+
- `gpos` ✅
|
|
187
|
+
- `gplinks` ✅
|
|
188
|
+
|
|
189
|
+
**Passwords & Credentials**
|
|
190
|
+
- `passwordpolicy` ✅
|
|
191
|
+
- `fgpp` or `finegrainedpasswordpolicy` 🛑
|
|
192
|
+
- `laps` 🛑
|
|
193
|
+
- `bitlocker` 🛑
|
|
194
|
+
|
|
195
|
+
**Managed Service Accounts**
|
|
196
|
+
- `gmsa` or `groupmanagedserviceaccounts` ✅💥
|
|
197
|
+
- `dmsa` or `delegatedmanagedserviceaccounts` ✅💥
|
|
198
|
+
- Only works for Windows Server 2025+ AD schema
|
|
199
|
+
|
|
200
|
+
**Certificates**
|
|
201
|
+
- `adcs` or `certificates` ✅💥
|
|
202
|
+
- Detects ESC1, ESC2, ESC3, ESC4 and ESC9
|
|
203
|
+
|
|
204
|
+
**DNS**
|
|
205
|
+
- `dnszones` ✅
|
|
206
|
+
- `dnsrecords` ✅
|
|
207
|
+
|
|
208
|
+
## Acknowledgements
|
|
209
|
+
|
|
210
|
+
Many thanks to the following folks:
|
|
211
|
+
- [S3cur3Th1sSh1t](https://github.com/S3cur3Th1sSh1t) for a first Claude draft of this Python3 port
|
|
212
|
+
- [Sense-of-Security](https://github.com/sense-of-security) for the original ADRecon script in PowerShell
|
|
213
|
+
- [cannatag](https://github.com/cannatag) for the awesome ldap3 Python client
|
|
214
|
+
- [Forta](https://github.com/fortra) for the awesome impacket suite
|
|
215
|
+
- [Anthropic](https://github.com/anthropics) for Claude LLMs
|
|
216
|
+
|
|
217
|
+
## License
|
|
218
|
+
|
|
219
|
+
**PyADRecon** is released under the **MIT License**.
|
|
220
|
+
|
|
221
|
+
The following third-party libraries are used:
|
|
222
|
+
|
|
223
|
+
| Library | License |
|
|
224
|
+
|-------------|----------------|
|
|
225
|
+
| ldap3 | LGPL v3 |
|
|
226
|
+
| openpyxl | MIT |
|
|
227
|
+
| gssapi | MIT |
|
|
228
|
+
| impacket | Apache 2.0 |
|
|
229
|
+
| winkerberos | Apache 2.0 |
|
|
230
|
+
|
|
231
|
+
Please refer to the respective licenses of these libraries when using or redistributing this software.
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
pyadrecon.py,sha256=iafBStHbtTgq_3ZNEC2Y3LInkxPYTDmGQf8Sb6scpFM,333989
|
|
2
|
+
pyadrecon-0.11.1.dist-info/licenses/LICENSE,sha256=Mgf27ek4uZjNVQUhdw-6HegELqahDCpCBTSszEzhdGg,1061
|
|
3
|
+
pyadrecon-0.11.1.dist-info/METADATA,sha256=kJUyscQkKtLUtUZVnCdJlketPzWHdeZYVPRf4pMnfPM,8931
|
|
4
|
+
pyadrecon-0.11.1.dist-info/WHEEL,sha256=YCfwYGOYMi5Jhw2fU4yNgwErybb2IX5PEwBKV4ZbdBo,91
|
|
5
|
+
pyadrecon-0.11.1.dist-info/entry_points.txt,sha256=7Bi7HgLhgw2w4HvKwodDjyFZiUd8IgqSkIIAtzrrl6g,45
|
|
6
|
+
pyadrecon-0.11.1.dist-info/top_level.txt,sha256=j2M42aOi89VtnapaB2cz4iH9e_Qcjtq6fQL_ja86kfY,10
|
|
7
|
+
pyadrecon-0.11.1.dist-info/RECORD,,
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 LRVT
|
|
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.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
pyadrecon
|