# GPP attacks

Group Policy Preferences (GPP) are a powerful tool that once allowed administrators to create domain policies with embedded credentials. These policies allowed administrators to set local accounts, embed credentials for the purposes of mapping drives, or perform other tasks that may otherwise require an embedded password in a script.

While a useful tool, the storage mechanism for the credentials was flawed and allowed attackers to trivially decrypt the plaintext credentials. While addressed in MS14-025, this patch only prevents new policies from being created, and any legacy GPPs containing credentials must be found and removed.

Often, these kinds of policies can involve service accounts that frequently have elevated privileges. And one of these methods to find those credz is mining SYSVOL for credential data.

SYSVOL is the domain-wide share in Active Directory to which all authenticated users have read access. SYSVOL contains logon scripts, group policy data, and other domain-wide data which needs to be available anywhere there is a Domain Controller (since SYSVOL is automatically synchronized and shared among all Domain Controllers).

All domain Group Policies are stored here: \\\\\<DOMAIN>\SYSVOL\\\<DOMAIN>\Policies\\

Now off to the hack, you can use a module called **smb\_enum\_gpp** in metasploit to find the group.xml file

```
use auxiliary/scanner/smb/smb_enum_gpp
```

the output should look something like this :

![](/files/-M1BZux_Y7ez9iv7sV8h)

Even without Metasploit, one can extract the cpassword value from the files on SYSVOL and pass them to the gpp-decrypt; so for example you can use :

```
smbclient \\\\ip_addr\\share
mget * (to get all the policies)
```

cracking with gpp-decrypt :

```
gpp-decrypt hash
```

For more information :

{% embed url="<https://adsecurity.org/?p=2288>" %}

{% embed url="<https://blog.rapid7.com/2016/07/27/pentesting-in-the-real-world-group-policy-pwnage/>" %}


---

# Agent Instructions: 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:

```
GET https://xedex.gitbook.io/internalpentest/internal-pentest/active-directory/post-compromise-attacks/gpp-attacks.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
