Modification of WDigest Security Provider

Identifies attempts to modify the WDigest security provider in the registry to force the user's password to be stored in clear text in memory. This behavior can be indicative of an adversary attempting to weaken the security configuration of an endpoint. Once the UseLogonCredential value is modified, the adversary may attempt to dump clear text passwords from memory.

Elastic rule (View on GitHub)

  1[metadata]
  2creation_date = "2021/01/19"
  3integration = ["endpoint", "windows"]
  4maturity = "production"
  5min_stack_comments = "New fields added: required_fields, related_integrations, setup"
  6min_stack_version = "8.3.0"
  7updated_date = "2024/03/28"
  8
  9[rule]
 10author = ["Elastic"]
 11description = """
 12Identifies attempts to modify the WDigest security provider in the registry to force the user's password to be stored in
 13clear text in memory. This behavior can be indicative of an adversary attempting to weaken the security configuration of
 14an endpoint. Once the UseLogonCredential value is modified, the adversary may attempt to dump clear text passwords from
 15memory.
 16"""
 17from = "now-9m"
 18index = ["winlogbeat-*", "logs-endpoint.events.registry-*", "logs-windows.sysmon_operational-*", "endgame-*"]
 19language = "eql"
 20license = "Elastic License v2"
 21name = "Modification of WDigest Security Provider"
 22note = """## Triage and analysis
 23
 24### Investigating Modification of WDigest Security Provider
 25
 26In Windows XP, Microsoft added support for a protocol known as WDigest. The WDigest protocol allows clients to send cleartext credentials to Hypertext Transfer Protocol (HTTP) and Simple Authentication Security Layer (SASL) applications based on RFC 2617 and 2831. Windows versions up to 8 and 2012 store logon credentials in memory in plaintext by default, which is no longer the case with newer Windows versions.
 27
 28Still, attackers can force WDigest to store the passwords insecurely on the memory by modifying the `HKLM\\SYSTEM\\*ControlSet*\\Control\\SecurityProviders\\WDigest\\UseLogonCredential` registry key. This activity is commonly related to the execution of credential dumping tools.
 29
 30#### Possible investigation steps
 31
 32- It is unlikely that the monitored registry key was modified legitimately in newer versions of Windows. Analysts should treat any activity triggered from this rule with high priority as it typically represents an active adversary.
 33- Investigate the script execution chain (parent process tree) for unknown processes. Examine their executable files for prevalence, whether they are located in expected locations, and if they are signed with valid digital signatures.
 34- Investigate other alerts associated with the user/host during the past 48 hours.
 35- Determine if credential dumping tools were run on the host, and retrieve and analyze suspicious executables:
 36  - Use a private sandboxed malware analysis system to perform analysis.
 37    - Observe and collect information about the following activities:
 38      - Attempts to contact external domains and addresses.
 39      - File and registry access, modification, and creation activities.
 40      - Service creation and launch activities.
 41      - Scheduled task creation.
 42  - Use the PowerShell Get-FileHash cmdlet to get the files' SHA-256 hash values.
 43    - Search for the existence and reputation of the hashes in resources like VirusTotal, Hybrid-Analysis, CISCO Talos, Any.run, etc.
 44- Use process name, command line, and file hash to search for occurrences on other hosts.
 45- Investigate potentially compromised accounts. Analysts can do this by searching for login events (for example, 4624) to the target host after the registry modification.
 46
 47### False positive analysis
 48
 49- This modification should not happen legitimately. Any potential benign true positive (B-TP) should be mapped and monitored by the security team, as these modifications expose the entire domain to credential compromises and consequently unauthorized access.
 50
 51### Related rules
 52
 53- Mimikatz Powershell Module Activity - ac96ceb8-4399-4191-af1d-4feeac1f1f46
 54
 55### Response and remediation
 56
 57- Initiate the incident response process based on the outcome of the triage.
 58- Isolate the involved hosts to prevent further post-compromise behavior.
 59- Investigate credential exposure on systems compromised or used by the attacker to ensure all compromised accounts are identified. Reset passwords for these accounts and other potentially compromised credentials, such as email, business systems, and web services.
 60- Reimage the host operating system and restore compromised files to clean versions.
 61- Run a full antimalware scan. This may reveal additional artifacts left in the system, persistence mechanisms, and malware components.
 62- Determine the initial vector abused by the attacker and take action to prevent reinfection through the same vector.
 63- Using the incident response data, update logging and audit policies to improve the mean time to detect (MTTD) and the mean time to respond (MTTR).
 64"""
 65references = [
 66    "https://www.csoonline.com/article/3438824/how-to-detect-and-halt-credential-theft-via-windows-wdigest.html",
 67    "https://www.praetorian.com/blog/mitigating-mimikatz-wdigest-cleartext-credential-theft?edition=2019",
 68    "https://frsecure.com/compromised-credentials-response-playbook",
 69    "https://www.elastic.co/security-labs/detect-credential-access",
 70]
 71risk_score = 73
 72rule_id = "d703a5af-d5b0-43bd-8ddb-7a5d500b7da5"
 73setup = """## Setup
 74
 75If enabling an EQL rule on a non-elastic-agent index (such as beats) for versions <8.2,
 76events will not define `event.ingested` and default fallback for EQL rules was not added until version 8.2.
 77Hence for this rule to work effectively, users will need to add a custom ingest pipeline to populate
 78`event.ingested` to @timestamp.
 79For more details on adding a custom ingest pipeline refer - https://www.elastic.co/guide/en/fleet/current/data-streams-pipeline-tutorial.html
 80"""
 81severity = "high"
 82tags = [
 83    "Domain: Endpoint",
 84    "OS: Windows",
 85    "Use Case: Threat Detection",
 86    "Tactic: Credential Access",
 87    "Resources: Investigation Guide",
 88    "Data Source: Elastic Endgame",
 89    "Data Source: Elastic Defend",
 90    "Data Source: Sysmon"
 91]
 92timestamp_override = "event.ingested"
 93type = "eql"
 94
 95query = '''
 96registry where host.os.type == "windows" and event.type : ("creation", "change") and
 97    registry.path : (
 98        "HKLM\\SYSTEM\\*ControlSet*\\Control\\SecurityProviders\\WDigest\\UseLogonCredential",
 99        "\\REGISTRY\\MACHINE\\SYSTEM\\*ControlSet*\\Control\\SecurityProviders\\WDigest\\UseLogonCredential"
100    ) and registry.data.strings : ("1", "0x00000001") and
101    not (process.executable : "?:\\Windows\\System32\\svchost.exe" and user.id : "S-1-5-18")
102'''
103
104
105[[rule.threat]]
106framework = "MITRE ATT&CK"
107[[rule.threat.technique]]
108id = "T1003"
109name = "OS Credential Dumping"
110reference = "https://attack.mitre.org/techniques/T1003/"
111[[rule.threat.technique.subtechnique]]
112id = "T1003.001"
113name = "LSASS Memory"
114reference = "https://attack.mitre.org/techniques/T1003/001/"
115
116
117
118[rule.threat.tactic]
119id = "TA0006"
120name = "Credential Access"
121reference = "https://attack.mitre.org/tactics/TA0006/"

