LogoLogo
NetExec Github
  • Welcome
  • News
    • 🕷️v1.0.0 Release!
    • 🔧v1.1.0 - nxc4u
    • 📡v1.2.0 - ItsAlwaysDNS
    • 🏎️v1.3.0 - NeedForSpeed
    • 🧈v1.4.0 - SmoothOperator
  • Logo & Banner
  • Getting Started
    • Installation
      • 🐧Installation for Unix
      • 🪟Installation for Windows
      • 🍎Installation for Mac
      • 🛠️Manually building the binary
      • ➡️Post Installation Setup
    • Selecting & Using a Protocol
    • Target Formats
    • Using Credentials
    • Using Kerberos
    • Using Certificates
    • Using Modules
    • 🆕DNS options
    • Database General Usage
    • BloodHound Integration
    • Audit Mode
    • Ignore OpSec Warnings
    • Logging
  • SMB protocol
    • Generate hosts file
    • Generate krb5.conf file
    • Generate TGT
    • Scan for Vulnerabilities
    • Enumeration
      • Enumerate Hosts
      • Enumerate Null Sessions
      • Enumerate Guest Logon
      • Enumerate Hosts with SMB Signing Not Required
      • Enumerate Active SMB Sessions
      • Enumerate Shares and Access
      • 🆕Enumerate Network Interfaces
      • Enumerate Disks
      • Enumerate Bitlocker
      • Enumerate Logged on Users
      • Enumerate Domain Users
      • Enumerate Users by Bruteforcing RID
      • Enumerate Domain Groups
      • Enumerate Local Groups
      • Enumerate Domain Password Policy
      • 🆕Enumerate Anti-Virus & EDR
    • Password Spraying
    • Authentication
      • Checking Credentials (Domain)
      • Checking Credentials (Local)
      • 🆕Delegation
    • Command Execution
      • Executing Remote Commands
        • Process Injection (pi module)
      • Getting Shells 101
    • Spidering Shares
    • Get and Put Files
    • Obtaining Credentials
      • Dump SAM
      • Dump LSA
      • Dump NTDS.dit
      • Dump LSASS
      • Dump DPAPI
      • 🆕Dump with BackupOperator Priv
      • 🆕Dump SCCM
      • 🆕Dump Token Broker Cache
      • Dump WIFI password
      • Dump KeePass
      • Dump Veeam
      • Dump WinSCP
      • 🆕Dump PuTTY
      • 🆕Dump VNC
      • 🆕Dump mRemoteNG
      • 🆕Dump Notepad
      • 🆕Dump Notepad++
      • 🆕Dump Remote Desktop Credential Manager
    • Defeating LAPS
    • Checking for Spooler & WebDav
    • Steal Microsoft Teams Cookies
    • 🆕Impersonate logged-on Users
    • 🆕Change User Password
    • 🆕Dump User Local Security Questions
  • LDAP protocol
    • Authentication
    • Enumerate Domain Users
    • Enumerate Domain Groups
    • 🆕Query LDAP
    • ASREPRoast
    • Find Domain SID
    • Kerberoasting
    • 🆕Find Misconfigured Delegation
    • Unconstrained Delegation
    • Admin Count
    • Machine Account Quota
    • Get User Descriptions
    • Dump gMSA
    • Exploit ESC8 (ADCS)
    • Extract Subnet
    • 🛠️Check LDAP Signing
    • Read DACL Rights
    • Extract gMSA Secrets
    • Bloodhound Ingestor
    • List DC IP
    • Enumerate Domain Trusts
    • 🆕Enumerate SCCM
  • WINRM protocol
    • Password Spraying
    • Authentication
    • Command Execution
    • 🆕Defeating LAPS
  • MSSQL protocol
    • Password Spraying
    • Authentication
    • MSSQL PrivEsc
    • MSSQL Command Execution
    • MSSQL Upload & Download
    • Execute via xp_cmdshell
    • 🆕Enumerate Users by Bruteforcing RID
  • SSH protocol
    • Password Spraying
    • Authentication
    • Command Execution
    • Get and Put Files
  • FTP protocol
    • Password Spraying
    • 🆕File Listing, etc
    • 🆕File Upload & Download
  • RDP Protocol
    • Password Spraying
    • Screenshot (connected)
    • Screenshot Without NLA (not connected)
  • WMI Protocol
    • Password Spraying
    • Authentication
    • Command Execution
  • NFS Protocol
    • 🆕Enumeration
    • Download and Upload Files
    • 🆕Escape to root file system
