GO KALI FREE

Enum4linux

Information Gathering

Beginnermedium risk

Enum4linux is a comprehensive SMB enumeration tool for extracting user lists, share listings, group information, password policies, and system details from Windows and Samba systems using various NetBIOS and SMB techniques.

Installation

sudo apt install enum4linux

Basic Syntax

enum4linux [options] <target>

Quick Facts

Category
SMB Enumeration
Platform
Linux
Protocol
SMB / NetBIOS
Difficulty
Beginner-Friendly
Common Usage
Windows Network Reconnaissance
Default Port
139/445
Language
Perl / Python (ng)
License
GPL

Tool Overview

Enum4linux is a Perl-based enumeration tool designed specifically for extracting information from Windows and Samba systems using the SMB (Server Message Block) protocol. It leverages NetBIOS over TCP/IP to discover users, groups, shares, policies, and system details that are critical for network reconnaissance and security assessments.

The tool works by establishing SMB connections to the target host and querying various information classes including user accounts, shared resources, group memberships, password policies, and operating system characteristics. It supports both authenticated and anonymous (null session) enumeration, making it versatile for different security scenarios.

For modern environments, Enum4Linux-NG (the next-generation Python 3 rewrite) provides the same capabilities with cleaner output, JSON export, and improved performance. Both tools are essential for penetration testers, red teamers, and system administrators conducting Windows network security assessments.

Common Commands

enum4linux -a 192.168.1.10All enumeration - Comprehensive Windows/Samba enumeration including users, groups, shares, password policy, and OS details
enum4linux -U 192.168.1.10User enumeration - Extract list of local user accounts from the target system
enum4linux -S 192.168.1.10Share enumeration - List all available SMB shares including hidden and administrative shares
enum4linux -G 192.168.1.10Group enumeration - Retrieve group memberships and local group information
enum4linux -P 192.168.1.10Password policy - Display password complexity requirements and account lockout settings
enum4linux -o 192.168.1.10Output to file - Save enumeration results to a file for later analysis
enum4linux -a -u '' -p '' 192.168.1.10Anonymous full enumeration - Complete scan using null session credentials
enum4linux -l 192.168.1.10List enumeration - Show detailed listing of shares and their contents
enum4linux -n 192.168.1.10NetBIOS enumeration - Extract NetBIOS names, workgroups, and domain information
enum4linux -i 192.168.1.10OS identification - Determine the exact operating system version and service pack
enum4linux -r -u '' -p '' 192.168.1.10RID cycling - Enumerate users by brute-forcing Relative Identifiers when direct user listing is blocked
enum4linux -w WORKGROUP -a 192.168.1.10Workgroup discovery - Specify the workgroup/domain name manually for accurate enumeration
enum4linux -v -a 192.168.1.10Verbose scan - Show the underlying smbclient, rpcclient, and net commands as they run for debugging
enum4linux -a 192.168.1.10 | tee enum_192.168.1.10.txtSave output - Run full enumeration while writing results to a timestamped report file
for ip in $(cat smb_hosts.txt); do enum4linux -a "$ip" > "enum_$ip.txt"; doneBatch enumeration - Enumerate a list of confirmed SMB hosts and save each to its own file

Step-by-Step Guide

  1. 1Identify the target Windows or Samba host on the network using Netdiscover or Nmap
  2. 2Verify SMB connectivity by checking if ports 139 or 445 are open using Nmap
  3. 3Run a full enumeration scan: enum4linux -a <target_ip> to gather comprehensive data
  4. 4Review the output for valid usernames, active network shares, and group memberships
  5. 5Analyze the password policy information to assess brute-force feasibility
  6. 6Inspect share permissions to identify writable or accessible shares without credentials
  7. 7Document all discovered NetBIOS names, domain information, and OS version details
  8. 8Continue with deeper enumeration using CrackMapExec or SMBClient for share access testing

Warnings

Use Cases

Penetration Testing

Enumerate Windows hosts during authorized penetration tests to discover usernames for brute-force attacks, accessible shares for data exfiltration, and password policies for attack planning.

Red Team Operations

Map Windows network infrastructure during red team engagements, identifying lateral movement opportunities through accessible SMB shares and user account information.

Security Auditing

Assess SMB security posture by identifying anonymous access, weak password policies, and exposed shares that could be exploited by attackers.

Network Inventory

Discover and catalog Windows systems on a network, collecting OS versions, NetBIOS names, workgroup memberships, and shared resources for asset management.

Active Directory Reconnaissance

