Detection rules › Elastic
Suspicious XPC Service Child Process
Detects an abnormal child process of a XPC service running from a suspicious location.
MITRE ATT&CK coverage
Rule body
[rule]
description = "Detects an abnormal child process of a XPC service running from a suspicious location."
id = "fdb36c69-9a1d-4ab3-863d-91b3301b6c6d"
license = "Elastic License v2"
name = "Suspicious XPC Service Child Process"
os_list = ["macos"]
reference = [
"https://attack.mitre.org/techniques/T1559/003/",
"https://attack.mitre.org/techniques/T1059/004/",
"https://objective-see.org/blog/blog_0x59.html",
]
version = "1.0.27"
query = '''
process where event.type == "start" and process.parent.name : "com.*" and
((process.name in ("bash", "sh", "zsh") and process.args == "-c") or
process.name like~ ("curl", "nscurl", "osascript", "python*", "tclsh*")) and not
process.executable like "/Applications/*" and not
process.parent.executable like~
("/Applications/*",
"/Library/PrivilegedHelperTools/*",
"/System/*",
"/private/var/db/com.apple.xpc.*",
"/private/var/folders/*/*/*/AppTranslocation/*",
"/Library/Application Support/AvastHUB/com.avast.hub.app/Contents/Helpers/com.avast.hub.worker",
"/Library/Application Support/Symantec/Silo/MES/LiveUpdate/com.symantec.SymLUHelper",
"/Library/Application Support/Symantec/Silo/NFM/LiveUpdate/com.symantec.SymLUHelper",
"/Library/Application Support/AvastSecureLine/components/update/com.avast.osx.secureline.update-agent",
"/Library/Application Support/CatoNetworks/com.catonetworks.mac.CatoClient.helper.app/Contents/MacOS/com.catonetworks.mac.CatoClient.helper",
"/usr/libexec/*",
"/Library/SystemExtensions/*") and not
process.parent.name like~ ("com.docker.*", "com.todyl.SGNWatchDog") and not
process.command_line like~ ("sh -c /bin/cp /Library/Preferences/SystemConfiguration/preferences.plist /Library/Preferences/SystemConfiguration/preferences.plist.old",
"/bin/sh -c git-upload-pack*", "*sh -c */Library/Application Support/HmaProVpn/hub/userinit.sh*") and
not process.Ext.effective_parent.executable == "/Library/Application Support/PasswordManager/com.trendmicro.consumer.pwmsvc" and
not (process.parent.code_signature.trusted == true and process.parent.code_signature.exists == true) and
not (
process.parent.executable == "/Library/AppQuest/com.apple.questd" and
process.Ext.effective_parent.executable == "/usr/bin/sudo"
)
'''
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 = "T1059"
name = "Command and Scripting Interpreter"
reference = "https://attack.mitre.org/techniques/T1059/"
[[threat.technique.subtechnique]]
id = "T1059.004"
name = "Unix Shell"
reference = "https://attack.mitre.org/techniques/T1059/004/"
[[threat.technique]]
id = "T1559"
name = "Inter-Process Communication"
reference = "https://attack.mitre.org/techniques/T1559/"
[[threat.technique.subtechnique]]
id = "T1559.003"
name = "XPC Services"
reference = "https://attack.mitre.org/techniques/T1559/003/"
[threat.tactic]
id = "TA0002"
name = "Execution"
reference = "https://attack.mitre.org/tactics/TA0002/"
[internal]
min_endpoint_version = "8.11.0"
Stages and Predicates
Stage 1: process
process where event.type == "start" and process.parent.name : "com.*" and
((process.name in ("bash", "sh", "zsh") and process.args == "-c") or
process.name like~ ("curl", "nscurl", "osascript", "python*", "tclsh*")) and not
process.executable like "/Applications/*" and not
process.parent.executable like~
("/Applications/*",
"/Library/PrivilegedHelperTools/*",
"/System/*",
"/private/var/db/com.apple.xpc.*",
"/private/var/folders/*/*/*/AppTranslocation/*",
"/Library/Application Support/AvastHUB/com.avast.hub.app/Contents/Helpers/com.avast.hub.worker",
"/Library/Application Support/Symantec/Silo/MES/LiveUpdate/com.symantec.SymLUHelper",
"/Library/Application Support/Symantec/Silo/NFM/LiveUpdate/com.symantec.SymLUHelper",
"/Library/Application Support/AvastSecureLine/components/update/com.avast.osx.secureline.update-agent",
"/Library/Application Support/CatoNetworks/com.catonetworks.mac.CatoClient.helper.app/Contents/MacOS/com.catonetworks.mac.CatoClient.helper",
"/usr/libexec/*",
"/Library/SystemExtensions/*") and not
process.parent.name like~ ("com.docker.*", "com.todyl.SGNWatchDog") and not
process.command_line like~ ("sh -c /bin/cp /Library/Preferences/SystemConfiguration/preferences.plist /Library/Preferences/SystemConfiguration/preferences.plist.old",
"/bin/sh -c git-upload-pack*", "*sh -c */Library/Application Support/HmaProVpn/hub/userinit.sh*") and
not process.Ext.effective_parent.executable == "/Library/Application Support/PasswordManager/com.trendmicro.consumer.pwmsvc" and
not (process.parent.code_signature.trusted == true and process.parent.code_signature.exists == true) and
not (
process.parent.executable == "/Library/AppQuest/com.apple.questd" and
process.Ext.effective_parent.executable == "/usr/bin/sudo"
)
Exclusions
The rule actively suppresses these predicates.
| Field | Kind | Excluded values | Search |
|---|---|---|---|
process.Ext.effective_parent.executable | eq | /usr/bin/sudo | excludes:process.Ext.effective_parent.executable field:"process.Ext.effective_parent.executable" value:"/usr/bin/sudo" |
process.parent.executable | eq | /Library/AppQuest/com.apple.questd | excludes:process.parent.executable field:"process.parent.executable" value:"/Library/AppQuest/com.apple.questd" |
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.Ext.effective_parent.executable | eq | /Library/Application Support/PasswordManager/com.trendmicro.consumer.pwmsvc | excludes:process.Ext.effective_parent.executable field:"process.Ext.effective_parent.executable" value:"/Library/Application Support/PasswordManager/com.trendmicro.consumer.pwmsvc" |
process.command_line | wildcard | sh -c /bin/cp /Library/Preferences/SystemConfiguration/preferences.plist /Library/Preferences/SystemConfiguration/preferences.plist.old, /bin/sh -c git-upload-pack*, *sh -c */Library/Application Support/HmaProVpn/hub/userinit.sh* | excludes:process.command_line field:"process.command_line" value:"sh -c /bin/cp /Library/Preferences/SystemConfiguration/preferences.plist /Library/Preferences/SystemConfiguration/preferences.plist.old" field:"process.command_line" value:"/bin/sh -c git-upload-pack*" field:"process.command_line" value:"*sh -c */Library/Application Support/HmaProVpn/hub/userinit.sh*" |
process.executable | starts_with | /Applications/ | excludes:process.executable field:"process.executable" value:"/Applications/" |
process.parent.executable | wildcard | /Applications/*, /Library/PrivilegedHelperTools/*, /System/*, /private/var/db/com.apple.xpc.*, /private/var/folders/*/*/*/AppTranslocation/*, /Library/Application Support/AvastHUB/com.avast.hub.app/Contents/Helpers/com.avast.hub.worker, /Library/Application Support/Symantec/Silo/MES/LiveUpdate/com.symantec.SymLUHelper, /Library/Application Support/Symantec/Silo/NFM/LiveUpdate/com.symantec.SymLUHelper, /Library/Application Support/AvastSecureLine/components/update/com.avast.osx.secureline.update-agent, /Library/Application Support/CatoNetworks/com.catonetworks.mac.CatoClient.helper.app/Contents/MacOS/com.catonetworks.mac.CatoClient.helper, /usr/libexec/*, /Library/SystemExtensions/* | excludes:process.parent.executable |
process.parent.name | wildcard | com.docker.*, com.todyl.SGNWatchDog | excludes:process.parent.name field:"process.parent.name" value:"com.docker.*" field:"process.parent.name" value:"com.todyl.SGNWatchDog" |
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
event.type | eq |
| field:"event.type" kind:eq value:"start" |
process.args | eq |
| field:"process.args" kind:eq value:"-c" |
process.name | in |
| field:"process_name" kind:in |
process.name | wildcard |
| field:"process_name" kind:wildcard |
process.parent.name | wildcard |
| field:"parent_process_name" kind:wildcard value:"com.*" |