Skip to content

Commit 420fbef

Browse files
Aegrahgithub-actions[bot]
authored andcommitted
[New Rules] DDExec Analysis (#3408)
* [New Rules] DDExec Analysis * Increased rule scope * [New Rule] Dynamic Linker Discovery via od * Revert "[New Rule] Dynamic Linker Discovery via od" This reverts commit c58595b. * [New Rule] Dynamic Linker Discovery via od * [New Rule] Potential Memory Seeking Activity * [New BBR] Suspicious Memory grep Activity * Added endgame + auditd_manager support * Removed auditd_manager support for now * Removed auditd_manager support for now * Update discovery_suspicious_memory_grep_activity.toml --------- Co-authored-by: Samirbous <64742097+Samirbous@users.noreply.github.com> (cherry picked from commit d41855a)
1 parent 436d421 commit 420fbef

4 files changed

+270
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
[metadata]
2+
creation_date = "2024/02/01"
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 = "2024/02/01"
8+
9+
[rule]
10+
author = ["Elastic"]
11+
description = """
12+
Monitors for dynamic linker discovery via the od utility. od (octal dump) is a command-line utility in Unix operating
13+
systems used for displaying data in various formats, including octal, hexadecimal, decimal, and ASCII, primarily used
14+
for examining and debugging binary files or data streams. Attackers can leverage od to analyze the dynamic linker by
15+
identifying injection points and craft exploits based on the observed behaviors and structures within these files.
16+
"""
17+
from = "now-9m"
18+
index = ["logs-endpoint.events.*", "endgame-*"]
19+
language = "eql"
20+
license = "Elastic License v2"
21+
name = "Suspicious Dynamic Linker Discovery via od"
22+
references = ["https://github.com/arget13/DDexec"]
23+
risk_score = 21
24+
rule_id = "0369e8a6-0fa7-4e7a-961a-53180a4c966e"
25+
setup = """
26+
27+
This rule requires data coming in from Elastic Defend.
28+
29+
### Elastic Defend Integration Setup
30+
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.
31+
32+
#### Prerequisite Requirements:
33+
- Fleet is required for Elastic Defend.
34+
- To configure Fleet Server refer to the [documentation](https://www.elastic.co/guide/en/fleet/current/fleet-server.html).
35+
36+
#### The following steps should be executed in order to add the Elastic Defend integration on a Linux System:
37+
- Go to the Kibana home page and click "Add integrations".
38+
- In the query bar, search for "Elastic Defend" and select the integration to see more details about it.
39+
- Click "Add Elastic Defend".
40+
- Configure the integration name and optionally add a description.
41+
- Select the type of environment you want to protect, either "Traditional Endpoints" or "Cloud Workloads".
42+
- 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).
43+
- We suggest selecting "Complete EDR (Endpoint Detection and Response)" as a configuration setting, that provides "All events; all preventions"
44+
- 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.
45+
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).
46+
- Click "Save and Continue".
47+
- 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.
48+
For more details on Elastic Defend refer to the [helper guide](https://www.elastic.co/guide/en/security/current/install-endpoint.html).
49+
50+
"""
51+
severity = "low"
52+
tags = [
53+
"Domain: Endpoint",
54+
"OS: Linux",
55+
"Use Case: Threat Detection",
56+
"Tactic: Discovery",
57+
"Data Source: Elastic Defend",
58+
"Data Source: Elastic Endgame"
59+
]
60+
timestamp_override = "event.ingested"
61+
type = "eql"
62+
query = '''
63+
process where host.os.type == "linux" and event.action in ("exec", "exec_event") and event.type == "start" and
64+
process.name == "od" and process.args in (
65+
"/lib/x86_64-linux-gnu/ld-linux-x86-64.so.2", "/etc/ld.so.preload", "/lib64/ld-linux-x86-64.so.2",
66+
"/usr/lib/x86_64-linux-gnu/ld-linux-x86-64.so.2", "/usr/lib64/ld-linux-x86-64.so.2"
67+
)
68+
'''
69+
70+
[[rule.threat]]
71+
framework = "MITRE ATT&CK"
72+
73+
[[rule.threat.technique]]
74+
id = "T1057"
75+
name = "Process Discovery"
76+
reference = "https://attack.mitre.org/techniques/T1057/"
77+
78+
[rule.threat.tactic]
79+
id = "TA0007"
80+
name = "Discovery"
81+
reference = "https://attack.mitre.org/tactics/TA0007/"
+78
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
[metadata]
2+
creation_date = "2024/01/29"
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 = "2024/01/29"
8+
9+
[rule]
10+
author = ["Elastic"]
11+
description = """
12+
Monitors for /proc/*/maps file reads. The /proc/*/maps file in Linux provides a memory map for a specific process,
13+
detailing the memory segments, permissions, and what files are mapped to these segments. Attackers may read a process's
14+
memory map to identify memory addresses for code injection or process hijacking.
15+
"""
16+
from = "now-9m"
17+
index = ["logs-endpoint.events.*"]
18+
language = "eql"
19+
license = "Elastic License v2"
20+
name = "Suspicious /proc/maps Discovery"
21+
references = ["https://github.com/arget13/DDexec"]
22+
risk_score = 21
23+
rule_id = "2f95540c-923e-4f57-9dae-de30169c68b9"
24+
setup = """
25+
26+
This rule requires data coming in from Elastic Defend.
27+
28+
### Elastic Defend Integration Setup
29+
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.
30+
31+
#### Prerequisite Requirements:
32+
- Fleet is required for Elastic Defend.
33+
- To configure Fleet Server refer to the [documentation](https://www.elastic.co/guide/en/fleet/current/fleet-server.html).
34+
35+
#### The following steps should be executed in order to add the Elastic Defend integration on a Linux System:
36+
- Go to the Kibana home page and click "Add integrations".
37+
- In the query bar, search for "Elastic Defend" and select the integration to see more details about it.
38+
- Click "Add Elastic Defend".
39+
- Configure the integration name and optionally add a description.
40+
- Select the type of environment you want to protect, either "Traditional Endpoints" or "Cloud Workloads".
41+
- 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).
42+
- We suggest selecting "Complete EDR (Endpoint Detection and Response)" as a configuration setting, that provides "All events; all preventions"
43+
- 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.
44+
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).
45+
- Click "Save and Continue".
46+
- 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.
47+
For more details on Elastic Defend refer to the [helper guide](https://www.elastic.co/guide/en/security/current/install-endpoint.html).
48+
49+
"""
50+
severity = "low"
51+
tags = [
52+
"Domain: Endpoint",
53+
"OS: Linux",
54+
"Use Case: Threat Detection",
55+
"Tactic: Discovery",
56+
"Data Source: Elastic Defend"
57+
]
58+
timestamp_override = "event.ingested"
59+
type = "eql"
60+
query = '''
61+
process where host.os.type == "linux" and event.action == "exec" and event.type == "start" and
62+
process.name in ("cat", "grep") and process.args : "/proc/*/maps" and process.entry_leader.name in (
63+
"bash", "dash", "sh", "tcsh", "csh", "zsh", "ksh", "fish"
64+
)
65+
'''
66+
67+
[[rule.threat]]
68+
framework = "MITRE ATT&CK"
69+
70+
[[rule.threat.technique]]
71+
id = "T1057"
72+
name = "Process Discovery"
73+
reference = "https://attack.mitre.org/techniques/T1057/"
74+
75+
[rule.threat.tactic]
76+
id = "TA0007"
77+
name = "Discovery"
78+
reference = "https://attack.mitre.org/tactics/TA0007/"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
[metadata]
2+
bypass_bbr_timing = true
3+
creation_date = "2024/02/01"
4+
integration = ["endpoint"]
5+
maturity = "production"
6+
min_stack_comments = "New fields added: required_fields, related_integrations, setup"
7+
min_stack_version = "8.3.0"
8+
updated_date = "2024/02/01"
9+
10+
[rule]
11+
author = ["Elastic"]
12+
building_block_type = "default"
13+
description = """
14+
Monitors for the execution of Unix utilities that may be leveraged as memory address seekers. Attackers may leverage
15+
built-in utilities to seek specific memory addresses, allowing for potential future manipulation/exploitation.
16+
"""
17+
from = "now-9m"
18+
index = ["logs-endpoint.events.*", "endgame-*"]
19+
language = "eql"
20+
license = "Elastic License v2"
21+
name = "Potential Memory Seeking Activity"
22+
references = ["https://github.com/arget13/DDexec"]
23+
risk_score = 21
24+
rule_id = "035a6f21-4092-471d-9cda-9e379f459b1e"
25+
severity = "low"
26+
tags = [
27+
"Domain: Endpoint",
28+
"OS: Linux",
29+
"Use Case: Threat Detection",
30+
"Tactic: Discovery",
31+
"Rule Type: BBR",
32+
"Data Source: Elastic Defend",
33+
"Data Source: Elastic Endgame"
34+
]
35+
timestamp_override = "event.ingested"
36+
type = "eql"
37+
query = '''
38+
process where host.os.type == "linux" and event.action in ("exec", "exec_event") and event.type == "start" and (
39+
(process.name == "tail" and process.args == "-c") or
40+
(process.name == "cmp" and process.args == "-i") or
41+
(process.name in ("hexdump", "xxd") and process.args == "-s") or
42+
(process.name == "dd" and process.args : ("skip*", "seek*"))
43+
)
44+
'''
45+
46+
[[rule.threat]]
47+
framework = "MITRE ATT&CK"
48+
49+
[[rule.threat.technique]]
50+
id = "T1057"
51+
name = "Process Discovery"
52+
reference = "https://attack.mitre.org/techniques/T1057/"
53+
54+
[rule.threat.tactic]
55+
id = "TA0007"
56+
name = "Discovery"
57+
reference = "https://attack.mitre.org/tactics/TA0007/"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
[metadata]
2+
bypass_bbr_timing = true
3+
creation_date = "2024/02/05"
4+
integration = ["endpoint"]
5+
maturity = "production"
6+
min_stack_comments = "New fields added: required_fields, related_integrations, setup"
7+
min_stack_version = "8.3.0"
8+
updated_date = "2024/02/05"
9+
10+
[rule]
11+
author = ["Elastic"]
12+
building_block_type = "default"
13+
description = """
14+
Monitors for grep activity related to memory mapping. The /proc/*/maps file in Linux provides a memory map for a
15+
specific process, detailing the memory segments, permissions, and what files are mapped to these segments. Attackers may
16+
read a process's memory map to identify memory addresses for code injection or process hijacking.
17+
"""
18+
from = "now-9m"
19+
index = ["logs-endpoint.events.*", "endgame-*"]
20+
language = "eql"
21+
license = "Elastic License v2"
22+
name = "Suspicious Memory grep Activity"
23+
references = ["https://github.com/arget13/DDexec"]
24+
risk_score = 21
25+
rule_id = "d74d6506-427a-4790-b170-0c2a6ddac799"
26+
severity = "low"
27+
tags = [
28+
"Domain: Endpoint",
29+
"OS: Linux",
30+
"Use Case: Threat Detection",
31+
"Tactic: Discovery",
32+
"Rule Type: BBR",
33+
"Data Source: Elastic Defend",
34+
"Data Source: Elastic Endgame"
35+
]
36+
timestamp_override = "event.ingested"
37+
type = "eql"
38+
query = '''
39+
process where host.os.type == "linux" and event.action in ("exec", "exec_event") and event.type == "start" and
40+
process.name in ("grep", "egrep", "fgrep", "rgrep") and process.args in ("[stack]", "[vdso]", "[heap]")
41+
'''
42+
43+
[[rule.threat]]
44+
framework = "MITRE ATT&CK"
45+
46+
[[rule.threat.technique]]
47+
id = "T1057"
48+
name = "Process Discovery"
49+
reference = "https://attack.mitre.org/techniques/T1057/"
50+
51+
[rule.threat.tactic]
52+
id = "TA0007"
53+
name = "Discovery"
54+
reference = "https://attack.mitre.org/tactics/TA0007/"

0 commit comments

Comments
 (0)