Gather initial domain information from Domain Controllers including user listings, group policies, and trust relationships during AD security assessments.

Incident Response

Investigate compromised Windows systems by enumerating user accounts, shared folders, and network configuration to understand the scope of a security incident.

Key Features

Comparison

Enum4linux vs Enum4linux-ng

FeatureEnum4linuxEnum4linux-ng
LanguagePerl (legacy)Python 3 (modern)
MaintenanceLargely unmaintainedActively maintained
SMB Version SupportSMBv1-centricSMBv1/2/3
Output FormatsFree text onlyText, JSON, YAML
Error HandlingBasicRobust, clearer messages
SpeedMediumFaster
Best ForLegacy compatibility / labsModern engagements & automation

Enum4linux vs SMBClient

FeatureEnum4linuxSMBClient
Primary RoleAutomated enumerationInteractive share access
Users/Groups/PolicyYes (automated)No
Browse Share ContentsLists shares onlyYes (ls, get, put)
File Download/UploadNoYes
AutomationOne-command sweepManual / scripted
Pipeline RoleDiscover shares & usersValidate & access shares
Best ForInitial enumerationConfirming access & data

Enum4linux vs CrackMapExec

FeatureEnum4linuxCrackMapExec
ScopeSingle hostNetwork-wide (ranges)
Credential SprayingNoYes (parallel)
Post-ExploitationNoYes (exec, dump, modules)
SMBv2/3 SupportLimited (ng better)Full
Learning CurveLowMedium
Speed at ScaleSlow across rangesFast (threaded)
Best ForFocused single-host reconLarge-scale SMB attacks

Enum4linux vs Nmap SMB NSE

FeatureEnum4linuxNmap SMB NSE
ApproachDedicated SMB enumerationScriptable scan add-on
User EnumerationYes (RID cycling)Yes (smb-enum-users)
Share EnumerationYesYes (smb-enum-shares)
Vuln DetectionIndirect (reports SMB version)Yes (smb-vuln-* scripts)
Depth of SMB DataHigh (policy, groups, OS)Moderate
IntegrationStandaloneWithin Nmap workflow
Best ForDeep SMB profilingQuick checks during scanning

Enum4linux vs NetExec (nxc)

FeatureEnum4linuxNetExec
StatusClassic enumeration toolMaintained CME successor
ProtocolsSMB / NetBIOSSMB, WinRM, LDAP, MSSQL, SSH, RDP
Multi-hostOne at a time / batch loopNative ranges & subnets
Credential ChecksEnumeration onlyAuth, spraying, hash relay
ModulesFixed flag setExtensive module ecosystem
OutputText (ng: JSON)Console + database + logs
Best ForFirst-touch SMB reconFull AD attack workflows

Manual SMB Enumeration vs Automated (Enum4linux)

FeatureManual (smbclient/rpcclient)Automated (Enum4linux)
SpeedSlow, command-by-commandFast one-command sweep
CoverageOnly what you queryUsers, shares, groups, policy, OS
Learning ValueHigh (understand each step)Lower (abstracts the calls)
Control / StealthPrecise, quieterNoisier, many queries
RepeatabilityDepends on operatorConsistent every run
Best ForTargeted checks & learningComprehensive fast recon

Best Practices

Common Errors

enum4linux: command not found
Install with 'sudo apt install enum4linux', or use enum4linux-ng via 'pip3 install enum4linux-ng'. Verify with 'enum4linux -h'.
Connection to <host> failed / NT_STATUS_CONNECTION_REFUSED
Confirm SMB is reachable first: 'nmap -p139,445 --open <host>'. If filtered, a firewall is blocking SMB — enumeration is not possible from your position.
NT_STATUS_ACCESS_DENIED
Supply valid credentials with -u and -p, or test with a low-privilege account. Modern Windows disables null sessions by default.
NT_STATUS_LOGON_FAILURE
Verify credentials and the domain/workgroup (-w). Watch password policy lockout thresholds before retrying to avoid locking accounts.
Null session returns almost nothing
This is expected on hardened systems. Pivot to authenticated enumeration with credentials, or use RID cycling (-r) which sometimes still works.
protocol negotiation failed / SMB1 disabled
Use enum4linux-ng, which supports SMBv2/3, or switch to NetExec/CrackMapExec for SMBv3-only targets.
NT_STATUS_ACCESS_DENIED with 'SMB signing required'
Authenticate with valid credentials whose session can be signed; null-session enumeration will not succeed against signing-required hosts.
NetBIOS name lookup timeout / nmblookup hangs
This is harmless on modern networks — enum4linux falls back to port 445. Add -w to specify the workgroup manually if resolution matters.
Could not resolve hostname
Use the IP address directly, add the host to /etc/hosts, or fix DNS. Verify with 'nslookup <host>' or 'dig <host>'.
No route to host / host unreachable
Confirm you are on the correct network/VPN and can ping or ARP the host. Check 'ip route' and any pivot/proxy configuration.
Scan is extremely slow / appears to hang
Target specific enumeration flags instead of -a, lower the range for RID cycling, and set a timeout with -t. Enum4linux-ng is faster overall.

