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