GPP/cPassword Attacks

Overview

Group Policy Preferences (GPP) attacks exploit a critical vulnerability where Microsoft accidentally released the encryption key used to protect passwords stored in Group Policy XML files. This allows attackers to decrypt stored credentials and gain access to privileged accounts.

Background

What are Group Policy Preferences?

  • GPP: Feature that allowed administrators to create policies using embedded credentials

  • Purpose: Automate password changes, local account management, drive mappings, etc.

  • Problem: Credentials were encrypted and placed in a "cPassword" field

  • Critical Flaw: The encryption key was accidentally released by Microsoft

The cPassword Vulnerability

  • Vulnerability: Microsoft published the AES encryption key in MSDN documentation

  • Impact: Anyone can decrypt cPassword values found in Group Policy files

  • Patch: Fixed in MS14-025 (May 2014) - prevents creation of new cPassword entries

  • Reality: Patch doesn't remove existing GPP files from SYSVOL

  • Status: STILL RELEVANT ON PENTESTS - old files persist in domain environments

GPP File Structure

Common GPP Files in SYSVOL

Example Groups.xml Structure

Key Fields in GPP Files

Field
Description
Example Value

TYPE

GPP file type

Groups.xml

USERNAME

Account username

new_local_admin

PASSWORD

Encrypted password (cPassword)

Ju9qmLzQeH61Nrqk/bbEB1CfOFVqOIGOUevB4wAvOng

DOMAIN CONTROLLER

DC IP/hostname

10.x.x.x

DOMAIN

Domain name

penlab.lcl

CHANGED

Last modification

2016-07-12 07:04:23

NEVER_EXPIRES?

Password expiry setting

1 (never expires)

DISABLED

Account status

0 (enabled)

Enumeration Techniques

Method 1: Metasploit smb_enum_gpp

Method 2: Manual SYSVOL Enumeration

Method 3: PowerShell Enumeration

Method 4: Linux Command Line Tools

Manual Decryption

Using gpp-decrypt

PowerShell Decryption Script

Attack Scenarios

Scenario 1: Domain Enumeration via GPP

Scenario 2: Automated Discovery with Metasploit

Scenario 3: Service Account Discovery

Post-Exploitation

Using Discovered Credentials

Persistence and Lateral Movement

Detection and Forensics

Finding GPP Activity

SYSVOL Monitoring

Mitigation Strategies

Technical Mitigations

Administrative Controls

Network Monitoring

PJPT Exam Tips

For the PJPT Exam

  1. GPP attacks are high-yield targets

    • Easy to execute with basic domain access

    • Often reveals privileged credentials

    • Excellent for lateral movement

  2. Use Metasploit for efficiency:

  3. Manual verification is valuable:

  4. Common GPP credential patterns:

    • Local administrator accounts

    • Service account passwords

    • Scheduled task credentials

    • Database connection strings

  5. Post-exploitation priorities:

    • Test credentials across all domain systems

    • Look for admin rights on multiple machines

    • Use for lateral movement and persistence

    • Document credential scope and privileges

  6. Key documentation points:

    • Show GPP file discovery method

    • Include original cpassword and decrypted result

    • Document credential testing and scope

    • Explain impact and lateral movement potential


Note: Always ensure proper authorization before conducting GPP attacks. These techniques should only be used in authorized penetration testing scenarios or controlled lab environments. Remember that while the vulnerability is "patched," legacy GPP files often remain in production environments, making this attack vector still highly relevant.

Last updated