Powered by GitBook
On this page
  • Using Credentials
  • Using a Credential Set From the Database
  • Multi-Domain Environment
  • Brute Forcing & Password Spraying
  • Password Spraying Without Bruteforce
  • Throttling Authentication Requests

Was this helpful?

Edit on GitHub
  1. Getting Started

Using Credentials

Using credentials with NetExec

PreviousTarget FormatsNextUsing Kerberos

Last updated 16 days ago

Was this helpful?

Using Credentials

Every protocol supports using credentials in one form or another. For details on using credentials with a specific protocol, see the appropriate wiki section.

Generally speaking, to use credentials, you can run the following commands:

nxc <protocol> <target(s)> -u username -p password

Code execution results in a (Pwn3d!) added after the login confirmation. With the SMB protocol, your compromised users are most likely in the local administrators group.

Protocol
See Pwn3d! in output

FTP

No check

SSH

WINRM

LDAP

SMB

RDP

VNC

WMI

When using usernames or passwords that contain special symbols (especially exclaimation points!), wrap them in single quotes to make sure your shell interprets them as a string.

Example:

nxc <protocol> <target(s)> -u username -p 'October2022!'

Due to a in Python's argument parsing library, credentials beginning with a dash (-) will throw an expected at least one argument error message. To get around this, specify the credentials by using the 'long' argument format (note the = sign):

nxc <protocol> <target(s)> -u='-username' -p='-October2022'

Using a Credential Set From the Database

By specifying a credential ID (or multiple credential IDs) with the -id flag, nxc will automatically pull that credential from the back-end database and use it to authenticate (saves a lot of typing):

nxc <protocol> <target(s)> -id <cred ID(s)>

Multi-Domain Environment

You can use nxc with mulitple domain environment

nxc <protocol> <target(s)> -u FILE -p password

Where FILE is a file with usernames in this format

DOMAIN1\user
DOMAIN2\user

Brute Forcing & Password Spraying

All protocols support brute-forcing and password spraying. For details on brute-forcing/password spraying with a specific protocol, see the appropriate wiki section.

By specifying a file or multiple values nxc will automatically brute-force logins for all targets using the specified protocol:

Examples:

nxc <protocol> <target(s)> -u username1 -p password1 password2
nxc <protocol> <target(s)> -u username1 username2 -p password1
nxc <protocol> <target(s)> -u ~/file_containing_usernames -p ~/file_containing_passwords
nxc <protocol> <target(s)> -u ~/file_containing_usernames -H ~/file_containing_ntlm_hashes

Password Spraying Without Bruteforce

Can be useful for protocols like WinRM and MSSQL. This option avoids bruteforcing when you use files (-u file -p file).

nxc <protocol> <target(s)> -u ~/file_containing_usernames -H ~/file_containing_ntlm_hashes --no-bruteforce
nxc <protocol> <target(s)> -u ~/file_containing_usernames -p ~/file_containing_passwords --no-bruteforce
user1 -> pass1
user2 -> pass2

By default nxc will exit after a successful login is found. Using the --continue-on-success flag will continue spraying even after a valid password is found. Useful for spraying a single password against a large user list. The --continue-on-success flag is incompatible with command execution.

nxc <protocol> <target(s)> -u ~/file_containing_usernames -H ~/file_containing_ntlm_hashes --no-bruteforce --continue-on-success

Throttling Authentication Requests

Authentication throttling works on a per-host basis! Keep this in mind if you are spraying credentials against multiple hosts.

If there is a need to throttle authentications during brute forcing, you can use the jitter functionality. The length of the timeout (in seconds) between requests is randomly selected from an interval unless otherwise specified. If you want to hardcode the timeout, set the upper and lower bounds of the interval to the same value. The syntax is as follows:

nxc <protocol> <target> --jitter 3 -u ~/file_containing_usernames -p ~/file_containing_passwords
nxc <protocol> <target> --jitter 2-5 -u ~/file_containing_usernames -p ~/file_containing_passwords
nxc <protocol> <target> --jitter 4-4 -u ~/file_containing_usernames -p ~/file_containing_passwords

root (otherwise specific message)

Code execution at least

Path to domain admin

Most likely local admin

Code execution at least

Code execution at least

Most likely local admin

bug
✅
👾
👑
✅
👾
👾
✅