Execution of Persistent Suspicious Program

Identifies execution of suspicious persistent programs (scripts, rundll32, etc.) by looking at process lineage and command line usage.

Elastic rule (View on GitHub)

 1[metadata]
 2creation_date = "2020/11/19"
 3integration = ["endpoint", "windows"]
 4maturity = "production"
 5updated_date = "2024/05/21"
 6
 7[rule]
 8author = ["Elastic"]
 9description = """
10Identifies execution of suspicious persistent programs (scripts, rundll32, etc.) by looking at process lineage and
11command line usage.
12"""
13from = "now-9m"
14index = ["winlogbeat-*", "logs-endpoint.events.process-*", "logs-windows.sysmon_operational-*", "endgame-*"]
15language = "eql"
16license = "Elastic License v2"
17name = "Execution of Persistent Suspicious Program"
18risk_score = 47
19rule_id = "e7125cea-9fe1-42a5-9a05-b0792cf86f5a"
20severity = "medium"
21tags = [
22    "Domain: Endpoint",
23    "OS: Windows",
24    "Use Case: Threat Detection",
25    "Tactic: Persistence",
26    "Data Source: Elastic Endgame",
27    "Data Source: Elastic Defend",
28    "Data Source: Sysmon",
29]
30type = "eql"
31
32query = '''
33/* userinit followed by explorer followed by early child process of explorer (unlikely to be launched interactively) within 1m */
34sequence by host.id, user.name with maxspan=1m
35  [process where host.os.type == "windows" and event.type == "start" and process.name : "userinit.exe" and process.parent.name : "winlogon.exe"]
36  [process where host.os.type == "windows" and event.type == "start" and process.name : "explorer.exe"]
37  [process where host.os.type == "windows" and event.type == "start" and process.parent.name : "explorer.exe" and
38   /* add suspicious programs here */
39   process.pe.original_file_name in ("cscript.exe",
40                                     "wscript.exe",
41                                     "PowerShell.EXE",
42                                     "MSHTA.EXE",
43                                     "RUNDLL32.EXE",
44                                     "REGSVR32.EXE",
45                                     "RegAsm.exe",
46                                     "MSBuild.exe",
47                                     "InstallUtil.exe") and
48    /* add potential suspicious paths here */
49    process.args : ("C:\\Users\\*", "C:\\ProgramData\\*", "C:\\Windows\\Temp\\*", "C:\\Windows\\Tasks\\*", "C:\\PerfLogs\\*", "C:\\Intel\\*")
50   ]
51'''
52
53
54[[rule.threat]]
55framework = "MITRE ATT&CK"
56[[rule.threat.technique]]
57id = "T1547"
58name = "Boot or Logon Autostart Execution"
59reference = "https://attack.mitre.org/techniques/T1547/"
60[[rule.threat.technique.subtechnique]]
61id = "T1547.001"
62name = "Registry Run Keys / Startup Folder"
63reference = "https://attack.mitre.org/techniques/T1547/001/"
64
65
66
67[rule.threat.tactic]
68id = "TA0003"
69name = "Persistence"
70reference = "https://attack.mitre.org/tactics/TA0003/"

Related rules

to-top