Skip to content

Commit a22aa9b

Browse files
committed
v0.9.3 for pypi
1 parent c427509 commit a22aa9b

File tree

3 files changed

+123
-123
lines changed

3 files changed

+123
-123
lines changed

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
The MIT License (MIT)
22

3-
Copyright (c) 2016 Dirk-jan
3+
Copyright (c) 2020 Dirk-jan Mollema
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

Readme.md

Lines changed: 109 additions & 109 deletions
Original file line numberDiff line numberDiff line change
@@ -1,109 +1,109 @@
1-
# LDAPDomainDump
2-
Active Directory information dumper via LDAP
3-
4-
## Introduction
5-
In an Active Directory domain, a lot of interesting information can be retrieved via LDAP by any authenticated user (or machine).
6-
This makes LDAP an interesting protocol for gathering information in the recon phase of a pentest of an internal network.
7-
A problem is that data from LDAP often is not available in an easy to read format.
8-
9-
ldapdomaindump is a tool which aims to solve this problem, by collecting and parsing information available via LDAP and outputting it in a human readable HTML format, as well as machine readable json and csv/tsv/greppable files.
10-
11-
The tool was designed with the following goals in mind:
12-
- Easy overview of all users/groups/computers/policies in the domain
13-
- Authentication both via username and password, as with NTLM hashes (requires ldap3 >=1.3.1)
14-
- Possibility to run the tool with an existing authenticated connection to an LDAP service, allowing for integration with relaying tools such as impackets ntlmrelayx
15-
16-
The tool outputs several files containing an overview of objects in the domain:
17-
- *domain_groups*: List of groups in the domain
18-
- *domain_users*: List of users in the domain
19-
- *domain_computers*: List of computer accounts in the domain
20-
- *domain_policy*: Domain policy such as password requirements and lockout policy
21-
- *domain_trusts*: Incoming and outgoing domain trusts, and their properties
22-
23-
As well as two grouped files:
24-
- *domain_users_by_group*: Domain users per group they are member of
25-
- *domain_computers_by_os*: Domain computers sorted by Operating System
26-
27-
## Dependencies and installation
28-
Requires [ldap3](https://github.com/cannatag/ldap3) > 2.0 and [dnspython](https://github.com/rthalley/dnspython)
29-
30-
Both can be installed with `pip install ldap3 dnspython`
31-
32-
The ldapdomaindump package can be installed with `python setup.py install` from the git source, or for the latest release with `pip install ldapdomaindump`.
33-
34-
## Usage
35-
There are 3 ways to use the tool:
36-
- With just the source, run `python ldapdomaindump.py`
37-
- After installing, by running `python -m ldapdomaindump`
38-
- After installing, by running `ldapdomaindump`
39-
40-
Help can be obtained with the -h switch:
41-
```
42-
usage: ldapdomaindump.py [-h] [-u USERNAME] [-p PASSWORD] [-at {NTLM,SIMPLE}]
43-
[-o DIRECTORY] [--no-html] [--no-json] [--no-grep]
44-
[--grouped-json] [-d DELIMITER] [-r] [-n DNS_SERVER]
45-
[-m]
46-
HOSTNAME
47-
48-
Domain information dumper via LDAP. Dumps users/computers/groups and
49-
OS/membership information to HTML/JSON/greppable output.
50-
51-
Required options:
52-
HOSTNAME Hostname/ip or ldap://host:port connection string to
53-
connect to (use ldaps:// to use SSL)
54-
55-
Main options:
56-
-h, --help show this help message and exit
57-
-u USERNAME, --user USERNAME
58-
DOMAIN\username for authentication, leave empty for
59-
anonymous authentication
60-
-p PASSWORD, --password PASSWORD
61-
Password or LM:NTLM hash, will prompt if not specified
62-
-at {NTLM,SIMPLE}, --authtype {NTLM,SIMPLE}
63-
Authentication type (NTLM or SIMPLE, default: NTLM)
64-
65-
Output options:
66-
-o DIRECTORY, --outdir DIRECTORY
67-
Directory in which the dump will be saved (default:
68-
current)
69-
--no-html Disable HTML output
70-
--no-json Disable JSON output
71-
--no-grep Disable Greppable output
72-
--grouped-json Also write json files for grouped files (default:
73-
disabled)
74-
-d DELIMITER, --delimiter DELIMITER
75-
Field delimiter for greppable output (default: tab)
76-
77-
Misc options:
78-
-r, --resolve Resolve computer hostnames (might take a while and
79-
cause high traffic on large networks)
80-
-n DNS_SERVER, --dns-server DNS_SERVER
81-
Use custom DNS resolver instead of system DNS (try a
82-
domain controller IP)
83-
-m, --minimal Only query minimal set of attributes to limit memmory
84-
usage
85-
```
86-
87-
## Options
88-
### Authentication
89-
Most AD servers support NTLM authentication. In the rare case that it does not, use --authtype SIMPLE.
90-
91-
### Output formats
92-
By default the tool outputs all files in HTML, JSON and tab delimited output (greppable). There are also two grouped files (users_by_group and computers_by_os) for convenience. These do not have a greppable output. JSON output for grouped files is disabled by default since it creates very large files without any data that isn't present in the other files already.
93-
94-
### DNS resolving
95-
An important option is the *-r* option, which decides if a computers DNSHostName attribute should be resolved to an IPv4 address.
96-
While this can be very useful, the DNSHostName attribute is not automatically updated. When the AD Domain uses subdomains for computer hostnames, the DNSHostName will often be incorrect and will not resolve. Also keep in mind that resolving every hostname in the domain might cause a high load on the domain controller.
97-
98-
### Minimizing network and memory usage
99-
By default ldapdomaindump will try to dump every single attribute it can read to disk in the .json files. In large networks, this uses a lot of memory (since group relationships are currently calculated in memory before being written to disk). To dump only the minimal required attributes (the ones shown by default in the .html and .grep files), use the `--minimal` switch.
100-
101-
## Visualizing groups with BloodHound
102-
LDAPDomainDump includes a utility that can be used to convert ldapdomaindumps `.json` files to CSV files suitable for BloodHound. The utility is called `ldd2bloodhound` and is added to your path upon installation. Alternatively you can run it with `python -m ldapdomaindump.convert` or with `python ldapdomaindump/convert.py` if you are running it from the source.
103-
The conversion tool will take the users/groups/computers/trusts `.json` file and convert those to `group_membership.csv` and `trust.csv` which you can add to BloodHound.
104-
105-
## Visualizing dump with a pretty output like enum4linux
106-
LDAPDomainDump includes a utility that can be used to output ldapdomaindumps `.json` files to an enum4linux like output. The utility is called `ldd2pretty` and is added to your path upon installation. Alternatively you can run it with `python -m ldapdomaindump.pretty` or with `python ldapdomaindump/pretty.py` if you are running it from the source.
107-
108-
## License
109-
MIT
1+
# LDAPDomainDump
2+
Active Directory information dumper via LDAP
3+
4+
## Introduction
5+
In an Active Directory domain, a lot of interesting information can be retrieved via LDAP by any authenticated user (or machine).
6+
This makes LDAP an interesting protocol for gathering information in the recon phase of a pentest of an internal network.
7+
A problem is that data from LDAP often is not available in an easy to read format.
8+
9+
ldapdomaindump is a tool which aims to solve this problem, by collecting and parsing information available via LDAP and outputting it in a human readable HTML format, as well as machine readable json and csv/tsv/greppable files.
10+
11+
The tool was designed with the following goals in mind:
12+
- Easy overview of all users/groups/computers/policies in the domain
13+
- Authentication both via username and password, as with NTLM hashes (requires ldap3 >=1.3.1)
14+
- Possibility to run the tool with an existing authenticated connection to an LDAP service, allowing for integration with relaying tools such as impackets ntlmrelayx
15+
16+
The tool outputs several files containing an overview of objects in the domain:
17+
- *domain_groups*: List of groups in the domain
18+
- *domain_users*: List of users in the domain
19+
- *domain_computers*: List of computer accounts in the domain
20+
- *domain_policy*: Domain policy such as password requirements and lockout policy
21+
- *domain_trusts*: Incoming and outgoing domain trusts, and their properties
22+
23+
As well as two grouped files:
24+
- *domain_users_by_group*: Domain users per group they are member of
25+
- *domain_computers_by_os*: Domain computers sorted by Operating System
26+
27+
## Dependencies and installation
28+
Requires [ldap3](https://github.com/cannatag/ldap3) > 2.0 and [dnspython](https://github.com/rthalley/dnspython)
29+
30+
Both can be installed with `pip install ldap3 dnspython`
31+
32+
The ldapdomaindump package can be installed with `python setup.py install` from the git source, or for the latest release with `pip install ldapdomaindump`.
33+
34+
## Usage
35+
There are 3 ways to use the tool:
36+
- With just the source, run `python ldapdomaindump.py`
37+
- After installing, by running `python -m ldapdomaindump`
38+
- After installing, by running `ldapdomaindump`
39+
40+
Help can be obtained with the -h switch:
41+
```
42+
usage: ldapdomaindump.py [-h] [-u USERNAME] [-p PASSWORD] [-at {NTLM,SIMPLE}]
43+
[-o DIRECTORY] [--no-html] [--no-json] [--no-grep]
44+
[--grouped-json] [-d DELIMITER] [-r] [-n DNS_SERVER]
45+
[-m]
46+
HOSTNAME
47+
48+
Domain information dumper via LDAP. Dumps users/computers/groups and
49+
OS/membership information to HTML/JSON/greppable output.
50+
51+
Required options:
52+
HOSTNAME Hostname/ip or ldap://host:port connection string to
53+
connect to (use ldaps:// to use SSL)
54+
55+
Main options:
56+
-h, --help show this help message and exit
57+
-u USERNAME, --user USERNAME
58+
DOMAIN\username for authentication, leave empty for
59+
anonymous authentication
60+
-p PASSWORD, --password PASSWORD
61+
Password or LM:NTLM hash, will prompt if not specified
62+
-at {NTLM,SIMPLE}, --authtype {NTLM,SIMPLE}
63+
Authentication type (NTLM or SIMPLE, default: NTLM)
64+
65+
Output options:
66+
-o DIRECTORY, --outdir DIRECTORY
67+
Directory in which the dump will be saved (default:
68+
current)
69+
--no-html Disable HTML output
70+
--no-json Disable JSON output
71+
--no-grep Disable Greppable output
72+
--grouped-json Also write json files for grouped files (default:
73+
disabled)
74+
-d DELIMITER, --delimiter DELIMITER
75+
Field delimiter for greppable output (default: tab)
76+
77+
Misc options:
78+
-r, --resolve Resolve computer hostnames (might take a while and
79+
cause high traffic on large networks)
80+
-n DNS_SERVER, --dns-server DNS_SERVER
81+
Use custom DNS resolver instead of system DNS (try a
82+
domain controller IP)
83+
-m, --minimal Only query minimal set of attributes to limit memmory
84+
usage
85+
```
86+
87+
## Options
88+
### Authentication
89+
Most AD servers support NTLM authentication. In the rare case that it does not, use --authtype SIMPLE.
90+
91+
### Output formats
92+
By default the tool outputs all files in HTML, JSON and tab delimited output (greppable). There are also two grouped files (users_by_group and computers_by_os) for convenience. These do not have a greppable output. JSON output for grouped files is disabled by default since it creates very large files without any data that isn't present in the other files already.
93+
94+
### DNS resolving
95+
An important option is the *-r* option, which decides if a computers DNSHostName attribute should be resolved to an IPv4 address.
96+
While this can be very useful, the DNSHostName attribute is not automatically updated. When the AD Domain uses subdomains for computer hostnames, the DNSHostName will often be incorrect and will not resolve. Also keep in mind that resolving every hostname in the domain might cause a high load on the domain controller.
97+
98+
### Minimizing network and memory usage
99+
By default ldapdomaindump will try to dump every single attribute it can read to disk in the .json files. In large networks, this uses a lot of memory (since group relationships are currently calculated in memory before being written to disk). To dump only the minimal required attributes (the ones shown by default in the .html and .grep files), use the `--minimal` switch.
100+
101+
## Visualizing groups with BloodHound
102+
LDAPDomainDump includes a utility that can be used to convert ldapdomaindumps `.json` files to CSV files suitable for BloodHound. The utility is called `ldd2bloodhound` and is added to your path upon installation. Alternatively you can run it with `python -m ldapdomaindump.convert` or with `python ldapdomaindump/convert.py` if you are running it from the source.
103+
The conversion tool will take the users/groups/computers/trusts `.json` file and convert those to `group_membership.csv` and `trust.csv` which you can add to BloodHound. *Note that these files are only compatible with **BloodHound 1.x** which is quite old. There are no plans to support the latest version as the [BloodHound.py project](https://github.com/fox-it/BloodHound.py) was made for this. With the DCOnly collection method this tool will also only talk to LDAP and collect more information than ldapdomaindump would*.
104+
105+
## Visualizing dump with a pretty output like enum4linux
106+
LDAPDomainDump includes a utility that can be used to output ldapdomaindumps `.json` files to an enum4linux like output. The utility is called `ldd2pretty` and is added to your path upon installation. Alternatively you can run it with `python -m ldapdomaindump.pretty` or with `python ldapdomaindump/pretty.py` if you are running it from the source.
107+
108+
## License
109+
MIT

setup.py

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
from setuptools import setup
2-
setup(name='ldapdomaindump',
3-
version='0.9.2',
4-
description='Active Directory information dumper via LDAP',
5-
author='Dirk-jan Mollema',
6-
author_email='dirkjan@sanoweb.nl',
7-
url='https://github.com/dirkjanm/ldapdomaindump/',
8-
packages=['ldapdomaindump'],
9-
install_requires=['dnspython', 'ldap3>=2.5,!=2.5.2,!=2.5.0,!=2.6', 'future'],
10-
package_data={'ldapdomaindump': ['style.css']},
11-
include_package_data=True,
12-
scripts=['bin/ldapdomaindump', 'bin/ldd2bloodhound', 'bin/ldd2pretty']
13-
)
1+
from setuptools import setup
2+
setup(name='ldapdomaindump',
3+
version='0.9.3',
4+
description='Active Directory information dumper via LDAP',
5+
author='Dirk-jan Mollema',
6+
author_email='dirkjan@sanoweb.nl',
7+
url='https://github.com/dirkjanm/ldapdomaindump/',
8+
packages=['ldapdomaindump'],
9+
install_requires=['dnspython', 'ldap3>=2.5,!=2.5.2,!=2.5.0,!=2.6', 'future'],
10+
package_data={'ldapdomaindump': ['style.css']},
11+
include_package_data=True,
12+
scripts=['bin/ldapdomaindump', 'bin/ldd2bloodhound', 'bin/ldd2pretty']
13+
)

0 commit comments

Comments
 (0)