Detect Reversible Encryption in Sumo Logic CSE
Adversaries may enable the AllowReversiblePasswordEncryption property on Active Directory user accounts to gain access to plaintext credentials. When enabled, Active Directory stores user passwords in a reversibly encrypted form (G$RADIUSCHAP in userParameters) rather than as one-way hashes. An adversary with SYSTEM access can decrypt these passwords using four components from AD user structures and LSA secrets. Adversaries can set this via PowerShell (Set-ADUser -AllowReversiblePasswordEncryption $true), Local Group Policy, or Fine-Grained Password Policy (FGPP) if Domain Functional Level is Windows Server 2008+.
MITRE ATT&CK
- Technique
- T1556 Modify Authentication Process
- Sub-technique
- T1556.005 Reversible Encryption
- Canonical reference
- https://attack.mitre.org/techniques/T1556/005/
Sumo Detection Query
// Detection 1: Security Event 4738 with reversible encryption flag
(_sourceCategory=*windows* OR _sourceCategory=*winlogbeat* OR _sourceCategory=*wineventlog*)
| where EventID = "4738"
| parse regex "(?i)UserAccountControl[^:]*:\s*(?<UAC_Changes>[^\n]+)" nodrop
| parse regex "(?i)AllowReversiblePasswordEncryption\s*:\s*(?<ReversibleEncValue>\S+)" nodrop
| parse regex "%%(?<UAC_Flag>2054|2056)" nodrop
| where !isNull(UAC_Flag) OR !isNull(ReversibleEncValue)
| eval ReversibleEnabled = if(UAC_Flag = "2054", "ENABLED", "REVIEW")
| fields _messagetime, _sourceHost, TargetUserName, TargetDomainName, SubjectUserName, SubjectDomainName, ReversibleEnabled, UAC_Flag, UAC_Changes
// Detection 2: PowerShell cmdlets enabling reversible encryption (union via separate search)
// Run separately and merge results:
(_sourceCategory=*windows* OR _sourceCategory=*sysmon*)
| where EventID = "1" OR EventID = "4688"
| where (Image matches "*powershell.exe" OR Image matches "*pwsh.exe"
OR NewProcessName matches "*powershell.exe")
| where CommandLine matches "*AllowReversiblePasswordEncryption*"
OR CommandLine matches "*ENCRYPTED_TEXT_PASSWORD_ALLOWED*"
OR (CommandLine matches "*Set-ADUser*" AND CommandLine matches "*true*")
OR (CommandLine matches "*Set-ADDefaultDomainPasswordPolicy*" AND CommandLine matches "*true*")
OR (CommandLine matches "*New-ADFineGrainedPasswordPolicy*" AND CommandLine matches "*true*")
| fields _messagetime, _sourceHost, User, Image, CommandLine Sumo Logic CSE query detecting reversible password encryption enablement via Windows Security Event 4738 (UserAccountControl change with %%2054 flag) and PowerShell process creation events invoking AD cmdlets to set AllowReversiblePasswordEncryption.
Data Sources
Required Tables
False Positives & Tuning
- RADIUS or NPS server configurations that require reversible encryption to support MS-CHAPv2 authentication for wireless or VPN endpoints
- IT automation or configuration management tools (Ansible, DSC) running PowerShell to apply or validate AD password policy templates
- Security auditing tools that enumerate AD objects and their UserAccountControl flags as part of routine compliance checks
Other platforms for T1556.005
Testing Methodology
Validate this detection against 3 adversary techniques from Atomic Red Team. Each test below lists the behaviour to exercise and the telemetry you should expect to see. Executable commands and cleanup steps are available with Pro.
- Test 1Enable Reversible Password Encryption on a Test Account
Expected signal: Security Event ID 4738: User Account Changed for testuser_atomic, with UserAccountControl value showing ENCRYPTED_TEXT_PASSWORD_ALLOWED. PowerShell ScriptBlock Log Event ID 4104 with the Set-ADUser command. Sysmon Event ID 1 for powershell.exe with AllowReversiblePasswordEncryption in CommandLine.
- Test 2Audit Accounts with Reversible Encryption Enabled
Expected signal: PowerShell ScriptBlock Log Event ID 4104 with the Get-ADUser filter query. Active Directory query events. Security Event ID 4662 for directory object access on enumerated user objects.
- Test 3Set Reversible Encryption via Fine-Grained Password Policy
Expected signal: Security Event ID 4738/5136 (DS Object Modified): Fine-Grained Password Policy object creation with msDS-PasswordReversibleEncryptionEnabled attribute set. PowerShell ScriptBlock Log Event ID 4104 with New-ADFineGrainedPasswordPolicy.
References (5)
- https://attack.mitre.org/techniques/T1556/005/
- https://docs.microsoft.com/en-us/windows/security/threat-protection/security-policy-settings/store-passwords-using-reversible-encryption
- https://adsecurity.org/?p=2053
- http://blog.teusink.net/2009/08/passwords-stored-using-reversible.html
- https://github.com/redcanaryco/atomic-red-team/blob/master/atomics/T1556.005/T1556.005.md
Unlock Pro Content
Get the full detection package for T1556.005 including response playbook, investigation guide, and atomic red team tests.