Updated Jul 15, 2026

Network

Spray and enum hosts over SMB and LDAP

Authenticated network assessment across SMB, LDAP, WinRM, and more.

Agent

overview

What netexec does

netexec, also invoked as nxc, authenticates to network services and runs enum, spray, dump, or module actions across many hosts. Protocols include SMB, LDAP, MSSQL, WMI, SSH, VNC, FTP, WinRM, and RDP. Pass a target and protocol, then credentials via --username/--password or --hash.

Active Directory work is the common path. Enumerate users, groups, computers, and password policy; spray with --fail-limit / --ufail-limit / --gfail-limit; dump SAM, LSA, or NTDS; spider shares; execute with -x or load --module. Pass-the-hash, Kerberos, and --local-auth are first-class.

Wire it after host and port discovery so auth only hits live services. Scope each run to one protocol. Prefer netexec for authenticated AD and service access; reach for medusa or hydra when you only need parallel login guessing.

source github.com/Pennyw0rth/NetExec

use cases

Where netexec fits

Spray credentials across a domain

Test username and password or hash sets over SMB or LDAP with fail limits so a spray finds valid logins without locking accounts out.

Enumerate Active Directory

Pull domain users, groups, computers, password policy, and shares from a domain controller to map the environment before deeper work.

Dump credential material

Extract SAM, LSA, and NTDS secrets from hosts you have access to, feeding the harvested hashes back into further pass-the-hash assessment.

Run modules and remote commands

Execute a chosen command or PowerShell across reachable hosts, or load a module, to validate access and gather data at scale.

reference

netexec inputs and flags

102 inputs
NameTypeFlagDescription
targetSTRING·The target IP, range, CIDR, hostname, or FQDN.
protocolSTRING·Network protocol to assess (ldap, mssql, smb, wmi, ssh, vnc, ftp, winrm, rdp).
usernameSTRING--usernameUsername to authenticate with.
passwordSTRING--passwordPassword to authenticate with.
hashSTRING--hashNTLM hash(es) for pass-the-hash authentication.
domainSTRING-dDomain to authenticate to.
moduleSTRING--moduleModule to use.
commandSTRING-xExecute the specified command on the target.

Showing key inputs. netexec exposes 102 inputs in total.

