Symbolic Link to Shadow Copy Created

Identifies the creation of symbolic links to a shadow copy. Symbolic links can be used to access files in the shadow copy, including sensitive files such as ntds.dit, System Boot Key and browser offline credentials.

Elastic rule (View on GitHub)

 1[metadata]
 2creation_date = "2021/12/25"
 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", "Austin Songer"]
11description = """
12Identifies the creation of symbolic links to a shadow copy. Symbolic links can be used to access files in the shadow
13copy, including sensitive files such as ntds.dit, System Boot Key and browser offline credentials.
14"""
15false_positives = ["Legitimate administrative activity related to shadow copies."]
16from = "now-9m"
17index = ["winlogbeat-*", "logs-endpoint.events.process-*", "logs-windows.*", "endgame-*", "logs-system.security*"]
18language = "eql"
19license = "Elastic License v2"
20name = "Symbolic Link to Shadow Copy Created"
21note = """## Triage and analysis
22
23### Investigating Symbolic Link to Shadow Copy Created
24
25Shadow copies are backups or snapshots of an endpoint's files or volumes while they are in use. Adversaries may attempt to discover and create symbolic links to these shadow copies in order to copy sensitive information offline. If Active Directory (AD) is in use, often the ntds.dit file is a target as it contains password hashes, but an offline copy is needed to extract these hashes and potentially conduct lateral movement.
26
27#### Possible investigation steps
28
29- Identify the user account that performed the action and whether it should perform this kind of action.
30- Investigate the process 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.
31- Investigate other alerts associated with the user/host during the past 48 hours.
32- Determine if a volume shadow copy was recently created on this endpoint.
33- Review privileges of the end user as this requires administrative access.
34- Verify if the ntds.dit file was successfully copied and determine its copy destination.
35- Investigate for registry SYSTEM file copies made recently or saved via Reg.exe.
36- Investigate recent deletions of volume shadow copies.
37- Identify other files potentially copied from volume shadow copy paths directly.
38
39### False positive analysis
40
41- This rule should cause very few false positives. Benign true positives (B-TPs) can be added as exceptions if necessary.
42
43### Related rules
44
45- NTDS or SAM Database File Copied - 3bc6deaa-fbd4-433a-ae21-3e892f95624f
46
47### Response and remediation
48
49- Initiate the incident response process based on the outcome of the triage.
50- 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.
51- If the entire domain or the `krbtgt` user was compromised:
52  - Activate your incident response plan for total Active Directory compromise which should include, but not be limited to, a password reset (twice) of the `krbtgt` user.
53- Locate and remove static files copied from volume shadow copies.
54- Command-Line tool mklink should require administrative access by default unless in developer mode.
55- Run a full antimalware scan. This may reveal additional artifacts left in the system, persistence mechanisms, and malware components.
56- Determine the initial vector abused by the attacker and take action to prevent reinfection through the same vector.
57- 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).
58"""
59references = [
60    "https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/mklink",
61    "https://2017.zeronights.org/wp-content/uploads/materials/ZN17_Kheirkhabarov_Hunting_for_Credentials_Dumping_in_Windows_Environment.pdf",
62    "https://blog.netwrix.com/2021/11/30/extracting-password-hashes-from-the-ntds-dit-file/",
63    "https://www.hackingarticles.in/credential-dumping-ntds-dit/",
64]
65risk_score = 47
66rule_id = "d117cbb4-7d56-41b4-b999-bdf8c25648a0"
67setup = """## Setup
68
69Ensure advanced audit policies for Windows are enabled, specifically:
70Object Access policies [Event ID 4656](https://docs.microsoft.com/en-us/windows/security/threat-protection/auditing/event-4656) (Handle to an Object was Requested)

Computer Configuration > Policies > Windows Settings > Security Settings > Advanced Audit Policies Configuration > System Audit Policies > Object Access > Audit File System (Success,Failure) Audit Handle Manipulation (Success,Failure)

 1
 2This event will only trigger if symbolic links are created from a new process spawning cmd.exe or powershell.exe with the correct arguments.
 3Direct access to a shell and calling symbolic link creation tools will not generate an event matching this rule.
 4
 5If enabling an EQL rule on a non-elastic-agent index (such as beats) for versions <8.2,
 6events will not define `event.ingested` and default fallback for EQL rules was not added until version 8.2.
 7Hence for this rule to work effectively, users will need to add a custom ingest pipeline to populate
 8`event.ingested` to @timestamp.
 9For more details on adding a custom ingest pipeline refer - https://www.elastic.co/guide/en/fleet/current/data-streams-pipeline-tutorial.html
10"""
11severity = "medium"
12tags = [
13    "Domain: Endpoint",
14    "OS: Windows",
15    "Use Case: Threat Detection",
16    "Tactic: Credential Access",
17    "Resources: Investigation Guide",
18    "Data Source: Elastic Endgame",
19    "Data Source: Elastic Defend"
20]
21timestamp_override = "event.ingested"
22type = "eql"
23
24query = '''
25process where host.os.type == "windows" and event.type == "start" and
26 (
27    (?process.pe.original_file_name in ("Cmd.Exe","PowerShell.EXE")) or
28    (process.name : ("cmd.exe", "powershell.exe"))
29 ) and
30
31 /* Create Symbolic Link to Shadow Copies */
32 process.args : ("*mklink*", "*SymbolicLink*") and process.command_line : ("*HarddiskVolumeShadowCopy*")
33'''
34
35
36[[rule.threat]]
37framework = "MITRE ATT&CK"
38[[rule.threat.technique]]
39id = "T1003"
40name = "OS Credential Dumping"
41reference = "https://attack.mitre.org/techniques/T1003/"
42[[rule.threat.technique.subtechnique]]
43id = "T1003.002"
44name = "Security Account Manager"
45reference = "https://attack.mitre.org/techniques/T1003/002/"
46
47[[rule.threat.technique.subtechnique]]
48id = "T1003.003"
49name = "NTDS"
50reference = "https://attack.mitre.org/techniques/T1003/003/"
51
52
53[rule.threat.tactic]
54id = "TA0006"
55name = "Credential Access"
56reference = "https://attack.mitre.org/tactics/TA0006/"