Triage and analysis

Investigating Modification of WDigest Security Provider

In Windows XP, Microsoft added support for a protocol known as WDigest. The WDigest protocol allows clients to send cleartext credentials to Hypertext Transfer Protocol (HTTP) and Simple Authentication Security Layer (SASL) applications based on RFC 2617 and 2831. Windows versions up to 8 and 2012 store logon credentials in memory in plaintext by default, which is no longer the case with newer Windows versions.

Still, attackers can force WDigest to store the passwords insecurely on the memory by modifying the HKLM\SYSTEM\*ControlSet*\Control\SecurityProviders\WDigest\UseLogonCredential registry key. This activity is commonly related to the execution of credential dumping tools.

Possible investigation steps

  • It is unlikely that the monitored registry key was modified legitimately in newer versions of Windows. Analysts should treat any activity triggered from this rule with high priority as it typically represents an active adversary.
  • Investigate the script execution chain (parent process tree) for unknown processes. Examine their executable files for prevalence, whether they are located in expected locations, and if they are signed with valid digital signatures.
  • Investigate other alerts associated with the user/host during the past 48 hours.
  • Determine if credential dumping tools were run on the host, and retrieve and analyze suspicious executables:
    • Use a private sandboxed malware analysis system to perform analysis.
      • Observe and collect information about the following activities:
        • Attempts to contact external domains and addresses.
        • File and registry access, modification, and creation activities.
        • Service creation and launch activities.
        • Scheduled task creation.
    • Use the PowerShell Get-FileHash cmdlet to get the files' SHA-256 hash values.
      • Search for the existence and reputation of the hashes in resources like VirusTotal, Hybrid-Analysis, CISCO Talos, Any.run, etc.
  • Use process name, command line, and file hash to search for occurrences on other hosts.
  • Investigate potentially compromised accounts. Analysts can do this by searching for login events (for example, 4624) to the target host after the registry modification.

False positive analysis

  • This modification should not happen legitimately. Any potential benign true positive (B-TP) should be mapped and monitored by the security team, as these modifications expose the entire domain to credential compromises and consequently unauthorized access.
  • Mimikatz Powershell Module Activity - ac96ceb8-4399-4191-af1d-4feeac1f1f46

Response and remediation

  • Initiate the incident response process based on the outcome of the triage.
  • Isolate the involved hosts to prevent further post-compromise behavior.
  • Investigate credential exposure on systems compromised or used by the attacker to ensure all compromised accounts are identified. Reset passwords for these accounts and other potentially compromised credentials, such as email, business systems, and web services.
  • Reimage the host operating system and restore compromised files to clean versions.
  • Run a full antimalware scan. This may reveal additional artifacts left in the system, persistence mechanisms, and malware components.
  • Determine the initial vector abused by the attacker and take action to prevent reinfection through the same vector.
  • Using the incident response data, update logging and audit policies to improve the mean time to detect (MTTD) and the mean time to respond (MTTR).

References

Related rules

to-top