Full flag reference (102 inputs)
NameTypeFlagDescription
idSTRING-iddatabase credential ID(s) to use for authentication
lsSTRING--lsList files in the directory
lsaBOOLEAN--lsadump LSA secrets from target systems
pvkFILE--pvkDPAPI option. File with domain backupkey
samBOOLEAN--samdump SAM hashes from target systems
wmiSTRING--wmiissues the specified WMI query
gmsaBOOLEAN--gmsaEnumerate GMSA passwords
hashSTRING--hashNTLM hash(es)
ipv6BOOLEAN-6Enable force IPv6
ntdsSTRING--ntdsdump the NTDS.dit from target DCs using the specifed method (drsuapi,vss)
portSTRING--portTarget port
sccmSTRING--sccmdump SCCM secrets from target systems (wmi,disk)
userSTRING--userDump selected user from DC
codecSTRING--codecSet encoding used (codec) from the target's output. If errors are detected, run chcp.com at the target & map the result with https://docs.python.org/3/library/codecs.html#standard-encodings and then execute again with --codec and the corresponding codec (default: utf-8)
debugBOOLEAN--debugenable debug level information
depthSTRING--depthmax spider recursion depth
disksBOOLEAN--disksenumerate disks
dpapiSTRING--dpapidump DPAPI secrets from target systems, can dump cookies if you add 'cookies', will not dump SYSTEM dpapi if you add nosystem (cookies,nosystem)
querySTRING--queryexecute the specfied query against the target
regexSTRING--regexregex(s) to search for in folders, filenames and file content
usersSTRING--usersenumerate domain users, if a user is specified than only its information is queried.
domainSTRING-ddomain to authenticate to
groupsSTRING--groupsenumerate domain groups, if a group is specified than its members are enumerated
hashesFILE--hashfile containing NTLM hashes
jitterSTRING--jittersets a random delay between each authentication
mkfileFILE--mkfileDPAPI option. File with masterkeys in form of {GUID}:SHA1
moduleSTRING--modulemodule to use
no-smbBOOLEAN--no-smbNo smb connection
serverSTRING--serveruse the selected server (default: https)
sharesBOOLEAN--sharesenumerate shares and access
spiderSTRING--spidershare to spider
targetSTRING·the target IP, range, CIDR, hostname, or FQDN
aes-keySTRING--aesKeyAES key to use for Kerberos Authentication (128 or 256 bits)
commandSTRING-xexecute the specified command
contentBOOLEAN--contentenable file content searching
dns-tcpBOOLEAN--dns-tcpUse TCP instead of UDP for DNS queries
enabledBOOLEAN--enabledOnly dump enabled targets from DC
get-sidBOOLEAN--get-sidGet domain sid
patternSTRING--patternpattern(s) to search for in folders, filenames and file content
targetsFILE·a list of target IP(s), range(s), CIDR(s), hostname(s), FQDN(s), NMap XML or .Nessus file(s)'
threadsSTRING--threadsset how many concurrent threads to use
timeoutSTRING--timeoutmax timeout in seconds of each thread
verboseBOOLEAN--verboseenable verbose output
kerberosBOOLEAN--kerberosUse Kerberos authentication
pass-polBOOLEAN--pass-poldump password policy
passwordSTRING--passwordpassword
protocolSTRING·the network protocol to assess (available protocols: ldap, mssql, smb, wmi, ssh, vnc, ftp, winrm, rdp)
sessionsBOOLEAN--sessionsenumerate active sessions
usernameSTRING--usernameusername
computersSTRING--computersenumerate computer user
passwordsFILE--passwordfile containing passwords
usernamesFILE--usernamefile containing usernames
bloodhoundBOOLEAN--bloodhoundPerform a Bloodhound scan
collectionSTRING--collectionWhich information to collect. Supported: Group, LocalAdmin, Session, Trusts, Default, DCOnly, DCOM, RDP, PSRemote, LoggedOn, Container, ObjectProps, ACL, All. You can specify more than one by separating them with a comma (default: Default)
dns-serverSTRING--dns-serverSpecify DNS server (default: Use hosts file & System DNS)
force-ps32BOOLEAN--force-ps32Force the PowerShell command to run in a 32-bit process via a job; WARNING: depends on the job completing quickly, so you may have to increase the timeout
interfacesBOOLEAN--interfacesenumerate network interfaces
local-authBOOLEAN--local-authauthenticate locally to each target
only-filesBOOLEAN--only-filesonly spider files
use-kcacheBOOLEAN--use-kcacheUse Kerberos authentication from ccache file (KRB5CCNAME)
admin-countBOOLEAN--admin-countGet objets that had the value adminCount=1
amsi-bypassFILE--amsi-bypassFile with a custom AMSI bypass
dns-timeoutSTRING--dns-timeoutDNS query timeout in seconds
dump-methodSTRING--dump-methodSelect shell type in hashes dump (default: cmd) (cmd,powershell)
exec-methodSTRING--exec-methodmethod to execute the command. Ignored if in MSSQL mode (default: wmiexec) (smbexec,wmiexec,atexec,mmcexec)
no-progressBOOLEAN--no-progressdo not displaying progress bar during scan
server-hostSTRING--server-hostIP to bind the server to (default: 0.0.0.0)
server-portSTRING--server-portstart the server on the specified port
active-usersSTRING--active-usersGet Active Domain Users Accounts
dcom-timeoutSTRING--dcom-timeoutDCOM connection timeout (default: 5)
exclude-dirsSTRING--exclude-dirsdirectories to exclude from spidering
list-modulesBOOLEAN--list-moduleslist available modules
local-groupsSTRING--local-groupsenumerate local groups, if a group is specified then its members are enumerated
filter-sharesSTRING--filter-sharesFilter share by access, option 'read' 'write' or 'read,write'
mssql-timeoutSTRING--mssql-timeoutSQL server connection timeout (default: 5)
no-bruteforceBOOLEAN--no-bruteforceNo spray when using file for username and password (user1 => password1, user2 => password2)
rid-brute-maxSTRING--rid-brutespecify max RID to enumerate users by bruteforcing RIDs
spider-folderSTRING--spider-folderfolder to spider (default: .)
wmi-namespaceSTRING--wmi-namespaceWMI Namespace (default: root\cimv2)
loggedon-usersBOOLEAN--loggedon-usersenumerate logged on users
module-optionsSTRING-omodule options
no-write-checkBOOLEAN--no-write-checkSkip write check on shares (avoid leaving traces when missing delete permissions)
gmsa-convert-idSTRING--gmsa-convert-idGet the secret name of specific gmsa or all gmsa if no gmsa provided
host-fail-limitSTRING--fail-limitmax number of failed login attempts per host
connectback-hostSTRING--connectback-hostIP for the remote system to connect back to
get-output-triesSTRING--get-output-triesNumber of times atexec/smbexec/mmcexec tries to get results (default: 10)
gmsa-decrypt-lsaSTRING--gmsa-decrypt-lsaDecrypt the gmsa encrypted value from LSA
global-fail-limitSTRING--gfail-limitmax number of global failed login attempts
no-command-outputBOOLEAN--no-outputdo not retrieve command output
ignore-pw-decodingBOOLEAN--ignore-pw-decodingIgnore non UTF-8 characters when decoding the password file
powershell-commandSTRING-Xexecute the specified PowerShell command
continue-on-successBOOLEAN--continue-on-successcontinues authentication attempts even after successes
username-fail-limitSTRING--ufail-limitmax number of failed login attempts per username
no-powershell-encodeBOOLEAN--no-encodeDo not encode the PowerShell command ran on target
obfuscate-powershellBOOLEAN--obfsObfuscate PowerShell ran on target; WARNING: Defender will almost certainly trigger on this
disply-module-optionsBOOLEAN--optionsdisplay module options
loggedon-users-filterSTRING--loggedon-users-filteronly search for specific user, works with regex
password-not-requiredBOOLEAN--password-not-requiredGet the list of users with flag PASSWD_NOTREQD
trusted-for-delegationBOOLEAN--trusted-for-delegationGet the list of users and computers with flag TRUSTED_FOR_DELEGATION
domain-controllers-listBOOLEAN--dc-listEnumerate Domain Controllers
clear-obfuscated-scriptsBOOLEAN--clear-obfscriptsClear all cached obfuscated PowerShell scripts
kerberos-domain-controller-hostSTRING--kdcHostFQDN of the domain controller. If omitted it will use the domain part (FQDN) specified in the target parameter