People Also Ask

Is Enum4linux still used in 2026?

Yes, though enum4linux-ng (the Python 3 rewrite) is now preferred. The original Perl script still ships with Kali and works against legacy SMBv1 hosts, but enum4linux-ng handles modern SMBv2/3 targets and produces JSON output.

Does Enum4linux need credentials?

Not always. It can enumerate anonymously via null sessions on hosts that allow them. Modern Windows disables null sessions, so authenticated enumeration with -u and -p usually returns far more data.

What is RID cycling in Enum4linux?

RID cycling (-r) brute-forces Relative Identifiers to enumerate user accounts by their SID suffix when direct user listing is blocked. It can recover valid usernames even when RestrictAnonymous limits standard enumeration.

Enum4linux vs enum4linux-ng — which should I use?

Use enum4linux-ng for new work: it is actively maintained, supports SMBv2/3, and exports JSON/YAML. Keep the original enum4linux for legacy SMBv1 targets or when reproducing older tutorials and labs.

Why does Enum4linux return no results?

Usually because null sessions are disabled, SMBv1 is turned off, or ports 139/445 are filtered. Verify SMB is reachable with Nmap, try enum4linux-ng, and supply valid credentials for authenticated enumeration.

Learning Path

  1. 1
  2. 2
  3. 3
  4. 4
  5. 5
  6. 6

Related Tools

Enum4Linux-NG

SMB Enumeration

Next-generation Python 3 rewrite of Enum4linux with cleaner output, JSON export, and improved performance.

SMBClient

SMB Client

Interactive SMB client for testing share access, listing contents, and downloading files from Windows shares.

NBTScan

NetBIOS Scanner

Fast NetBIOS scanner for discovering Windows hosts and their NetBIOS names, workgroups, and MAC addresses.

Nmap

Network Scanner

Versatile network scanner for port discovery, service detection, and OS fingerprinting across networks.

CrackMapExec

Post-Exploitation

Post-exploitation tool for enumerating and attacking SMB services across large networks efficiently.

Hydra

Password Attacks

Fast network brute-force tool for testing credentials against various services including SMB.

Frequently Asked Questions

What is Enum4Linux?

Enum4Linux is a Perl-based enumeration tool designed for extracting information from Windows and Samba systems using the SMB protocol. It discovers user accounts, shared resources, group memberships, password policies, and system details by querying NetBIOS over TCP/IP on ports 139 or 445.

What does Enum4Linux do?

Enum4Linux enumerates Windows/Samba systems by connecting via SMB and extracting user lists, group memberships, share names, password policies, OS versions, NetBIOS names, and domain information. It supports both anonymous (null session) and authenticated enumeration.

What is Enum4Linux used for?

Enum4Linux is used for Windows network reconnaissance during penetration testing, red team operations, security audits, and incident response. It helps identify attack vectors by discovering users for brute-force attacks, accessible shares for data exfiltration, and password policies for attack planning.

How do I use Enum4Linux?

Basic usage: enum4linux -a <target_ip> for full enumeration. For user enumeration: enum4linux -U <target>. For shares: enum4linux -S <target>. For password policy: enum4linux -P <target>. Always start with anonymous access (-u '' -p '') before trying authenticated enumeration.

How do I install Enum4Linux in Ubuntu?

Install Enum4Linux on Ubuntu/Debian: sudo apt install enum4linux. For Enum4Linux-NG: sudo apt install enum4linux-ng. Alternatively, clone from GitHub: git clone https://github.com/cddmp/enum4linux.git && cd enum4linux && sudo cp enum4linux /usr/local/bin/.

What is Enum4Linux-NG?

Enum4Linux-NG is the next-generation rewrite of Enum4Linux, rebuilt from scratch in Python 3. It offers cleaner output, JSON/CSV export, better error handling, and improved performance while maintaining the same enumeration capabilities as the original Perl-based tool.

