pentesting, updated

NetExec (nxc)

Swiss-army tool for authenticating and running checks across SMB, LDAP, WinRM, MSSQL, RDP and more at once.

What it’s for

Validate credentials (or spray them) against an entire subnet across multiple Windows/AD protocols, then pivot straight into command execution or enumeration.

Install

pipx install netexec
# formerly CrackMapExec — netexec is the maintained fork

Common commands

nxc smb 10.10.10.0/24 -u jdoe -p Password1          # validate one credential against a whole subnet
nxc smb 10.10.10.0/24 -u users.txt -p Password1 --continue-on-success  # password spray, one password, many users
nxc smb 10.10.10.5 -u jdoe -p Password1 --shares     # list accessible shares
nxc ldap 10.10.10.5 -u jdoe -p Password1 --users      # enumerate AD users over LDAP
nxc smb 10.10.10.5 -u jdoe -p Password1 -x "whoami"   # execute a command (if privileges allow)

Useful flags

FlagEffect
--sharesEnumerate SMB shares and access level
--users / --groupsEnumerate domain users/groups
-x / -XExecute a command / PowerShell
--continue-on-successKeep spraying after a hit, instead of stopping

Notes

Throttle spraying the same way as Hydra — check the lockout policy first.

Used in

§ home
~/knubertus/home/
1,1 Top