Skip to content

Commit 2e131e6

Browse files
Update README.md
Added some syntax highlighting to the codebase commands.
1 parent b79ead5 commit 2e131e6

File tree

1 file changed

+52
-43
lines changed

1 file changed

+52
-43
lines changed

README.md

Lines changed: 52 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,11 @@
33
<strong>A next generation version of enum4linux</strong>
44
</p>
55
<p align="center">
6-
<img src="https://img.shields.io/badge/python-%3E=_3.6-blue"/>
6+
<img src="https://img.shields.io/badge/python-3.6-blue.svg"/>
7+
<img src="https://img.shields.io/badge/python-3.7-blue.svg"/>
8+
<img src="https://img.shields.io/badge/python-3.8-blue.svg"/>
9+
<img src="https://img.shields.io/badge/python-3.9-blue.svg"/>
10+
<img src="https://img.shields.io/badge/python-3.10-blue.svg"/>
711
<img src="https://img.shields.io/badge/License-GPLv3-green.svg"/>
812
</p>
913

@@ -44,13 +48,17 @@ If you use the tool: Don't use it for illegal purposes.
4448

4549
## Run
4650
An example run could look like that:
47-
```$ enum4linux-ng.py -As <target> -oY out```
51+
```console
52+
enum4linux-ng.py -As <target> -oY out
53+
```
4854

4955
### Demo
5056
#### Windows Server 2012 R2
5157
This demonstrates a run against Windows Server 2012 R2 standard installation. The following command is being used:
5258

53-
```enum4linux-ng.py 192.168.125.131 -u Tester -p 'Start123!' -oY out```
59+
```console
60+
enum4linux-ng.py 192.168.125.131 -u Tester -p 'Start123!' -oY out
61+
```
5462

5563
A user 'Tester' with password 'Start123!' was created. Firewall access was allowed. Once the enumeration is finished, I scroll up so that the results become more clear. Since no other enumeration option is specified, the tool will assume ```-A``` which behaves similar to enum4linux ```-a``` option. User and password are passed in. The ```-oY``` option will export all enumerated data as YAML file for further processing in ```out.yaml```. The tool automatically detects at the beginning that LDAP is not running on the remote host. It will therefore skip any further LDAP checks which would normally be part of the default enumeration.
5664

@@ -59,14 +67,16 @@ A user 'Tester' with password 'Start123!' was created. Firewall access was allow
5967
#### Metasploitable 2
6068
The second demo shows a run against Metasploitable 2. The following command is being used:
6169

62-
```enum4linux-ng.py 192.168.125.145 -A -C```
70+
```console
71+
enum4linux-ng.py 192.168.125.145 -A -C
72+
```
6373

6474
This time the ```-A``` and ```-C``` option are used. While the first one behaves similar to enum4linux ```-a``` option, the second one will enable enumeration of services. This time no credentials were provided. The tool automatically detects that it needs to use SMBv1. No YAML or JSON file is being written. Again I scroll up so that the results become more clear.
6575

