Lateral Movement via Startup Folder

Identifies suspicious file creations in the startup folder of a remote system. An adversary could abuse this to move laterally by dropping a malicious script or executable that will be executed after a reboot or user logon.

Elastic rule (View on GitHub)

 1[metadata]
 2creation_date = "2020/10/19"
 3integration = ["endpoint", "windows"]
 4maturity = "production"
 5updated_date = "2024/05/21"
 6
 7[rule]
 8author = ["Elastic"]
 9description = """
10Identifies suspicious file creations in the startup folder of a remote system. An adversary could abuse this to move
11laterally by dropping a malicious script or executable that will be executed after a reboot or user logon.
12"""
13from = "now-9m"
14index = ["logs-endpoint.events.file-*", "winlogbeat-*", "logs-windows.sysmon_operational-*", "endgame-*"]
15language = "eql"
16license = "Elastic License v2"
17name = "Lateral Movement via Startup Folder"
18references = ["https://www.mdsec.co.uk/2017/06/rdpinception/"]
19risk_score = 73
20rule_id = "25224a80-5a4a-4b8a-991e-6ab390465c4f"
21setup = """## Setup
22
23If enabling an EQL rule on a non-elastic-agent index (such as beats) for versions <8.2,
24events will not define `event.ingested` and default fallback for EQL rules was not added until version 8.2.
25Hence for this rule to work effectively, users will need to add a custom ingest pipeline to populate
26`event.ingested` to @timestamp.
27For more details on adding a custom ingest pipeline refer - https://www.elastic.co/guide/en/fleet/current/data-streams-pipeline-tutorial.html
28"""
29severity = "high"
30tags = [
31    "Domain: Endpoint",
32    "OS: Windows",
33    "Use Case: Threat Detection",
34    "Tactic: Lateral Movement",
35    "Data Source: Elastic Endgame",
36    "Data Source: Elastic Defend",
37    "Data Source: Sysmon",
38]
39timestamp_override = "event.ingested"
40type = "eql"
41
42query = '''
43file where host.os.type == "windows" and event.type in ("creation", "change") and
44
45 /* via RDP TSClient mounted share or SMB */
46  (process.name : "mstsc.exe" or process.pid == 4) and
47
48   file.path : ("?:\\Users\\*\\AppData\\Roaming\\Microsoft\\Windows\\Start Menu\\Programs\\Startup\\*",
49                "?:\\ProgramData\\Microsoft\\Windows\\Start Menu\\Programs\\Startup\\*")
50'''
51
52
53[[rule.threat]]
54framework = "MITRE ATT&CK"
55[[rule.threat.technique]]
56id = "T1021"
57name = "Remote Services"
58reference = "https://attack.mitre.org/techniques/T1021/"
59[[rule.threat.technique.subtechnique]]
60id = "T1021.001"
61name = "Remote Desktop Protocol"
62reference = "https://attack.mitre.org/techniques/T1021/001/"
63
64
65
66[rule.threat.tactic]
67id = "TA0008"
68name = "Lateral Movement"
69reference = "https://attack.mitre.org/tactics/TA0008/"
70[[rule.threat]]
71framework = "MITRE ATT&CK"
72[[rule.threat.technique]]
73id = "T1547"
74name = "Boot or Logon Autostart Execution"
75reference = "https://attack.mitre.org/techniques/T1547/"
76[[rule.threat.technique.subtechnique]]
77id = "T1547.001"
78name = "Registry Run Keys / Startup Folder"
79reference = "https://attack.mitre.org/techniques/T1547/001/"
80
81
82
83[rule.threat.tactic]
84id = "TA0003"
85name = "Persistence"
86reference = "https://attack.mitre.org/tactics/TA0003/"

References

Related rules

to-top