What is the difference between Enum4Linux and Enum4Linux-NG?

Enum4Linux is the original Perl script, while Enum4Linux-NG is the modern Python 3 rewrite. Enum4Linux-NG adds JSON/CSV output, better error handling, faster execution, and active development. The original Enum4Linux is simpler and widely available in Kali Linux repositories.

Can Enum4Linux enumerate users?

Yes, Enum4Linux enumerates users via the -U flag. It uses SAM database queries, RID cycling, and policy enumeration to extract local user accounts. For authenticated enumeration, provide credentials with -u and -p flags for more complete results.

Can Enum4Linux discover SMB shares?

Yes, Enum4Linux discovers SMB shares via the -S flag. It lists all available shares including hidden, administrative, and default shares. Use SMBClient to test discovered shares for access permissions and content availability.

What port does Enum4Linux use?

Enum4Linux uses SMB ports 139 (NetBIOS Session Service) and 445 (Direct SMB). Port 445 is used by modern Windows systems, while port 139 is used by older systems and Samba. Enum4Linux automatically detects which port is available.

Is Enum4Linux safe to use?

Enum4Linux is safe when used with proper authorization. It generates SMB traffic that appears in security logs and may trigger IDS alerts. Only use it against systems you have explicit permission to test. Always verify target IP addresses to avoid scanning production systems.

What are common Enum4Linux errors and how do I fix them?

Common errors include 'Connection refused' (SMB not running or firewall blocking), 'Access denied' (null sessions disabled, try authenticated enumeration), 'Timeout' (increase -t value or check network connectivity), and 'Host unreachable' (verify IP and network route).

What are common Enum4Linux mistakes beginners make?

Common beginner mistakes include not testing anonymous access first, skipping NetBIOS name resolution, ignoring password policy data, not checking share permissions, overlooking domain information, and using default credentials without verification.

What are the best Enum4Linux alternatives?

The best alternatives are Enum4Linux-NG (modern Python 3 rewrite), SMBClient (interactive share testing), NBTScan (fast host discovery), CrackMapExec (large-scale SMB attacks), and Nmap (port scanning and service detection).

Is Enum4Linux legal to use?

Enum4Linux is legal when used with explicit authorization on systems you own or have written permission to test. Unauthorized SMB enumeration is illegal under computer fraud laws (CFAA, Computer Misuse Act). Always obtain written authorization before running Enum4Linux against any network. Use it only in lab environments, CTF competitions, or authorized penetration testing engagements.

Can Enum4Linux enumerate Active Directory domains?

Yes, Enum4Linux can enumerate Active Directory when targeting Domain Controllers with valid domain credentials. It extracts user listings, group memberships (including Domain Admins), password policies, domain SID, and trust relationships. For deeper AD analysis, combine with BloodHound, ldapsearch, or CrackMapExec for comprehensive domain reconnaissance.

Does Enum4Linux work on Windows?

Enum4Linux is a Linux-based tool designed for Kali Linux and other Linux distributions. It does not run natively on Windows. However, Enum4Linux targets Windows systems remotely via SMB. To use Enum4Linux from Windows, install it in WSL (Windows Subsystem for Linux) or run it from a Linux virtual machine. Enum4Linux-NG (Python 3) can also run on Windows with Python installed.

Can enum4linux enumerate password policies?

Yes, use enum4linux -P <target> to extract password policy information including minimum password length, maximum password age, password history length, lockout threshold, and lockout duration. This data is critical for planning brute-force attacks with tools like Hydra, as it reveals account lockout thresholds and password complexity requirements.

How do I use enum4linux with a specific workgroup?

Use the -w flag to specify a workgroup or domain: enum4linux -w WORKGROUP -u admin -p password <target>. This is useful when targeting systems in a different workgroup than your own. Use -r to attempt to enumerate domain controllers and -I for NetBIOS information to identify the correct workgroup name first.

Can enum4linux enumerate Windows services?

No, enum4linux focuses on SMB/NetBIOS enumeration (users, shares, groups, policies). For Windows service enumeration, use nmap -sV -p 445, crackmapexec with the smbExec module, or Impacket's services.py. Enum4linux complements these tools by providing user and share data that feeds into service exploitation.

How do I use enum4linux to find shares for data exfiltration?

Run enum4linux -S <target> to list all shares, then use enum4linux -s <sharename> <target> to list contents of specific shares. Look for shares with READ or FULL access permissions. Common targets include IPC$, ADMIN$, NETLOGON, and SYSVOL. Combine with smbclient to download files from accessible shares.

