tools

Overview

NetExec (nxc) is the actively maintained successor to CrackMapExec. It is a post-exploitation and network enumeration tool for assessing large Active Directory and Windows environments. Supports SMB, WinRM, MSSQL, SSH, LDAP, RDP, and other protocols — enables credential testing, share enumeration, remote command execution, and hash dumping from Linux.

ℹ︎Note on CrackMapExec:

CrackMapExec (cme) is deprecated and no longer maintained. NetExec (nxc) has an identical interface — replace crackmapexec with nxc in any existing commands. Confirmed broken during HTB CJCA exam (April 2026): apt and pipx installs both failed.

Target / Context

Windows and Active Directory environments during internal network penetration testing. Primary uses: SMB share enumeration, credential spraying, and remote command execution.


Installation

ℹ︎Installation Commands:
pipx install netexec
pipx upgrade netexec

Basic Usage

ℹ︎Basic Usage:
nxc <protocol> <target>
nxc smb --help
nxc --help

Flags & Options

ℹ︎Flags & Options:
FlagDescriptionExample
smbTarget SMB protocolnxc smb <IP>
winrmTarget WinRM protocolnxc winrm <IP>
mssqlTarget MSSQLnxc mssql <IP>
-uUsername-u john
-pPassword-p ‘password’
-HNTLM hash (pass-the-hash)-H <hash>
—usersEnumerate domain/local users—users
—sharesEnumerate accessible shares—shares
—continue-on-successKeep spraying after first hit—continue-on-success
—spider <share>Spider share contents—spider Devs
—patternFilter spider results—pattern .
—get-fileDownload file from share—get-file tmp.ps1 tmp.ps1
-xExecute CMD command-x “whoami”
-XExecute PowerShell command-X “whoami”
—pass-polRetrieve password policy—pass-pol
—samDump SAM hashes (admin required)—sam
—local-authAuthenticate as local account—local-auth

Common Use Cases

SMB Version and Host Detection

Identify SMB version and host details. SMBv1 indicates a likely vulnerable/legacy system.

ℹ︎Commands:
nxc smb <IP>

Null Session Enumeration

Test for anonymous access and enumerate users without credentials.

ℹ︎Commands:
nxc smb <IP> -u '' -p '' --users

Guest Session Share Enumeration

List available SMB shares using guest-level access.

ℹ︎Commands:
nxc smb <IP> -u guest -p '' --shares

Password Spraying (SMB)

Spray a single password against a list of usernames. Use --continue-on-success to avoid stopping on first hit.

ℹ︎Commands:
nxc smb <IP> -u <userlist.txt> -p 'password' --continue-on-success
nxc smb <IP> -u <userlist.txt> -p <passlist.txt> --no-bruteforce --continue-on-success

Authenticated Share Spidering

Spider a specific share with valid credentials.

ℹ︎Commands:
nxc smb <IP> -u john -p 'password' --spider Devs --pattern .

Remote Command Execution (SMB)

Execute a command on a remote Windows host via SMB (requires admin).

ℹ︎Commands:
nxc smb <IP> -u Administrator -p 'password' -x "whoami"

Remote Command Execution (WinRM)

Execute a command via WinRM (port 5985/47001).

ℹ︎Commands:
nxc winrm <IP> -u john -p 'password' -x "whoami"

File Retrieval from Share

Download a specific file from an accessible SMB share.

ℹ︎Commands:
nxc smb <IP> -u john -p 'password' --share Devs --get-file tmp.ps1 tmp.ps1

  • (SMB Password Spraying — see Windows Pentest Playbook)

References / Images