Skip to content

Commit 1574222

Browse files
Aegrahtradebot-elastic
authored andcommitted
[New Rule] Proxy Shell Execution via Busybox (#5348)
* [New Rule] Proxy Shell Execution via Busybox * Update defense_evasion_busybox_indirect_shell_spawn.toml (cherry picked from commit 726b3c4)
1 parent a29cf1f commit 1574222

File tree

1 file changed

+107
-0
lines changed

1 file changed

+107
-0
lines changed
Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
[metadata]
2+
creation_date = "2025/11/20"
3+
integration = ["endpoint"]
4+
maturity = "production"
5+
updated_date = "2025/11/20"
6+
7+
[rule]
8+
author = ["Elastic"]
9+
description = """
10+
Detects the execution of a shell through Busybox. Attackers may use this technique to execute shells while attempting to
11+
evade detection.
12+
"""
13+
from = "now-9m"
14+
index = ["logs-endpoint.events.process*"]
15+
language = "eql"
16+
license = "Elastic License v2"
17+
name = "Proxy Shell Execution via Busybox"
18+
references = ["https://gtfobins.github.io/gtfobins/busybox/"]
19+
risk_score = 21
20+
rule_id = "5134be90-42c1-4ac7-859c-4d82caaddbec"
21+
setup = """## Setup
22+
23+
This rule requires data coming in from Elastic Defend.
24+
25+
### Elastic Defend Integration Setup
26+
Elastic Defend is integrated into the Elastic Agent using Fleet. Upon configuration, the integration allows the Elastic Agent to monitor events on your host and send data to the Elastic Security app.
27+
28+
#### Prerequisite Requirements:
29+
- Fleet is required for Elastic Defend.
30+
- To configure Fleet Server refer to the [documentation](https://www.elastic.co/guide/en/fleet/current/fleet-server.html).
31+
32+
#### The following steps should be executed in order to add the Elastic Defend integration on a Linux System:
33+
- Go to the Kibana home page and click "Add integrations".
34+
- In the query bar, search for "Elastic Defend" and select the integration to see more details about it.
35+
- Click "Add Elastic Defend".
36+
- Configure the integration name and optionally add a description.
37+
- Select the type of environment you want to protect, either "Traditional Endpoints" or "Cloud Workloads".
38+
- Select a configuration preset. Each preset comes with different default settings for Elastic Agent, you can further customize these later by configuring the Elastic Defend integration policy. [Helper guide](https://www.elastic.co/guide/en/security/current/configure-endpoint-integration-policy.html).
39+
- We suggest selecting "Complete EDR (Endpoint Detection and Response)" as a configuration setting, that provides "All events; all preventions"
40+
- Enter a name for the agent policy in "New agent policy name". If other agent policies already exist, you can click the "Existing hosts" tab and select an existing policy instead.
41+
For more details on Elastic Agent configuration settings, refer to the [helper guide](https://www.elastic.co/guide/en/fleet/8.10/agent-policy.html).
42+
- Click "Save and Continue".
43+
- To complete the integration, select "Add Elastic Agent to your hosts" and continue to the next section to install the Elastic Agent on your hosts.
44+
For more details on Elastic Defend refer to the [helper guide](https://www.elastic.co/guide/en/security/current/install-endpoint.html).
45+
"""
46+
severity = "low"
47+
tags = [
48+
"Domain: Endpoint",
49+
"OS: Linux",
50+
"Use Case: Threat Detection",
51+
"Tactic: Defense Evasion",
52+
"Tactic: Execution",
53+
"Data Source: Elastic Defend",
54+
]
55+
timestamp_override = "event.ingested"
56+
type = "eql"
57+
query = '''
58+
process where host.os.type == "linux" and event.type == "start" and event.action == "exec" and process.parent.name == "busybox" and
59+
process.name in ("bash", "dash", "sh", "tcsh", "csh", "zsh", "ksh", "fish") and
60+
process.command_line in ("bash", "bash-", "dash", "sh", "tcsh", "csh", "zsh", "ksh", "fish") and
61+
not (
62+
process.args == "-c" or
63+
process.parent.args : (
64+
"crond", "/usr/sbin/crond", "/local-registrator.sh", "/var/atlassian/application-data/bamboo-agent*"
65+
) or
66+
process.parent.command_line in (
67+
"sh /readonly-config/fix-split-brain.sh",
68+
"/bin/sh -c /health-check.sh || bash -c 'kill -s 15 $(pidof siridb-server) && (sleep 10; kill -s 9 $(pidof siridb-server))'"
69+
) or
70+
process.command_line == "bash /etc/kafka/docker/run" or
71+
process.parent.command_line like (
72+
"/bin/sh -c apk add*", "/bin/sh -c crm-cron-enabled*", "udhcpc -n -p /run/udhcpc.*", "flock -x*"
73+
) or
74+
process.working_directory == "/usr/share/grafana"
75+
)
76+
'''
77+
78+
[[rule.threat]]
79+
framework = "MITRE ATT&CK"
80+
81+
[rule.threat.tactic]
82+
name = "Defense Evasion"
83+
id = "TA0005"
84+
reference = "https://attack.mitre.org/tactics/TA0005/"
85+
86+
[[rule.threat.technique]]
87+
id = "T1218"
88+
name = "System Binary Proxy Execution"
89+
reference = "https://attack.mitre.org/techniques/T1218/"
90+
91+
[[rule.threat]]
92+
framework = "MITRE ATT&CK"
93+
94+
[rule.threat.tactic]
95+
name = "Execution"
96+
id = "TA0002"
97+
reference = "https://attack.mitre.org/tactics/TA0002/"
98+
99+
[[rule.threat.technique]]
100+
id = "T1059"
101+
name = "Command and Scripting Interpreter"
102+
reference = "https://attack.mitre.org/techniques/T1059/"
103+
104+
[[rule.threat.technique.subtechnique]]
105+
name = "Unix Shell"
106+
id = "T1059.004"
107+
reference = "https://attack.mitre.org/techniques/T1059/004/"

0 commit comments

Comments
 (0)