Outbound Scheduled Task Activity via PowerShell

Identifies the PowerShell process loading the Task Scheduler COM DLL followed by an outbound RPC network connection within a short time period. This may indicate lateral movement or remote discovery via scheduled tasks.

Elastic rule (View on GitHub)

 1[metadata]
 2creation_date = "2020/12/15"
 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/04/08"
 8
 9[rule]
10author = ["Elastic"]
11description = """
12Identifies the PowerShell process loading the Task Scheduler COM DLL followed by an outbound RPC network connection
13within a short time period. This may indicate lateral movement or remote discovery via scheduled tasks.
14"""
15false_positives = ["Legitimate scheduled tasks may be created during installation of new software."]
16from = "now-9m"
17index = ["winlogbeat-*", "logs-endpoint.events.library-*", "logs-endpoint.events.network-*", "logs-windows.sysmon_operational-*"]
18language = "eql"
19license = "Elastic License v2"
20name = "Outbound Scheduled Task Activity via PowerShell"
21references = [
22    "https://www.volexity.com/blog/2020/12/14/dark-halo-leverages-solarwinds-compromise-to-breach-organizations/",
23]
24risk_score = 47
25rule_id = "5cd55388-a19c-47c7-8ec4-f41656c2fded"
26severity = "medium"
27tags = [
28        "Domain: Endpoint",
29        "OS: Windows",
30        "Use Case: Threat Detection",
31        "Tactic: Execution",
32        "Data Source: Elastic Defend",
33        "Data Source: Sysmon"
34        ]
35type = "eql"
36
37query = '''
38sequence by host.id, process.entity_id with maxspan = 5s
39 [any where host.os.type == "windows" and (event.category == "library" or (event.category == "process" and event.action : "Image loaded*")) and
40  (?dll.name : "taskschd.dll" or file.name : "taskschd.dll") and process.name : ("powershell.exe", "pwsh.exe", "powershell_ise.exe")]
41 [network where host.os.type == "windows" and process.name : ("powershell.exe", "pwsh.exe", "powershell_ise.exe") and destination.port == 135 and not destination.address in ("127.0.0.1", "::1")]
42'''
43
44[[rule.threat]]
45framework = "MITRE ATT&CK"
46
47[[rule.threat.technique]]
48id = "T1053"
49name = "Scheduled Task/Job"
50reference = "https://attack.mitre.org/techniques/T1053/"
51
52[[rule.threat.technique.subtechnique]]
53id = "T1053.005"
54name = "Scheduled Task"
55reference = "https://attack.mitre.org/techniques/T1053/005/"
56
57[[rule.threat.technique]]
58id = "T1059"
59name = "Command and Scripting Interpreter"
60reference = "https://attack.mitre.org/techniques/T1059/"
61
62[[rule.threat.technique.subtechnique]]
63id = "T1059.001"
64name = "PowerShell"
65reference = "https://attack.mitre.org/techniques/T1059/001/"
66
67[rule.threat.tactic]
68id = "TA0002"
69name = "Execution"
70reference = "https://attack.mitre.org/tactics/TA0002/"

References

Related rules

to-top