Can enum4linux enumerate trust relationships?

Yes, enum4linux can discover domain trust relationships when targeting Domain Controllers with valid credentials. Look for trust account names and domain SID information in the output. Trust relationships reveal how domains are connected, which is valuable for lateral movement in multi-domain Active Directory environments.

How do I parse enum4linux output for reports?

Redirect output to a file: enum4linux -a <target> > enum_results.txt. Key sections to extract include user lists (for Hydra targeting), share permissions (for access validation), password policies (for lockout planning), and OS version (for exploit selection). Use grep to filter specific sections: grep -A 20 'User Information' enum_results.txt.

How do I use enum4linux to enumerate local groups?

Run enum4linux -G <target> to enumerate local groups and their members. This reveals which users have administrative privileges on the target. For domain-joined systems, combine with -r to enumerate domain groups. Local group enumeration is critical for identifying privileged accounts that can be used for lateral movement.

Can enum4linux detect SMBv1 vulnerabilities?

Yes, enum4linux reports the SMB dialect negotiated during connection. Look for 'SMBv1' in the protocol negotiation output. SMBv1 is vulnerable to EternalBlue (MS17-010) and other critical exploits. Use nmap --script smb-vuln-ms17-010 -p 445 <target> for formal vulnerability validation after identifying SMBv1 via enum4linux.

How does enum4linux compare to enum4linux-ng?

Enum4linux-ng is a modern Python3 rewrite with enhanced output formats (JSON, YAML, grepable), better error handling, and additional enumeration features like LAPS detection. It supports the same core functionality but is actively maintained. Use enum4linux-ng for new engagements and enum4linux for legacy compatibility.

What is RID cycling in Enum4linux?

RID cycling enumerates users by iterating through Relative Identifiers (RIDs) appended to the domain SID, resolving each to a username via SMB. Enum4linux performs it with the -r flag, which is useful when direct user listing (-U) is blocked but the null session still resolves SIDs. Well-known RIDs like 500 (Administrator) and 501 (Guest) are reliable starting points.

How is Enum4linux different from NetExec (nxc)?

Enum4linux is a focused single-host SMB enumeration tool, while NetExec (the maintained successor to CrackMapExec) is a multi-protocol swiss army knife supporting SMB, WinRM, LDAP, MSSQL, and more across entire ranges with credential spraying and modules. Use Enum4linux for first-touch recon of one host, then NetExec to scale enumeration and credential testing across the network.

Why does Enum4linux fail on modern Windows 11 or Server 2022?

Modern Windows disables SMBv1 and null sessions by default, and often requires SMB signing — all of which the original Perl enum4linux depends on. As a result, anonymous enumeration returns little or nothing. Use enum4linux-ng for SMBv2/3 support and supply valid credentials for authenticated enumeration on hardened hosts.

Does Enum4linux enumerate SMB shares anonymously?

It can, but only if the target permits null sessions. Run 'enum4linux -S -u "" -p "" <target>' to list shares anonymously. On modern systems where anonymous access is disabled, you will need credentials. Always validate discovered shares with SMBClient before reporting them as accessible.

Where does Enum4linux fit in an SMB assessment workflow?

After host discovery (Netdiscover), port scanning (Nmap), and confirming SMB is open, Enum4linux performs the deep SMB enumeration step. Its output feeds SMBClient for share access, NetExec/CrackMapExec for network-wide credential testing, and BloodHound for Active Directory path mapping — before findings are consolidated into the report.

Is Enum4linux output reliable enough for a report?

Enum4linux output is a strong starting point, but you should validate key findings manually before reporting. Confirm share access with SMBClient, cross-check RID-cycled users against direct enumeration, and verify the SMB version independently. Use enum4linux-ng JSON output to preserve structured evidence for your report.

Tags

#reconnaissance#smb-enumeration#samba#windows-enumeration#netbios#user-enumeration#share-enumeration#active-directory

Output Explanation

Enum4linux output is organized into structured blocks: User Accounts (enumerated local users), Groups (local group memberships), Shares (SMB share names and permissions), Password Policy (complexity and lockout rules), Operating System (version and service pack), Domain Information (workgroup or AD domain), NetBIOS Names (host and workgroup identifiers), and Session Data (null session availability). Focus on usernames for brute-force attacks, anonymous shares for data access, and password policy for attack planning.

Ethical Usage Notice

This tool is designed for authorized security testing, educational purposes, and legitimate network administration only. Unauthorized access to computer systems is illegal.