Triage and analysis

Shadow copies are backups or snapshots of an endpoint's files or volumes while they are in use. Adversaries may attempt to discover and create symbolic links to these shadow copies in order to copy sensitive information offline. If Active Directory (AD) is in use, often the ntds.dit file is a target as it contains password hashes, but an offline copy is needed to extract these hashes and potentially conduct lateral movement.

Possible investigation steps

  • Identify the user account that performed the action and whether it should perform this kind of action.
  • Investigate the process 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 a volume shadow copy was recently created on this endpoint.
  • Review privileges of the end user as this requires administrative access.
  • Verify if the ntds.dit file was successfully copied and determine its copy destination.
  • Investigate for registry SYSTEM file copies made recently or saved via Reg.exe.
  • Investigate recent deletions of volume shadow copies.
  • Identify other files potentially copied from volume shadow copy paths directly.

False positive analysis

  • This rule should cause very few false positives. Benign true positives (B-TPs) can be added as exceptions if necessary.
  • NTDS or SAM Database File Copied - 3bc6deaa-fbd4-433a-ae21-3e892f95624f

Response and remediation

  • Initiate the incident response process based on the outcome of the triage.
  • 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.
  • If the entire domain or the krbtgt user was compromised:
    • Activate your incident response plan for total Active Directory compromise which should include, but not be limited to, a password reset (twice) of the krbtgt user.
  • Locate and remove static files copied from volume shadow copies.
  • Command-Line tool mklink should require administrative access by default unless in developer mode.
  • 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