
enum4linux: Windows/Samba enumeration
enum4linux: Windows and Samba enumeration
A pragmatic tool to gather information from Windows and Samba hosts. This guide focuses on practical usage, common traps, and concrete examples.
Quick intuition
- enum4linux tries multiple methods to pull information from a target: user lists, shares, OS info, and more.
- It supports anonymous scans and authenticated scans when you have credentials.
- It can be noisy and potentially alarming to defenders, so use responsibly and with authorization.
Quick start
- Enumerate with all methods:
enum4linux -a {{remote_host}}
- Enumerate with login credentials:
enum4linux -u {{user_name}} -p {{password}} {{remote_host}}
- List usernames from a host:
enum4linux -U {{remote_host}}
- List shares:
enum4linux -S {{remote_host}}
- Get OS information:
enum4linux -o {{remote_host}}
Common use cases (examples)
- Quick audit of a host you own:
enum4linux -a 192.0.2.10
- If you have credentials:
enum4linux -u alice -p s3cr3t 192.0.2.10
- Only want to know users:
enum4linux -U 192.0.2.10
- Enumerate shares for mapping writable resources:
enum4linux -S 192.0.2.10
What you’ll typically see
- OS information lines like OS and server service pack.
- Lists of users and groups when permissions allow.
- Shared folders and sometimes printable shares.
- Possible authentication errors that indicate wrong credentials or account restrictions.
Common pitfalls
- Firewalls or IDS may block SMB probes; you might see timeouts instead of data.
- Anonymous enumeration may be restricted on hardened targets; expect limited output.
- Credential handling: avoid exposing credentials in shell history or scripts.
- Legacy SMB protocols may be disabled; results may vary across Windows versions.
Tips for reliable results
- Start with passive, non-authenticated scans (
-a
or-U/-S
), then escalate with credentials if permitted. - If you see timeouts, verify network reachability and that SMB ports are open (usually 445 and/or 139).
- Combine outputs with other tools (nmap scripts, smbclient) for confirmation.
- Run in a controlled environment and respect legal boundaries.
Troubleshooting quick checklist
- No output or errors about authentication:
- Ensure credentials are correct and the account has the necessary permissions.
- Check if the target blocks SMB or requires signing.
- Partial data from -a:
- Some targets disable certain enum4linux methods; try targeted options like -U, -S, or -o individually.
- Connectivity errors:
- Confirm the host is reachable (ping/traceroute).
- Verify network paths and firewall rules.
Related notes
- enum4linux is a conventional tool for Windows/Samba enumeration and is often used in pen-testing assessments.
- Always obtain explicit permission before scanning systems you do not own.