6676
![Demo](https://github.com/cddmp/misc/blob/master/screencasts/enum4linux-ng/demo2.gif)
6777

6878
### Usage
69-
```
79+
```console
7080
usage: enum4linux-ng.py [-h] [-A] [-As] [-U] [-G] [-Gm] [-S] [-C] [-P] [-O] [-L] [-I] [-R [BULK_SIZE]] [-N] [-w DOMAIN] [-u USER]
7181
[-p PW | -K TICKET_FILE | -H NTHASH] [--local-auth] [-d] [-k USERS] [-r RANGES] [-s SHARES_FILE] [-t TIMEOUT] [-v] [--keep]
7282
[-oJ OUT_JSON_FILE | -oY OUT_YAML_FILE | -oA OUT_FILE]
@@ -119,26 +129,23 @@ options:
119129
## Installation
120130
There are multiple ways to install the tool. Either the tool comes as a package with your Linux distribution or you need to do a manual install.
121131

122-
### Kali Linux
123-
```console
124-
# apt install enum4linux-ng
125-
```
132+
### Automatic Installation
133+
I'm aware of the following Linux distributions which package the tool:
134+
135+
#### Archstrike
126136

127-
### Archstrike
128137
```console
129-
# pacman -S enum4linux-ng
138+
pacman -S enum4linux-ng
130139
```
131140

132-
### NixOS
141+
#### NixOS
133142
(tested on NixOS 20.9)
143+
134144
```console
135-
$ nix-env -iA nixos.enum4linux-ng
145+
nix-env -iA nixos.enum4linux-ng
136146
```
137-
138-
## Manual Installation
139-
If your Linux distribution does not offer a package, the following manual installation methods can be used instead.
140-
141-
### Dependencies
147+
### Manual Installation
148+
#### Dependencies
142149
The tool uses the samba clients tools, namely:
143150
- nmblookup
144151
- net
@@ -157,67 +164,69 @@ For a faster processing of YAML (optional!) also install (should come as a depen
157164

158165
Some examples for specific Linux distributions installations are listed below. Alternatively, distribution-agnostic ways (python pip, python virtual env and Docker) are possible.
159166

160-
### Linux distribution specific
167+
#### Linux distribution specific
161168
For all distribution examples below, LibYAML is already a dependency of the corresponding PyYaml package and will be therefore installed automatically.
162-
#### ArchLinux
169+
##### ArchLinux
163170

164171
```console
165-
# pacman -S smbclient python-ldap3 python-yaml impacket
172+
pacman -S smbclient python-ldap3 python-yaml impacket
166173
```
167-
#### Fedora/CentOS/RHEL
174+
##### Fedora/CentOS/RHEL
168175
(tested on Fedora Workstation 31)
169176

170177
```console
171-
# dnf install samba-common-tools samba-client python3-ldap3 python3-pyyaml python3-impacket
178+
dnf install samba-common-tools samba-client python3-ldap3 python3-pyyaml python3-impacket
172179
```
173180

174-
#### Debian/Ubuntu/Linux Mint
175-
(For Ubuntu 18.04 or below use the Docker or Python virtual environment variant)
181+
##### Kali Linux/Debian/Ubuntu/Linux Mint
182+
(tested on Kali Linux 2020.1, recent Debian (e.g. Buster) or Ubuntu versions should work, for Ubuntu 18.04 or below use the Docker or Python virtual environment variant)
176183

177184
```console
178-
# apt install smbclient python3-ldap3 python3-yaml python3-impacket
185+
apt install smbclient python3-ldap3 python3-yaml python3-impacket
179186
```
180187

181-
### Linux distribution-agnostic
182-
#### Python pip
188+
#### Linux distribution-agnostic
189+
##### Python pip
183190
Depending on the Linux distribution either `pip3` or `pip` is needed:
184191

185192
```console
186-
$ pip install pyyaml ldap3 impacket
193+
pip install pyyaml ldap3 impacket
187194
```
188195

189196
Alternative:
190197

191198
```console
192-
$ pip install -r requirements.txt
199+
pip install -r requirements.txt
193200
```
194201

195202
Remember you need to still install the samba tools as mentioned above.
196203

197-
#### Python virtual environment
204+
##### Python virtual environment
198205
```console
199-
$ git clone https://github.com/cddmp/enum4linux-ng
200-
$ cd enum4linux-ng
201-
$ python3 -m venv venv
202-
$ source venv/bin/activate
203-
$ pip install wheel
204-
$ pip install -r requirements.txt
206+
git clone https://github.com/cddmp/enum4linux-ng
207+
cd enum4linux-ng
208+
python3 -m venv venv
209+
source venv/bin/activate
210+
pip install wheel
211+
pip install -r requirements.txt
205212
```
206213
Then run via:
207214

208-
```python3 enum4linux-ng.py -As <target>```
215+
```console
216+
python3 enum4linux-ng.py -As <target>
217+
```
209218

210219
Remember you need to still install the samba tools as mentioned above. In addition, make sure you run ```source venv/bin/activate``` everytime you spawn a new shell. Otherwise the wrong Python interpreter with the wrong libraries will be used (your system one rather than the virtual environment one).
211220

212-
#### Docker
221+
##### Docker
213222
```console
214-
$ git clone https://github.com/cddmp/enum4linux-ng
215-
$ cd enum4linux-ng
216-
$ docker build . --tag enum4linux-ng
223+
git clone https://github.com/cddmp/enum4linux-ng
224+
cd enum4linux-ng
225+
docker build enum4linux-ng --tag enum4linux-ng
217226
```
218227
Once finished an example run could look like this:
219228
```console
220-
$ docker run -t enum4linux-ng -As <target>
229+
docker run -t enum4linux-ng -As <target>
221230
```
222231
## Contribution and Support
223232
Occassionally, the tool will spit out error messages like this:

0 commit comments

Comments
 (0)