example

Run netexec

netexec · command
# netexec: SMB share enum with password auth against a lab hostnxc smb 198.51.100.10 -u analyst -p 'ExamplePass1!' -d EXAMPLE --shares
sample output
SMB         198.51.100.10    445    DC01             [*] Windows Server 2019 Build 17763 x64 (name:DC01) (domain:EXAMPLE) (signing:True) (SMBv1:False)SMB         198.51.100.10    445    DC01             [+] EXAMPLE\analyst:ExamplePass1!SMB         198.51.100.10    445    DC01             [*] Enumerated sharesSMB         198.51.100.10    445    DC01             Share           Permissions     RemarkSMB         198.51.100.10    445    DC01             -----           -----------     ------SMB         198.51.100.10    445    DC01             ADMIN$          READ,WRITE      Remote AdminSMB         198.51.100.10    445    DC01             C$              READ,WRITE      Default shareSMB         198.51.100.10    445    DC01             IPC$            READ            IPC ServiceSMB         198.51.100.10    445    DC01             NETLOGON        READ            Logon server shareSMB         198.51.100.10    445    DC01             SYSVOL          READ            Logon server share

guidance

Choosing netexec

Use netexec when you have network access plus credentials or hashes and need to enumerate or assess many hosts over one service protocol. It is not a discovery scanner. Find live hosts first, then scope a single protocol per run.

medusa

Parallel login brute forcer across many protocols. netexec adds AD enumeration, dumping, and command execution on top of credential testing.

hydra

Network login cracker focused on auth guessing. netexec pairs spraying with post-auth enumeration and modules.

nuclei

Template-based vulnerability scanner. netexec focuses on authenticated network-service access rather than web checks.

faq

netexec questions

LDAP, MSSQL, SMB, WMI, SSH, VNC, FTP, WinRM, and RDP. Pass the protocol as a positional argument; the rest of the flags adapt to it.

Run netexec yourself

A target list feeds naabu to find live SMB hosts, then netexec authenticates and enumerates them before the results land as a queryable output.

Facts on this page come from the live Trickest tool library.