Skip to content

Commit b38d614

Browse files
Aegrahgithub-actions[bot]
authored andcommitted
[New Rules] Linux Wildcard Injection (#2973)
* [New Rules] Linux Wildcard Injection * Update rules/linux/privilege_escalation_chown_chmod_unauthorized_file_read.toml Co-authored-by: Justin Ibarra <[email protected]> * Update rules/linux/privilege_escalation_potential_wildcard_shell_spawn.toml Co-authored-by: Justin Ibarra <[email protected]> * Update rules/linux/privilege_escalation_potential_wildcard_shell_spawn.toml * Update rules/linux/privilege_escalation_potential_wildcard_shell_spawn.toml Co-authored-by: Justin Ibarra <[email protected]> * Update rules/linux/privilege_escalation_potential_wildcard_shell_spawn.toml --------- Co-authored-by: Justin Ibarra <[email protected]> Co-authored-by: Colson Wilhoit <[email protected]> (cherry picked from commit ef49709)
1 parent 1fbd6b7 commit b38d614

2 files changed

+126
-0
lines changed
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
[metadata]
2+
creation_date = "2023/07/28"
3+
integration = ["endpoint"]
4+
maturity = "production"
5+
min_stack_comments = "New fields added: required_fields, related_integrations, setup"
6+
min_stack_version = "8.3.0"
7+
updated_date = "2023/07/28"
8+
9+
[rule]
10+
author = ["Elastic"]
11+
description = """
12+
This rule monitors for the execution of the "chown" and "chmod" commands with command line flags that could indicate a
13+
wildcard injection attack. Linux wildcard injection is a type of security vulnerability where attackers manipulate
14+
commands or input containing wildcards (e.g., *, ?, []) to execute unintended operations or access sensitive data by
15+
tricking the system into interpreting the wildcard characters in unexpected ways.
16+
"""
17+
from = "now-9m"
18+
index = ["logs-endpoint.events.*", "endgame-*"]
19+
language = "eql"
20+
license = "Elastic License v2"
21+
name = "Potential Unauthorized Access via Wildcard Injection Detected"
22+
references = ["https://www.exploit-db.com/papers/33930"]
23+
risk_score = 21
24+
rule_id = "4a99ac6f-9a54-4ba5-a64f-6eb65695841b"
25+
severity = "low"
26+
tags = ["Domain: Endpoint", "OS: Linux", "Use Case: Threat Detection", "Tactic: Privilege Escalation", "Tactic: Credential Access", "Data Source: Elastic Endgame"]
27+
timestamp_override = "event.ingested"
28+
type = "eql"
29+
query = '''
30+
process where host.os.type == "linux" and event.action in ("exec", "exec_event") and event.type == "start" and
31+
process.name in ("chown", "chmod") and process.args == "-R" and process.args : "--reference=*"
32+
'''
33+
34+
[[rule.threat]]
35+
framework = "MITRE ATT&CK"
36+
37+
[[rule.threat.technique]]
38+
id = "T1068"
39+
name = "Exploitation for Privilege Escalation"
40+
reference = "https://attack.mitre.org/techniques/T1068/"
41+
42+
[rule.threat.tactic]
43+
id = "TA0004"
44+
name = "Privilege Escalation"
45+
reference = "https://attack.mitre.org/tactics/TA0004/"
46+
47+
[[rule.threat]]
48+
framework = "MITRE ATT&CK"
49+
50+
[[rule.threat.technique]]
51+
id = "T1003"
52+
name = "OS Credential Dumping"
53+
reference = "https://attack.mitre.org/techniques/T1003/"
54+
55+
[[rule.threat.technique.subtechnique]]
56+
id = "T1003.008"
57+
name = "/etc/passwd and /etc/shadow"
58+
reference = "https://attack.mitre.org/techniques/T1003/008/"
59+
60+
[rule.threat.tactic]
61+
id = "TA0006"
62+
name = "Credential Access"
63+
reference = "https://attack.mitre.org/tactics/TA0006/"
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
[metadata]
2+
creation_date = "2023/07/28"
3+
integration = ["endpoint"]
4+
maturity = "production"
5+
min_stack_comments = "New fields added: required_fields, related_integrations, setup"
6+
min_stack_version = "8.3.0"
7+
updated_date = "2023/07/28"
8+
9+
[rule]
10+
author = ["Elastic"]
11+
description = """
12+
This rule monitors for the execution of a set of linux binaries, that are potentially vulnerable to wildcard injection,
13+
with suspicious command line flags followed by a shell spawn event. Linux wildcard injection is a type of security
14+
vulnerability where attackers manipulate commands or input containing wildcards (e.g., *, ?, []) to execute unintended
15+
operations or access sensitive data by tricking the system into interpreting the wildcard characters in unexpected ways.
16+
"""
17+
from = "now-9m"
18+
index = ["logs-endpoint.events.*"]
19+
language = "eql"
20+
license = "Elastic License v2"
21+
name = "Potential Shell via Wildcard Injection Detected"
22+
references = ["https://www.exploit-db.com/papers/33930"]
23+
risk_score = 47
24+
rule_id = "0b803267-74c5-444d-ae29-32b5db2d562a"
25+
severity = "medium"
26+
tags = ["Domain: Endpoint", "OS: Linux", "Use Case: Threat Detection", "Tactic: Privilege Escalation", "Tactic: Execution"]
27+
type = "eql"
28+
query = '''
29+
sequence by host.id with maxspan=1s
30+
[process where host.os.type == "linux" and event.action == "exec" and event.type == "start" and (
31+
(process.name == "tar" and process.args : "--checkpoint=*" and process.args : "--checkpoint-action=*") or
32+
(process.name == "rsync" and process.args : "-e*") or
33+
(process.name == "zip" and process.args == "--unzip-command") )] by process.entity_id
34+
[process where host.os.type == "linux" and event.action == "exec" and event.type == "start" and
35+
process.parent.name : ("tar", "rsync", "zip") and
36+
process.name : ("bash", "dash", "sh", "tcsh", "csh", "zsh", "ksh", "fish")] by process.parent.entity_id
37+
'''
38+
39+
[[rule.threat]]
40+
framework = "MITRE ATT&CK"
41+
42+
[[rule.threat.technique]]
43+
id = "T1068"
44+
name = "Exploitation for Privilege Escalation"
45+
reference = "https://attack.mitre.org/techniques/T1068/"
46+
47+
[rule.threat.tactic]
48+
id = "TA0004"
49+
name = "Privilege Escalation"
50+
reference = "https://attack.mitre.org/tactics/TA0004/"
51+
52+
[[rule.threat]]
53+
framework = "MITRE ATT&CK"
54+
55+
[[rule.threat.technique]]
56+
id = "T1059"
57+
name = "Command and Scripting Interpreter"
58+
reference = "https://attack.mitre.org/techniques/T1059/"
59+
60+
[rule.threat.tactic]
61+
id = "TA0002"
62+
name = "Execution"
63+
reference = "https://attack.mitre.org/tactics/TA0002/"

0 commit comments

Comments
 (0)