Linux Restricted Shell Breakout via busybox Shell Evasion

Identifies Linux binary busybox abuse to break out from restricted environments by spawning an interactive system shell.The busybox is software utility suite that provides several Unix utilities in a single executable file and the activity of spawing a shell is not a standard use of this binary by a user or system administrator. It indicates a potentially malicious actor attempting to improve the capabilities or stability of their access.

Elastic rule (View on GitHub)

 1[metadata]
 2creation_date = "2022/03/15"
 3deprecation_date = "2022/05/09"
 4maturity = "deprecated"
 5updated_date = "2022/05/09"
 6
 7[rule]
 8author = ["Elastic"]
 9description = """
10Identifies Linux binary busybox abuse to break out from restricted environments by spawning an interactive system
11shell.The busybox is software utility suite that provides several Unix utilities in a single executable file and the
12activity of spawing a shell is not a standard use of this binary by a user or system administrator. It indicates a
13potentially malicious actor attempting to improve the capabilities or stability of their access.
14"""
15from = "now-9m"
16index = ["logs-endpoint.events.*"]
17language = "eql"
18license = "Elastic License v2"
19name = "Linux Restricted Shell Breakout via busybox Shell Evasion"
20references = ["https://gtfobins.github.io/gtfobins/busybox/"]
21risk_score = 47
22rule_id = "e9b4a3c7-24fc-49fd-a00f-9c938031eef1"
23severity = "medium"
24tags = ["Elastic", "Host", "Linux", "Threat Detection", "Execution", "GTFOBins"]
25timestamp_override = "event.ingested"
26type = "eql"
27
28query = '''
29process where event.type == "start" and process.name == "busybox" and process.args_count == 2 and process.args in ("/bin/sh", "/bin/ash", "sh", "ash")
30'''
31
32
33[[rule.threat]]
34framework = "MITRE ATT&CK"
35[[rule.threat.technique]]
36id = "T1059"
37name = "Command and Scripting Interpreter"
38reference = "https://attack.mitre.org/techniques/T1059/"
39[[rule.threat.technique.subtechnique]]
40id = "T1059.004"
41name = "Unix Shell"
42reference = "https://attack.mitre.org/techniques/T1059/004/"
43
44
45
46[rule.threat.tactic]
47id = "TA0002"
48name = "Execution"
49reference = "https://attack.mitre.org/tactics/TA0002/"

References

Related rules

to-top