Potential Remote Credential Access via Registry

Identifies remote access to the registry to potentially dump credential data from the Security Account Manager (SAM) registry hive in preparation for credential access and privileges elevation.

Elastic rule (View on GitHub)

  1[metadata]
  2creation_date = "2022/03/01"
  3integration = ["endpoint"]
  4maturity = "production"
  5min_stack_comments = "New fields added: required_fields, related_integrations, setup"
  6min_stack_version = "8.3.0"
  7updated_date = "2023/10/23"
  8
  9[rule]
 10author = ["Elastic"]
 11description = """
 12Identifies remote access to the registry to potentially dump credential data from the Security Account Manager (SAM)
 13registry hive in preparation for credential access and privileges elevation.
 14"""
 15from = "now-9m"
 16index = ["logs-endpoint.events.*"]
 17language = "eql"
 18license = "Elastic License v2"
 19name = "Potential Remote Credential Access via Registry"
 20note = """## Triage and analysis
 21
 22### Investigating Potential Remote Credential Access via Registry
 23
 24Dumping registry hives is a common way to access credential information. Some hives store credential material, such as the SAM hive, which stores locally cached credentials (SAM secrets), and the SECURITY hive, which stores domain cached credentials (LSA secrets). Dumping these hives in combination with the SYSTEM hive enables the attacker to decrypt these secrets.
 25
 26Attackers can use tools like secretsdump.py or CrackMapExec to dump the registry hives remotely, and use dumped credentials to access other systems in the domain.
 27
 28#### Possible investigation steps
 29
 30- Identify the specifics of the involved assets, such as their role, criticality, and associated users.
 31- Identify the user account that performed the action and whether it should perform this kind of action.
 32- Determine the privileges of the compromised accounts.
 33- Investigate other alerts associated with the user/source host during the past 48 hours.
 34- Investigate potentially compromised accounts. Analysts can do this by searching for login events (e.g., 4624) to the target host.
 35
 36### False positive analysis
 37
 38- This activity is unlikely to happen legitimately. Any activity that triggered the alert and is not inherently malicious must be monitored by the security team.
 39
 40### Related rules
 41
 42- Credential Acquisition via Registry Hive Dumping - a7e7bfa3-088e-4f13-b29e-3986e0e756b8
 43
 44### Response and remediation
 45
 46- Initiate the incident response process based on the outcome of the triage.
 47- Isolate the involved hosts to prevent further post-compromise behavior.
 48- 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.
 49- Determine if other hosts were compromised.
 50- Run a full antimalware scan. This may reveal additional artifacts left in the system, persistence mechanisms, and malware components.
 51- Reimage the host operating system or restore the compromised files to clean versions.
 52- Ensure that the machine has the latest security updates and is not running unsupported Windows versions.
 53- 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).
 54
 55"""
 56references = [
 57    "https://github.com/SecureAuthCorp/impacket/blob/master/examples/secretsdump.py",
 58    "https://www.elastic.co/security-labs/detect-credential-access",
 59]
 60risk_score = 73
 61rule_id = "850d901a-2a3c-46c6-8b22-55398a01aad8"
 62setup="""
 63
 64This rule uses Elastic Endpoint file creation and system integration events for correlation. Both data should be collected from the host for this detection to work.
 65
 66If enabling an EQL rule on a non-elastic-agent index (such as beats) for versions <8.2,
 67events will not define `event.ingested` and default fallback for EQL rules was not added until version 8.2.
 68Hence for this rule to work effectively, users will need to add a custom ingest pipeline to populate
 69`event.ingested` to @timestamp.
 70For more details on adding a custom ingest pipeline refer - https://www.elastic.co/guide/en/fleet/current/data-streams-pipeline-tutorial.html
 71"""
 72severity = "high"
 73tags = [
 74    "Domain: Endpoint",
 75    "OS: Windows",
 76    "Use Case: Threat Detection",
 77    "Tactic: Lateral Movement",
 78    "Tactic: Credential Access",
 79    "Resources: Investigation Guide",
 80    "Data Source: Elastic Defend"
 81]
 82timestamp_override = "event.ingested"
 83type = "eql"
 84
 85query = '''
 86file where host.os.type == "windows" and
 87  event.action == "creation" and process.name : "svchost.exe" and
 88  file.Ext.header_bytes : "72656766*" and user.id : ("S-1-5-21-*", "S-1-12-1-*") and file.size >= 30000 and
 89  file.path : ("?:\\Windows\\system32\\*.tmp", "?:\\WINDOWS\\Temp\\*.tmp")
 90'''
 91
 92
 93[[rule.threat]]
 94framework = "MITRE ATT&CK"
 95[[rule.threat.technique]]
 96id = "T1003"
 97name = "OS Credential Dumping"
 98reference = "https://attack.mitre.org/techniques/T1003/"
 99[[rule.threat.technique.subtechnique]]
100id = "T1003.002"
101name = "Security Account Manager"
102reference = "https://attack.mitre.org/techniques/T1003/002/"
103
104
105
106[rule.threat.tactic]
107id = "TA0006"
108name = "Credential Access"
109reference = "https://attack.mitre.org/tactics/TA0006/"
110[[rule.threat]]
111framework = "MITRE ATT&CK"
112[[rule.threat.technique]]
113id = "T1021"
114name = "Remote Services"
115reference = "https://attack.mitre.org/techniques/T1021/"
116
117
118[rule.threat.tactic]
119id = "TA0008"
120name = "Lateral Movement"
121reference = "https://attack.mitre.org/tactics/TA0008/"

Triage and analysis

Investigating Potential Remote Credential Access via Registry

Dumping registry hives is a common way to access credential information. Some hives store credential material, such as the SAM hive, which stores locally cached credentials (SAM secrets), and the SECURITY hive, which stores domain cached credentials (LSA secrets). Dumping these hives in combination with the SYSTEM hive enables the attacker to decrypt these secrets.

Attackers can use tools like secretsdump.py or CrackMapExec to dump the registry hives remotely, and use dumped credentials to access other systems in the domain.

Possible investigation steps

  • Identify the specifics of the involved assets, such as their role, criticality, and associated users.
  • Identify the user account that performed the action and whether it should perform this kind of action.
  • Determine the privileges of the compromised accounts.
  • Investigate other alerts associated with the user/source host during the past 48 hours.
  • Investigate potentially compromised accounts. Analysts can do this by searching for login events (e.g., 4624) to the target host.

False positive analysis

  • This activity is unlikely to happen legitimately. Any activity that triggered the alert and is not inherently malicious must be monitored by the security team.
  • Credential Acquisition via Registry Hive Dumping - a7e7bfa3-088e-4f13-b29e-3986e0e756b8

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.
  • Determine if other hosts were compromised.
  • Run a full antimalware scan. This may reveal additional artifacts left in the system, persistence mechanisms, and malware components.
  • Reimage the host operating system or restore the compromised files to clean versions.
  • Ensure that the machine has the latest security updates and is not running unsupported Windows versions.
  • 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