Suspicious Powershell Child Process


Description

Detects when Powershell (pwsh) spawns a highly abnormal or suspicious child process. Powershell usage on macOS is extremely rare but usage of Powershell to spawn a process like curl or osascript is almost always indicative of malicious behavior.

Query · eql

process where event.type == "start" and 
 (process.parent.name == "pwsh" or process.Ext.effective_parent.name == "pwsh") and 
 process.name like~ ("curl", "nscurl", "osascript") and
 not process.args like~ "http://localhost*" and
 not (
    process.parent.code_signature.team_id == "UBF8T346G9" and process.parent.code_signature.trusted == true and
    process.args == "--aws-sigv4" and process.args like~ "aws:amz:*:monitoring" and process.args == "--config"
)
Raw source Suspicious Powershell Child Process · Elastic TOML
Esc
Published by elastic/protections-artifacts ↗, licensed under Elastic License 2.0 ↗. Reproduced here unmodified.
[rule]
description = """
Detects when Powershell (pwsh) spawns a highly abnormal or suspicious child process. Powershell usage on macOS is
extremely rare but usage of Powershell to spawn a process like curl or osascript is almost always indicative of
malicious behavior.
"""
id = "72f9191c-f099-4349-8c73-794b4ee8c4ea"
license = "Elastic License v2"
name = "Suspicious Powershell Child Process"
os_list = ["macos"]
version = "1.0.15"

query = '''
process where event.type == "start" and 
 (process.parent.name == "pwsh" or process.Ext.effective_parent.name == "pwsh") and 
 process.name like~ ("curl", "nscurl", "osascript") and
 not process.args like~ "http://localhost*" and
 not (
    process.parent.code_signature.team_id == "UBF8T346G9" and process.parent.code_signature.trusted == true and
    process.args == "--aws-sigv4" and process.args like~ "aws:amz:*:monitoring" and process.args == "--config"
)
'''

min_endpoint_version = "8.8.0"
optional_actions = []
[[actions]]
action = "kill_process"
field = "process.entity_id"
state = 0

[[actions]]
action = "kill_process"
field = "process.parent.entity_id"
state = 0

[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1059"
name = "Command and Scripting Interpreter"
reference = "https://attack.mitre.org/techniques/T1059/"
[[threat.technique.subtechnique]]
id = "T1059.001"
name = "PowerShell"
reference = "https://attack.mitre.org/techniques/T1059/001/"



[threat.tactic]
id = "TA0002"
name = "Execution"
reference = "https://attack.mitre.org/tactics/TA0002/"

[internal]
min_endpoint_version = "8.8.0"

Detection rules belong to the projects that publish them and remain under their own licenses. This site indexes and links to them; it claims no rights in them.