Auth detection
Thedetect_auth() function probes the domain controller to determine which authentication protocols are available:
network_info.auth_method. Port 88 (Kerberos) and ports 135/445 (NTLM via RPC and SMB) are checked.
NTLM credential helpers
Two helper functions normalise NTLM credential handling across all scan modules:is_hash()
Detects whether a string is an NTLM hash rather than a plaintext password:
get_auth_flag()
Returns the correct netexec flag based on whether the credential is a hash or password:
-p password and -H ntlmhash in every netexec command.
Kerberos ccache authentication
Acquiring a TGT
ThePOST /api/kerberos/acquire-tgt endpoint obtains a TGT from the KDC using impacket-getTGT:
Sync time with DC
Kerberos requires clocks to be within 5 minutes of the KDC. The endpoint first runs
sudo ntpdate -u <dc_ip> to prevent clock skew errors:Locate the getTGT binary
The binary is probed in order of preference:
impacket-getTGT (system PATH), then the venv entry-point, then /usr/bin/ and /usr/local/bin/, then finally as a Python module (python3 -m impacket.examples.getTGT).Run getTGT
The command is run from the ccache directory so the output file lands in the right place:The ccache file is named
username.ccache.Time synchronisation
Thesync_time_with_dc() async helper handles clock synchronisation independently of TGT acquisition. It is also called by prepare_ccache_auth() before any authenticated scan that uses an existing ccache:
Parsing a ccache file
Theparse_ccache_principal() function extracts the identity stored in a ccache using klist:
Using ccache in authenticated scans
When a scan is configured to use a ccache file, the backend passes--use-kcache to netexec instead of a username/password. The target must be specified by DC hostname (not IP address), because the Kerberos ticket is issued for the hostname and will be rejected if the IP does not match the service principal.
The DC hostname is automatically pulled from
network_info.dc_host when ccache auth is selected. If the DC hostname field is blank, scans will fail — fill it in via the Network Info bar.ccache file locations
| Source | Location |
|---|---|
TGTs acquired via the UI (/api/kerberos/acquire-tgt) | recon/ccache/<username>.ccache |
| Manually placed ccache files | recon/ccache/*.ccache |
| Pre2K computer ccaches | Copied from ~/.nxc/modules/pre2k/ccache/ into recon/ccache/ |
Pre2K ccache copy
When a Pre-Windows 2000 computer account TGT is obtained by the Pre2K scan, theparse_pre2k_output() function automatically copies all .ccache files from the netexec module’s output directory into recon/ccache/:
prepare_ccache_auth() unified helper
All scan endpoints that accept a ccache use prepare_ccache_auth() to perform the two prerequisite steps in one call: