Credential Acquisition via Registry Hive Dumping

edit

Credential Acquisition via Registry Hive Dumping

edit

Identifies attempts to export a registry hive which may contain credentials using the Windows reg.exe tool.

Rule type: eql

Rule indices:

  • winlogbeat-*
  • logs-endpoint.events.*
  • logs-windows.*

Severity: high

Risk score: 73

Runs every: 5 minutes

Searches indices from: now-9m (Date Math format, see also Additional look-back time)

Maximum alerts per execution: 100

References:

Tags:

  • Elastic
  • Host
  • Windows
  • Threat Detection
  • Credential Access

Version: 5 (version history)

Added (Elastic Stack release): 7.11.0

Last modified (Elastic Stack release): 8.2.0

Rule authors: Elastic

Rule license: Elastic License v2

Investigation guide

edit
## Triage and analysis

### Investigating Credential Acquisition via Registry Hive Dumping

Dumping registry hives is a common way to access credential information as some hives store credential material.

For example, the SAM hive stores locally cached credentials (SAM Secrets), and the SECURITY hive stores domain cached
credentials (LSA secrets).

Dumping these hives in combination with the SYSTEM hive enables the attacker to decrypt these secrets.

This rule identifies the usage of `reg.exe` to dump SECURITY and/or SAM hives, which potentially indicates the
compromise of the credentials stored in the host.

#### Possible investigation steps

- Investigate script execution chain (parent process tree).
- Confirm whether the involved account should perform this kind of operation.
- Investigate other alerts related to the user/host in the last 48 hours.
- Investigate if the file was exfiltrated or processed locally by other tools.
- Scope potentially compromised accounts. Analysts can do this by searching for login events (e.g., 4624) to the target
host.

### False positive analysis

- Administrators can export registry hives for backup purposes using command line tools like `reg.exe`. Check whether
the user is legitamitely performing this kind of activity.

### Related rules

- Registry Hive File Creation via SMB - a4c7473a-5cb4-4bc1-9d06-e4a75adbc494

### 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.
- Scope compromised credentials and disable affected accounts.
- Reset passwords for potentially compromised user and service accounts (Email, services, CRMs, etc.).
- Reimage the host operating system and restore compromised files to clean versions.

## Config

If enabling an EQL rule on a non-elastic-agent index (such as beats) for versions <8.2, events will not define `event.ingested` and default fallback for EQL rules was not added until 8.2, so you will need to add a custom pipeline to populate `event.ingested` to @timestamp for this rule to work.

Rule query

edit
process where event.type in ("start", "process_started") and
process.pe.original_file_name == "reg.exe" and process.args :
("save", "export") and process.args : ("hklm\\sam", "hklm\\security")

Threat mapping

edit

Framework: MITRE ATT&CKTM

Rule version history

edit
Version 5 (8.2.0 release)
  • Formatting only
Version 4 (7.16.0 release)
  • Formatting only
Version 3 (7.12.0 release)
  • Updated query, changed from:

    process where event.type in ("start", "process_started") and
    process.pe.original_file_name == "reg.exe" and process.args :
    ("save", "export") and process.args : ("hklm\\sam", "hklm\\security")
    and not process.parent.executable : "C:\\Program
    Files*\\Rapid7\\Insight
    Agent\\components\\insight_agent\\*\\ir_agent.exe"
Version 2 (7.11.2 release)
  • Updated query, changed from:

    process where event.type in ("start", "process_started") and
    process.pe.original_file_name == "reg.exe" and process.args :
    ("save", "export") and process.args : ("hklm\\sam", "hklm\\security")
    and not process.parent.executable : "C:\\Program
    Files*\\Rapid7\\Insight
    Agent\\components\\insight_agent\\*\\ir_agent.exe"