Enum4linux is a Perl wrapper around the Samba tools (smbclient, rpcclient, net, nmblookup) that automates the enumeration of Windows and Samba systems over SMB/NetBIOS. With a single command it pulls users, groups, shares, password policy and operating system information. It is one of the first stops when auditing an Active Directory environment.
Much of what Enum4linux reveals hinges on the null session: an SMB connection with no username or password that, on old or misconfigured systems, exposes RIDs, users and policy. When null sessions are locked down, RID cycling can still infer accounts by iterating over SIDs; that is why enum4linux-ng leans so heavily on that technique and on telling apart what fails due to permissions versus server configuration.
1. Beginner level — basic SMB enumeration
Command
What it does
enum4linux -a <t>
Full default enumeration
enum4linux -U <t>
Enumerates domain/host users
enum4linux -S <t>
Enumerates shared resources (shares)
enum4linux -G <t>
Enumerates domain groups
enum4linux -P <t>
Enumerates the password policy
enum4linux -O <t>
Enumerates operating system information
enum4linux -M <t>
Enumerates machine group memberships
enum4linux -N <t>
Enumerates via null session
enum4linux -I <t>
Enumerates the domain SID
enum4linux -R <t>
Enumerates user and group RIDs
enum4linux -u user -p pass <t>
Authenticates with known credentials
enum4linux -a <t> > out.txt
Saves all output to a file
enum4linux -v <t>
Verbose mode
enum4linux -h
Shows the help with all options
2. Advanced level — enum4linux-ng and RPC/SMB
Command
What it does
enum4linux-ng -A <t>
Full enumeration with the NG version
enum4linux-ng -A <t> -oJ out.json
Exports the results in JSON format
enum4linux-ng -A <t> -oY out.yaml
Exports the results in YAML format
enum4linux-ng -C <t>
Checks only the null session status
enum4linux-ng -R <t>
Forces RID bruteforcing
enum4linux-ng -r <rango> <t>
Sets the RID range to test
enum4linux-ng -u user -p pass <t>
Authenticates with known credentials
enum4linux-ng -K <t>
Enumerates via Kerberos instead of NTLM
enum4linux-ng --shares <t>
Enumerates and checks access to shares
enum4linux -a -M <t>
Combines full enumeration with memberships
rpcclient -U "" -N <t>
Manual null session via rpcclient
smbclient -L //<t>/ -N
Lists SMB shares without authentication
enum4linux-ng -A <t> --timeout 10
Adjusts the request timeout
enum4linux-ng -v -A <t>
Verbose mode with full enumeration
3. Details people miss
The classic enum4linux is unmaintained and many of its calls fail on modern systems; for current targets use enum4linux-ng, the Python rewrite.
You do not need root to run it, but the Samba tools (smbclient, rpcclient) must be installed: the wrapper only orchestrates them, it does not replace them.
The null session has been disabled by default on Windows for years; if -N returns nothing it is not a tool failure, the server simply does not allow it. Try with credentials (-u/-p) if you have them.
Enum4linux is noisy: -a fires dozens of queries and gets logged on the server. On a red team, tune the options (-U, -S, -P) instead of launching the full enumeration.
RID cycling (-R) can be slow against large ranges; in enum4linux-ng narrow the range with -r so the scan does not drag on needlessly.
Responsible use
These commands are for systems you own or have explicit written authorisation to test (labs, CTFs, contracted engagements). Using them against third-party infrastructure without permission is illegal in most countries.
Enum4linux es un wrapper en Perl sobre las herramientas de Samba (smbclient, rpcclient, net, nmblookup) que automatiza la enumeración de sistemas Windows y Samba a través de SMB/NetBIOS. Con una sola orden extrae usuarios, grupos, recursos compartidos, política de contraseñas e información del sistema operativo. Es una de las primeras paradas al auditar un entorno Active Directory.
Buena parte de lo que revela Enum4linux depende de la sesión nula: una conexión SMB sin usuario ni contraseña que en sistemas antiguos o mal configurados expone RIDs, usuarios y política. Cuando la sesión nula está capada, el RID cycling permite deducir cuentas iterando SIDs; por eso enum4linux-ng insiste tanto en esa técnica y en distinguir qué falla por permisos y qué por configuración del servidor.
1. Nivel principiante — enumeración SMB básica
Comando
Qué hace
enum4linux -a <t>
Enumeración completa por defecto
enum4linux -U <t>
Enumera usuarios del dominio/host
enum4linux -S <t>
Enumera recursos compartidos (shares)
enum4linux -G <t>
Enumera grupos del dominio
enum4linux -P <t>
Enumera la política de contraseñas
enum4linux -O <t>
Enumera información del sistema operativo
enum4linux -M <t>
Enumera membresías de grupos de máquinas
enum4linux -N <t>
Enumera vía sesión nula
enum4linux -I <t>
Enumera el SID del dominio
enum4linux -R <t>
Enumera RIDs de usuarios y grupos
enum4linux -u user -p pass <t>
Autentica con credenciales conocidas
enum4linux -a <t> > out.txt
Guarda toda la salida en un archivo
enum4linux -v <t>
Modo detallado (verbose)
enum4linux -h
Muestra la ayuda con todas las opciones
2. Nivel avanzado — enum4linux-ng y RPC/SMB
Comando
Qué hace
enum4linux-ng -A <t>
Enumeración completa con la versión NG
enum4linux-ng -A <t> -oJ out.json
Exporta los resultados en formato JSON
enum4linux-ng -A <t> -oY out.yaml
Exporta los resultados en formato YAML
enum4linux-ng -C <t>
Comprueba únicamente el estado de sesión nula
enum4linux-ng -R <t>
Fuerza el bruteforce de RIDs
enum4linux-ng -r <rango> <t>
Define el rango de RIDs a probar
enum4linux-ng -u user -p pass <t>
Autentica con credenciales conocidas
enum4linux-ng -K <t>
Enumera vía Kerberos en vez de NTLM
enum4linux-ng --shares <t>
Enumera y comprueba acceso a shares
enum4linux -a -M <t>
Combina enumeración completa con membresías
rpcclient -U "" -N <t>
Sesión nula manual vía rpcclient
smbclient -L //<t>/ -N
Lista shares SMB sin autenticación
enum4linux-ng -A <t> --timeout 10
Ajusta el timeout de las peticiones
enum4linux-ng -v -A <t>
Modo verbose con enumeración completa
3. Detalles que se pasan por alto
El enum4linux clásico está sin mantener y muchas de sus llamadas fallan en sistemas modernos; para objetivos actuales usa enum4linux-ng, que es la reescritura en Python.
No necesitas root para ejecutarlo, pero sí que las herramientas de Samba (smbclient, rpcclient) estén instaladas: el wrapper solo las orquesta, no las reemplaza.
La sesión nula lleva años deshabilitada por defecto en Windows; si -N no devuelve nada no es un fallo de la tool, es que el servidor no la permite. Prueba con credenciales (-u/-p) si las tienes.
Enum4linux es ruidoso: -a lanza decenas de consultas y queda registrado en los logs del servidor. En un red team ajusta las opciones (-U, -S, -P) en lugar de disparar la enumeración completa.
El RID cycling (-R) puede tardar mucho contra rangos grandes; en enum4linux-ng acota el rango con -r para no alargar el escaneo innecesariamente.
Uso responsable
Estos comandos son para entornos propios o con autorización explícita por escrito (laboratorios, CTF, auditorías contratadas). Usarlos contra infraestructura ajena sin permiso es ilegal en la mayoría de países.