enum4linux-ng
Python rewrite of enum4linux that enumerates users, groups, shares, password policy, OS and domain info from Windows and Samba hosts over SMB, RPC and LDAP, with YAML/JSON export.
What it is
enum4linux-ng is a Python rewrite of the classic enum4linux.pl script. It pulls information from Windows and Samba hosts over SMB, MS-RPC and LDAP. It runs the standard Samba client tools (nmblookup, net, rpcclient, smbclient) for you, parses what they return, and gives you a tidy summary covering users, groups, shares, password policy, OS details, printers and domain information.
It is built for penetration testers, internal network assessors and CTF players. It usually runs early in an internal assessment, to see what an anonymous or low-privileged account can learn from a host. Defenders can use the same results to find null sessions, overly open shares and weak password policies before an attacker does.
Key features
- One "simple" run (
-Aor-As) covering users, groups, shares, password policy, OS info, printers and LDAP domain details - Smart enumeration: checks first whether SMB and LDAP are reachable and skips tests that would fail
- Built-in LDAP queries and password-policy (polenum) checks, so ldapsearch and polenum are not needed
- Login with a username and password, an NT hash (
-H), a Kerberos ticket (-K) or local authentication - SMB dialect detection, SMB signing checks and fallback to legacy SMBv1
- Optional RID cycling (
-R), group members (-Gm), services (-C) and share-name brute-forcing (-s) - Exports to YAML, JSON or both (
-oY,-oJ,-oA), and saves partial results if you press Ctrl+C - Experimental IPv6 support; colour output can be turned off with
NO_COLOR
Install
On Kali Linux, where the package also brings in smbclient, impacket, ldap3 and PyYAML:
sudo apt install enum4linux-ng
On ArchStrike or NixOS:
pacman -S enum4linux-ng
nix-env -iA nixos.enum4linux-ng
Elsewhere, install the Samba client tools first (for example apt install smbclient), then use a virtual environment:
git clone https://github.com/cddmp/enum4linux-ng
cd enum4linux-ng
python3 -m venv venv
source venv/bin/activate
pip install wheel
pip install -r requirements.txt
Or build the Docker image from the repo:
docker build . --tag enum4linux-ng
docker run -t enum4linux-ng -As 10.0.0.5
Getting started
Against a lab or in-scope host, run the short simple enumeration without credentials and save the results as YAML:
enum4linux-ng -As 10.0.0.5 -oY lab-host
The output is split into sections such as SMB dialects, session check, OS info, users, shares and password policy. If the null session is refused, the tool stops after the session check. That is a good result for the defender. If you have a test account, add credentials to see what an ordinary domain user can read:
enum4linux-ng -As 10.0.0.5 -u tester -p 'Lab-Pass1' -oA lab-host-auth
lab-host-auth.yaml and lab-host-auth.json keep the same data in a form other tools can read.
Good to know
- Free and open source under GPL-3.0. Maintained by a single author with occasional releases. The latest is v1.3.10 (February 2026), which Kali also ships.
- No root rights are needed. Network access to TCP 139/445 (and 389/636 for LDAP) is enough. Resource use is light.
- Use it only on systems you own or are explicitly authorised to assess. Enumerating someone else's hosts may be illegal.
- RID cycling and share brute-forcing are noisy and can trigger alerts or lockout monitoring. They are off by default for that reason.
- Modern Windows usually blocks anonymous sessions. Many results only appear when you supply credentials.
- When you see "please open a GitHub issue" errors, rerun with
-v --keepto see the exact Samba command that failed.
Alternatives
- enum4linux (original Perl): still around, but it has no structured export and is no longer actively developed.
- NetExec (formerly CrackMapExec): better for spraying checks across many hosts and protocols at once.
- Impacket scripts such as
lookupsid.pyandrpcdump.py: for precise, single-purpose RPC queries.
