Detection rules › Elastic
Suspicious PrivilegedHelperTool Activity
Detects the potential abuse of a PrivilegedHelperTool by triggering on the execution of specific system binaries where the parent process is a privilegedhelpertool. This activity is not normal or common and could indicate a privilegedhelpertool exploitation bypass attempt. PrivilegedHelperTools are sometimes targeted via injection and XPC manipulation to bypass macOS security controls in order to elevate privileges, establish privileged persistence, or execute commands as a privileged user.
MITRE ATT&CK coverage
| Tactic | Techniques |
|---|---|
| Privilege Escalation |
Telemetry coverage
Rule body
[rule]
description = """
Detects the potential abuse of a PrivilegedHelperTool by triggering on the execution of specific system binaries where
the parent process is a privilegedhelpertool. This activity is not normal or common and could indicate a
privilegedhelpertool exploitation bypass attempt. PrivilegedHelperTools are sometimes targeted via injection and XPC
manipulation to bypass macOS security controls in order to elevate privileges, establish privileged persistence, or
execute commands as a privileged user.
"""
id = "900fdb84-2a81-4a6d-88db-b48a0fafd79e"
license = "Elastic License v2"
name = "Suspicious PrivilegedHelperTool Activity"
os_list = ["macos"]
reference = ["https://wojciechregula.blog/post/bypass-tcc-via-privileged-helpers-aka-cve-2020-10008/"]
version = "1.0.27"
query = '''
process where event.type == "start" and
event.action == "exec" and user.name == "root" and
process.parent.executable like "/Library/PrivilegedHelperTools/*" and
(
/* shell and common lolbins */
(((process.name like~ ("bash", "zsh", "sh", "tclsh*") and process.args == "-c" and process.args like~ ("/tmp/*",
"*/bin/curl *",
"*/bin/nscurl*",
"*/bin/osascript *",
"*/bin/python*",
"osascript*",
"python*",
"curl*")) or
process.name like~ ("python*", "tclsh*", "osascript", "osacompile", "curl", "nscurl", "wget", "tccd")) and not
process.command_line like~ ("*remove*", "*unload*", "*/Library/Application Support/JAMF/Composer/Sources/*", "*https://www.google.com*")) or
/* unsigned or untrusted macO */
(process.code_signature.exists == false or process.code_signature.trusted == false)
) and not
process.executable like ("/Library/PrivilegedHelperTools/*", "/Applications/*") and not
process.parent.executable == "/Library/PrivilegedHelperTools/com.kaseya.VSAHelper" and not
(process.parent.code_signature.trusted == true and process.parent.code_signature.exists == true)
'''
min_endpoint_version = "8.11.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 = "T1068"
name = "Exploitation for Privilege Escalation"
reference = "https://attack.mitre.org/techniques/T1068/"
[threat.tactic]
id = "TA0004"
name = "Privilege Escalation"
reference = "https://attack.mitre.org/tactics/TA0004/"
[internal]
min_endpoint_version = "8.11.0"
Stages and Predicates
Stage 1: process
process where event.type == "start" and
event.action == "exec" and user.name == "root" and
process.parent.executable like "/Library/PrivilegedHelperTools/*" and
(
(((process.name like~ ("bash", "zsh", "sh", "tclsh*") and process.args == "-c" and process.args like~ ("/tmp/*",
"*/bin/curl *",
"*/bin/nscurl*",
"*/bin/osascript *",
"*/bin/python*",
"osascript*",
"python*",
"curl*")) or
process.name like~ ("python*", "tclsh*", "osascript", "osacompile", "curl", "nscurl", "wget", "tccd")) and not
process.command_line like~ ("*remove*", "*unload*", "*/Library/Application Support/JAMF/Composer/Sources/*", "*https://www.google.com*")) or
(process.code_signature.exists == false or process.code_signature.trusted == false)
) and not
process.executable like ("/Library/PrivilegedHelperTools/*", "/Applications/*") and not
process.parent.executable == "/Library/PrivilegedHelperTools/com.kaseya.VSAHelper" and not
(process.parent.code_signature.trusted == true and process.parent.code_signature.exists == true)
Exclusions
The rule actively suppresses these predicates.
| Field | Kind | Excluded values | Search |
|---|---|---|---|
process.parent.code_signature.exists | eq | true | excludes:process.parent.code_signature.exists field:"process.parent.code_signature.exists" value:"true" |
process.parent.code_signature.trusted | eq | true | excludes:process.parent.code_signature.trusted field:"process.parent.code_signature.trusted" value:"true" |
process.executable | starts_with | /Library/PrivilegedHelperTools/, /Applications/ | excludes:process.executable field:"process.executable" value:"/Library/PrivilegedHelperTools/" field:"process.executable" value:"/Applications/" |
process.parent.executable | eq | /Library/PrivilegedHelperTools/com.kaseya.VSAHelper | excludes:process.parent.executable field:"process.parent.executable" value:"/Library/PrivilegedHelperTools/com.kaseya.VSAHelper" |
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
event.action | eq |
| field:"EventType" kind:eq value:"exec" |
event.type | eq |
| field:"event.type" kind:eq value:"start" |
process.args | eq |
| field:"process.args" kind:eq value:"-c" |
process.args | wildcard |
| field:"process.args" kind:wildcard |
process.code_signature.exists | eq |
| field:"process.code_signature.exists" kind:eq value:"false" |
process.code_signature.trusted | eq |
| field:"process.code_signature.trusted" kind:eq value:"false" |
process.name | wildcard |
| field:"process_name" kind:wildcard |
process.parent.executable | wildcard |
| field:"ParentImage" kind:wildcard value:"/Library/PrivilegedHelperTools/*" |
user.name | eq |
| field:"user" kind:eq value:"root" |