HOST/fileserver01.corp.local — where the hostname in the SPN (fileserver01.corp.local) no longer has a DNS record. The machine was probably decommissioned, but the SPN was never cleaned up.
This matters for NTLM relay because when a client authenticates to a service by SPN, the SPN’s hostname resolves to an IP address in DNS. If that DNS record does not exist, an attacker who controls DNS can register it, point it to a listener, receive the NTLM authentication, and relay it elsewhere.
This detection is inspired by the GhostSPN tool by p0dalirius.
When it runs
Ghost SPN detection only runs in--audit mode when credentials are present. It queries Active Directory via LDAP for all registered SPNs, then attempts to resolve each hostname via DNS.
Ghost SPN detection is skipped when
--null-auth is used because it requires an authenticated LDAP bind to query SPNs. It also requires --audit mode to have an AD target. Pass --no-ghosts to skip the check entirely even in --audit mode.Two finding categories
RelayKing splits Ghost SPN findings into two categories:Vulnerable
The hostname in the SPN resolves nowhere — no A record, no CNAME, no response from any configured DNS server. An attacker can register this exact DNS name and immediately begin receiving NTLM authentication from any client that tries to reach that SPN.Probably vulnerable
The hostname resolves, but only via a wildcard DNS record (a catch-all* entry in the zone). Wildcard DNS means the hostname is technically reachable, but an attacker who can create a more-specific DNS record for that hostname would override the wildcard and intercept traffic. This category requires an additional step to exploit.
Severity
MEDIUM — exploitation requires DNS write access (typically a low-privilege AD account can create DNS records in the default zone) and a listener to receive and relay the authentication.Output
RelayKing limits the report to up to 5 findings to keep output manageable. The full set of findings — all vulnerable and probably-vulnerable SPNs — is always written topossible-ghost-spns.txt in the current working directory.
Flags
| Flag | Behavior |
|---|---|
(none — runs automatically in --audit mode) | Ghost SPN check runs after the host scan completes |
--no-ghosts | Skip Ghost SPN detection entirely |
Example commands
What a finding means operationally
If you find a Ghost SPN with no DNS record:- Confirm you have DNS write access (most low-privilege AD accounts can create records in the default forward lookup zone).
- Create an A record pointing the missing hostname to your listener IP.
- Run
ntlmrelayx.pyorresponderon your listener to capture the incoming NTLM authentication. - Relay the captured credentials to a relay-vulnerable target (LDAP, SMB, etc.).
