Detection rules › Elastic
Suspicious Binary Execution via Path Alias
Detects execution of binaries through the /proc/self/root procfs path alias. This technique resolves to the filesystem root through procfs and can bypass path-based denylists or security controls that match on canonical paths like /usr/bin/. An AI coding agent (Claude Code) was observed using this technique autonomously to evade its own permission denylist without any adversarial prompting. This is also a general defense evasion technique usable by any process.
MITRE ATT&CK coverage
| Tactic | Techniques |
|---|---|
| Stealth |
Rule body
[rule]
description = """
Detects execution of binaries through the /proc/self/root procfs path alias. This technique resolves to the filesystem
root through procfs and can bypass path-based denylists or security controls that match on canonical paths like
/usr/bin/. An AI coding agent (Claude Code) was observed using this technique autonomously to evade its own permission
denylist without any adversarial prompting. This is also a general defense evasion technique usable by any process.
"""
id = "5b95dcac-7e0a-4f3c-ab4b-a94cf84d793e"
license = "Elastic License v2"
name = "Suspicious Binary Execution via Path Alias"
os_list = ["linux"]
reference = [
"https://awesomeagents.ai/news/claude-code-sandbox-escape-denylist/",
"https://man7.org/linux/man-pages/man5/proc.5.html",
]
version = "1.0.5"
query = '''
process where event.type == "start" and event.action == "exec" and
(
process.executable like "/proc/*/root/*" or
process.args regex """/proc/(self|[0-9]{1,7})/root/[a-z].*"""
) and
not (
process.args like ("/proc/*/root/etc/*", "/proc/1/root/var/lib/rancher/*", "/proc/1/root/var/lib/cni/*", "cat", "readlink", "ls") or
process.executable == "./opt/spire/bin/spire-server" or
process.parent.command_line == "runc init" or
(process.executable == "/usr/bin/slirp4netns" and process.parent.executable == "/usr/bin/rootlesskit")
)
'''
min_endpoint_version = "7.15.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 = "T1036"
name = "Masquerading"
reference = "https://attack.mitre.org/techniques/T1036/"
[[threat.technique.subtechnique]]
id = "T1036.005"
name = "Match Legitimate Resource Name or Location"
reference = "https://attack.mitre.org/techniques/T1036/005/"
[threat.tactic]
id = "TA0005"
name = "Defense Evasion"
reference = "https://attack.mitre.org/tactics/TA0005/"
[internal]
min_endpoint_version = "7.15.0"
Stages and Predicates
Stage 1: process
process where event.type == "start" and event.action == "exec" and
(
process.executable like "/proc/*/root/*" or
process.args regex """/proc/(self|[0-9]{1,7})/root/[a-z].*"""
) and
not (
process.args like ("/proc/*/root/etc/*", "/proc/1/root/var/lib/rancher/*", "/proc/1/root/var/lib/cni/*", "cat", "readlink", "ls") or
process.executable == "./opt/spire/bin/spire-server" or
process.parent.command_line == "runc init" or
(process.executable == "/usr/bin/slirp4netns" and process.parent.executable == "/usr/bin/rootlesskit")
)
Exclusions
The rule actively suppresses these predicates.
| Field | Kind | Excluded values | Search |
|---|---|---|---|
process.executable | eq | /usr/bin/slirp4netns | excludes:process.executable field:"process.executable" value:"/usr/bin/slirp4netns" |
process.parent.executable | eq | /usr/bin/rootlesskit | excludes:process.parent.executable field:"process.parent.executable" value:"/usr/bin/rootlesskit" |
process.args | wildcard | /proc/*/root/etc/*, /proc/1/root/var/lib/rancher/*, /proc/1/root/var/lib/cni/*, cat, readlink, ls | excludes:process.args |
process.executable | eq | ./opt/spire/bin/spire-server | excludes:process.executable field:"process.executable" value:"./opt/spire/bin/spire-server" |
process.parent.command_line | eq | runc init | excludes:process.parent.command_line field:"process.parent.command_line" value:"runc init" |
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 | regex_match |
| field:"process.args" kind:regex_match value:"/proc/(self|[0-9]{1,7})/root/[a-z].*" |
process.executable | wildcard |
| field:"Image" kind:wildcard value:"/proc/*/root/*" |