Skip to content

Commit 493296b

Browse files
committed
Issue #8
1 parent 99a5d32 commit 493296b

File tree

7 files changed

+121
-114
lines changed

7 files changed

+121
-114
lines changed

.gitignore

+30-2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,30 @@
1-
*.pyc
2-
*.DS_Store
1+
impacket/*
2+
develop-eggs/
3+
.Python
4+
env/
5+
build/
6+
develop-eggs/
7+
dist/
8+
downloads/
9+
eggs/
10+
.eggs/
11+
lib/
12+
lib64/
13+
parts/
14+
sdist/
15+
var/
16+
*.egg-info/
17+
.installed.cfg
18+
*.egg
19+
test.py
20+
21+
# Byte-compiled
22+
__pycache__/
23+
*.py[cod]
24+
25+
# macOS
26+
.DS_Store
27+
28+
# PyCharm
29+
.idea
30+
venv/

README.md

+36-24
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,62 @@
11
# enumdb
22
Enumdb is a brute force and post exploitation tool for MySQL and MSSQL databases. When provided a list of usernames and/or passwords, it will cycle through each targeted host looking for valid credentials. By default, enumdb will use newly discovered credentials to search for sensitive information in the host's databases via keyword searches on the table or column names. This information can then be extracted and reported to a .csv or .xlsx output file. See the Usage and All Options sections for more detailed usage and examples.
33

4-
To make the tool more adaptable on larger environments, Threading has been added to expedite brute forcing and enumeration when targeting multiple servers. Additionally, enumdb will not generate a report by default allowing users to get a quick preview of the target database. To extract data, specify a report type in the command line arguments, with either: ```-r csv``` or ```-r xlsx```. The first 100 rows of each identified table or column will be selected in the output report.
4+
To make the tool more adaptable on larger environments, Threading has been added to expedite brute forcing and enumeration when targeting multiple servers. Additionally, enumdb will *not* generate reports by default, allowing users to get a quick preview of the target database. To extract data, specify a report type in the command line arguments, with either: ```-r csv``` or ```-r xlsx```. The first 100 rows of each identified table or column will be extracted in the output report.
55

6-
The number of rows captured in reports, blacklisted databases & tables, and keywords for table & column searches can be modified at: ```enumdb/config.py```.
6+
Rows captured, blacklisted databases & tables, and keywords searches can all be modified at: ```enumdb/config.py```.
77

88
## Installation
9-
Enumdb was designed and testing using Python3 on the Kali Linux operating system. However, backwards compatibility has recently been added for Python2.7.
9+
Enumdb was designed and tested using Python3 for Debian based Linux systems. However, the tool is also compatible with Python2.7, and on other Linux distributions.
1010

11-
*Use the requirements file to install the necessary Python packages. If you still experience import issues, try the setup.sh file*
1211
```bash
1312
git clone https://github.com/m8r0wn/enumdb
1413
cd enumdb
15-
pip3 install -r requirements.txt
14+
python3 setup.py install
1615
``````
1716

17+
If experiencing issues with the [MySQLdb](https://github.com/PyMySQL/mysqlclient-python), additional MySQL development resources may
18+
need to be installed:
19+
20+
* Debian / Ubuntu:
21+
```
22+
sudo apt-get install python3-dev default-libmysqlclient-dev build-essential
23+
```
24+
25+
* Red Hat / CentOS:
26+
```
27+
sudo yum install python3-devel mysql-devel
28+
```
29+
1830
## Usage
1931
* Connect to a MySQL database and search for data via key word in table name (no report)<br>
20-
`python3 enumdb.py -u root -p '' -t mysql 10.11.1.30`
32+
```enumdb -u root -p '' -t mysql 10.11.1.30```
2133
2234
* Connect to a MSSQL database using a domain username and search for data via keyword in column name writing output to csv file:<br>
23-
`python3 enumdb.py -u 'domain\\user' -p Winter2018! -t mssql -columns -report csv 10.11.1.30`
35+
```enumdb -u 'domain\\user' -p Winter2018! -t mssql -columns -report csv 10.11.1.30```
2436
2537
* Brute force multiple MySQL servers looking for default credentials, no data enumeration:<br>
26-
`python3 enumdb.py -u root -p '' -t mysql -brute 10.11.1.0-30`
38+
```enumdb -u root -p '' -t mysql -brute 10.11.1.0-30```
2739
2840
* Brute force MSSQL sa account login. Once valid credentials are found, enumerate data by column name writing output to xlsx:<br>
29-
`python3 enumdb.py -u sa -P passwords.txt -t mssql -columns -report xlsx 192.168.10.10`
41+
```enumdb -u sa -P passwords.txt -t mssql -columns -report xlsx 192.168.10.10```
3042
3143
* Brute force MSSQL sa account on a single server, no data enumeration:<br>
32-
`python3 enumdb.py -u sa -P passwords.txt -t mssql -brute 192.168.10.10`
44+
```enumdb -u sa -P passwords.txt -t mssql -brute 192.168.10.10```
3345
3446
![enumdb](https://user-images.githubusercontent.com/13889819/54823551-9ae80d00-4c7e-11e9-89e5-3140b793b6d7.gif)
3547
3648
## All Options
37-
-h, --help show help message and exit
38-
-u USERS Single username
39-
-U USERS Users.txt file
40-
-p PASSWORDS Single password
41-
-P PASSWORDS Password.txt file
42-
-threads MAX_THREADS Max threads (Default: 3)
43-
-port PORT Specify non-standard port
44-
-r REPORT, -report REPORT Output Report: csv, xlsx (Default: None)
45-
-t DBTYPE Database types currently supported: mssql, mysql
46-
-c, -columns Search for key words in column names (Default: table names)
47-
-v Show failed login notices & keyword matches with Empty data sets
48-
-brute Brute force only, do not enumerate
49-
50-
49+
```html
50+
-u USERS Single username
51+
-U USERS Users.txt file
52+
-p PASSWORDS Single password
53+
-P PASSWORDS Password.txt file
54+
-threads MAX_THREADS Max threads (Default: 3)
55+
-port PORT Specify non-standard port
56+
-r REPORT, -report REPORT Output Report: csv, xlsx (Default: None)
57+
-t {mysql,mssql} Database type
58+
-c, -columns Search for key words in column names (Default: table names)
59+
-v Show failed login notices & keyword matches with Empty data sets
60+
-brute Brute force only, do not enumerate
61+
62+
```

change_log.md

-19
This file was deleted.

enumdb/__init__.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -181,18 +181,18 @@ def main():
181181
version = '2.1.0'
182182
try:
183183
args = argparse.ArgumentParser(description=("""
184-
{0} (v{1})
184+
enumdb (v{0})
185185
--------------------------------------------------
186186
Brute force MySQL or MSSQL database logins. Once provided with valid
187187
credentials, enumdb will attempt to enumerate tables containing
188188
sensitive information such as: users, passwords, ssn, etc.
189189
190190
Usage:
191-
python3 {0} -u root -p Password1 -t mysql 10.11.1.30
192-
python3 {0} -u root -p '' -t mysql -brute 10.0.0.0-50
193-
python3 {0} -u 'domain\\user1' -P pass.txt -t mssql 192.168.1.7
191+
enumdb -u root -p Password1 -t mysql 10.11.1.30
192+
enumdb -u root -p '' -t mysql -brute 10.0.0.0-50
193+
enumdb -u 'domain\\user1' -P pass.txt -t mssql 192.168.1.7
194194
195-
** Having trouble with inputs? Use \'\' around username & password **""").format(argv[0], version), formatter_class=argparse.RawTextHelpFormatter, usage=argparse.SUPPRESS)
195+
** Having trouble with inputs? Use \'\' around username & password **""").format(version), formatter_class=argparse.RawTextHelpFormatter, usage=argparse.SUPPRESS)
196196

197197
user = args.add_mutually_exclusive_group(required=True)
198198
user.add_argument('-u', dest='users', type=str, action='append', help='Single username')

requirements.txt

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
openpyxl
22
pymssql
3-
mysqlclient
43
ipparser
5-
psycopg2
4+
mysqlclient

setup.py

+49
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
'''
2+
Some users have experienced issues with the MySQLdb package. As per
3+
the authors instructions, the MySQL development libraries may
4+
need to be installed manually:
5+
6+
- Debian / Ubuntu : sudo apt-get install python3-dev default-libmysqlclient-dev build-essential
7+
- Red Hat / CentOS: sudo yum install python3-devel mysql-devel
8+
9+
*** From my understanding, it is also because of this that enumdb ***
10+
*** does not run well in virtual environments such as pipenv ***
11+
12+
Resources:
13+
https://github.com/PyMySQL/mysqlclient-python
14+
https://stackoverflow.com/questions/7475223/mysql-config-not-found-when-installing-mysqldb-python-interface
15+
'''
16+
from setuptools import setup, find_packages
17+
18+
with open("README.md", "r") as fh:
19+
long_description = fh.read()
20+
21+
setup(
22+
name='enumdb',
23+
version='2.1.0',
24+
author = 'm8r0wn',
25+
author_email = '[email protected]',
26+
description = 'Database brute force and post exploitation tool to extract sensitive data',
27+
long_description=long_description,
28+
long_description_content_type="text/markdown",
29+
url='https://github.com/m8r0wn/enumdb',
30+
license='GPLv3',
31+
platforms = ["Unix"],
32+
packages=find_packages(include=["enumdb", "enumdb.*"]),
33+
install_requires=[
34+
'openpyxl',
35+
'pymssql',
36+
'mysqlclient',
37+
'ipparser>=0.3.5',
38+
],
39+
classifiers = [
40+
"Environment :: Console",
41+
"Programming Language :: Python :: 3",
42+
"License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)",
43+
"Operating System :: Unix",
44+
"Topic :: Security"
45+
],
46+
entry_points= {
47+
'console_scripts': ['enumdb=enumdb:main']
48+
}
49+
)

setup.sh

-62
This file was deleted.

0 commit comments

Comments
 (0)