NetExec on Kali Linux: A Practical Guide to nxc

·

If you’ve read older Active Directory pentest guides, you’ll have seen CrackMapExec everywhere. It’s no longer maintained. Its community continuation is NetExec, run as nxc, and it’s packaged in Kali. NetExec lets you point one command at a whole network and ask: which Windows hosts are here, do these credentials work on them, what can I reach, and where am I an admin. This guide covers installing it and the commands you’ll use most.

Only run NetExec against systems you own or have written permission to test. Credential checks across a network are noisy and can lock accounts. Practise in a lab, such as a couple of Windows VMs and a test domain controller.

Installing NetExec on Kali

The Kali package is called netexec:

sudo apt update
sudo apt install netexec
nxc --help

It installs three commands: netexec and its short alias nxc, plus nxcdb, a small database tool for the results NetExec collects. Everything below uses nxc.

How a NetExec command is built

Every command follows the same pattern: the protocol, the target, then options.

nxc <protocol> <target> -u <user> -p <password> [options]

Supported protocols include smb, ldap, winrm, mssql, rdp, ssh, wmi, ftp, vnc and nfs. The target can be one IP, a hostname, a CIDR range like 192.168.56.0/24, or a file of targets. Run nxc smb --help to see the options for one protocol.

Map the SMB hosts on a network

Without any credentials, NetExec will tell you a lot about each Windows host it finds:

nxc smb 192.168.56.0/24

For each host you get the hostname, domain, Windows version, and whether SMB signing is required. That last one matters: hosts that don’t require signing are candidates for relay attacks, so they’re worth noting in your report. NetExec can write them to a file for you:

nxc smb 192.168.56.0/24 --gen-relay-list relay-targets.txt

If you’re new to network discovery, Nmap for beginners covers finding hosts and open ports first.

Check credentials

Give NetExec a username and password and it tests them against every target:

nxc smb 192.168.56.0/24 -u alice -p 'Spring2026!'

A green [+] means the login worked. If the result also shows (Pwn3d!), that account has local admin rights on that host, which is usually the most important finding of the whole scan. A few useful variations:

  • --local-auth tests a local account (such as the built-in Administrator) instead of a domain account
  • -H <NT hash> authenticates with a password hash instead of a password
  • -u users.txt -p passwords.txt tries lists, and --continue-on-success keeps going after the first hit
  • -u '' -p '' checks for null sessions, and -u guest -p '' checks the guest account

Be careful with lists. Check the domain’s lockout policy first with --pass-pol, and keep attempts below the threshold. Password spraying a real domain without care will lock out real people. For brute forcing other services, Hydra on Kali Linux is the better tool.

Enumerate shares, users and policy

Once you have any valid account, enumeration is where NetExec shines:

nxc smb 192.168.56.10 -u alice -p 'Spring2026!' --shares
nxc smb 192.168.56.10 -u alice -p 'Spring2026!' --users
nxc smb 192.168.56.10 -u alice -p 'Spring2026!' --pass-pol
nxc smb 192.168.56.10 -u alice -p 'Spring2026!' --rid-brute

--shares lists every share and whether you can read or write it. Readable shares are where passwords in scripts and config files turn up. --users lists domain users, --pass-pol shows the password and lockout policy, and --rid-brute enumerates accounts by cycling through security IDs, which often works when other user listing is blocked.

Modules

NetExec has a module system for jobs beyond the built-in flags. List the modules for a protocol with -L, and run one with -M:

nxc smb -L
nxc smb 192.168.56.10 -u alice -p 'Spring2026!' -M spider_plus

spider_plus crawls every readable share and saves a list of the files it finds, which is much faster than browsing shares by hand. Read a module’s options with --options before you run it, because some modules make changes on the target.

Other protocols

The same pattern works elsewhere. nxc winrm checks whether an account can use Windows Remote Management, which means a remote shell. nxc ldap queries the domain controller directly. nxc mssql tests SQL Server logins. Switching protocol is often how you find that an account with no admin rights over SMB still has a way in.

Keeping track of results

NetExec stores hosts and working credentials in a local database as it goes. nxcdb lets you browse it and keep separate workspaces per engagement, so results from one client never mix with another:

nxcdb -cw client-lab
nxcdb -sw client-lab

Where NetExec fits

NetExec is a fast way to see where credentials work across a Windows network. It doesn’t replace careful manual testing, and its output is only as good as your scope and notes. Pair it with packet captures from Wireshark to see exactly what it sends, and with Metasploit once you’ve found somewhere worth going further.


Leave a Reply