Skip to content

Commit f22e6d2

Browse files
w0rk3rgithub-actions[bot]
authored andcommitted
[New Rule] Building Block Rules - Part 3 (#2924)
* [New Rule] Building Block Rules - Part 3 * Update defense_evasion_generic_deletion.toml * Update defense_evasion_generic_deletion.toml * Update defense_evasion_generic_deletion.toml * Apply suggestions from code review * Update rules_building_block/discovery_generic_account_groups.toml * Apply suggestions from code review --------- Co-authored-by: Colson Wilhoit <[email protected]> (cherry picked from commit 6966a6d)
1 parent 12221d0 commit f22e6d2

5 files changed

+314
-0
lines changed
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
[metadata]
2+
creation_date = "2023/07/13"
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/13"
8+
9+
[rule]
10+
author = ["Elastic"]
11+
description = """
12+
This rule identifies the execution of commands that can be used to delete files and directories. Adversaries may delete
13+
files and directories on a host system, such as logs, browser history, or malware.
14+
"""
15+
from = "now-119m"
16+
interval = "60m"
17+
index = ["logs-endpoint.events.*"]
18+
language = "eql"
19+
license = "Elastic License v2"
20+
name = "File or Directory Deletion Command"
21+
risk_score = 21
22+
rule_id = "5919988c-29e1-4908-83aa-1f087a838f63"
23+
severity = "low"
24+
tags = ["Domain: Endpoint", "OS: Windows", "Use Case: Threat Detection", "Tactic: Defense Evasion", "Rule Type: BBR"]
25+
timestamp_override = "event.ingested"
26+
building_block_type = "default"
27+
type = "eql"
28+
29+
query = '''
30+
process where host.os.type == "windows" and event.type == "start" and
31+
(
32+
(process.name: "rundll32.exe" and process.args: "*InetCpl.cpl,Clear*") or
33+
(process.name: "reg.exe" and process.args:"delete") or
34+
(
35+
process.name: "cmd.exe" and process.args: ("*rmdir*", "*rm *", "rm") and
36+
not process.args : ("*\\AppData\\Local\\Microsoft\\OneDrive\\*", "*\\AppData\\Local\\Temp\\DockerDesktop\\*")
37+
) or
38+
(process.name: "powershell.exe" and process.args: ("*rmdir", "rm", "rd", "*Remove-Item*", "del", "*]::Delete(*"))
39+
) and not user.id : "S-1-5-18"
40+
'''
41+
42+
43+
[[rule.threat]]
44+
framework = "MITRE ATT&CK"
45+
46+
[[rule.threat.technique]]
47+
id = "T1070"
48+
name = "Indicator Removal"
49+
reference = "https://attack.mitre.org/techniques/T1070/"
50+
[[rule.threat.technique.subtechnique]]
51+
id = "T1070.004"
52+
name = "File Deletion"
53+
reference = "https://attack.mitre.org/techniques/T1070/004/"
54+
55+
[rule.threat.tactic]
56+
id = "TA0005"
57+
name = "Defense Evasion"
58+
reference = "https://attack.mitre.org/tactics/TA0005/"
Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
[metadata]
2+
creation_date = "2023/07/13"
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/13"
8+
9+
[rule]
10+
author = ["Elastic"]
11+
description = """
12+
This rule identifies the execution of commands that enumerates account or group information. Adversaries may use
13+
built-in applications to get a listing of local system or domain accounts and groups.
14+
"""
15+
from = "now-119m"
16+
interval = "60m"
17+
index = ["logs-endpoint.events.*"]
18+
language = "eql"
19+
license = "Elastic License v2"
20+
name = "Windows Account or Group Discovery"
21+
risk_score = 21
22+
rule_id = "089db1af-740d-4d84-9a5b-babd6de143b0"
23+
severity = "low"
24+
tags = ["Domain: Endpoint", "OS: Windows", "Use Case: Threat Detection", "Tactic: Discovery", "Rule Type: BBR"]
25+
timestamp_override = "event.ingested"
26+
building_block_type = "default"
27+
type = "eql"
28+
29+
query = '''
30+
process where host.os.type == "windows" and event.type == "start" and
31+
(
32+
(
33+
(
34+
(process.name : "net.exe" or process.pe.original_file_name == "net.exe") or
35+
(
36+
(process.name : "net1.exe" or process.pe.original_file_name == "net1.exe") and
37+
not process.parent.name : "net.exe"
38+
)
39+
) and process.args : ("group", "user", "localgroup") and not process.args : "/add"
40+
) or
41+
(process.name:("dsquery.exe", "dsget.exe") and process.args:("*members*", "user")) or
42+
(process.name:"dsquery.exe" and process.args:"*filter*") or
43+
process.name:("quser.exe", "qwinsta.exe", "PsGetSID.exe", "PsLoggedOn.exe", "LogonSessions.exe", "whoami.exe") or
44+
(
45+
process.name: "cmd.exe" and
46+
(
47+
process.args : "echo" and process.args : (
48+
"%username%", "%userdomain%", "%userdnsdomain%",
49+
"%userdomain_roamingprofile%", "%userprofile%",
50+
"%homepath%", "%localappdata%", "%appdata%"
51+
) or
52+
process.args : "set"
53+
)
54+
)
55+
) and not user.id : "S-1-5-18"
56+
'''
57+
58+
59+
[[rule.threat]]
60+
framework = "MITRE ATT&CK"
61+
[[rule.threat.technique]]
62+
id = "T1069"
63+
name = "Permission Groups Discovery"
64+
reference = "https://attack.mitre.org/techniques/T1069/"
65+
[[rule.threat.technique.subtechnique]]
66+
id = "T1069.001"
67+
name = "Local Groups"
68+
reference = "https://attack.mitre.org/techniques/T1069/001/"
69+
[[rule.threat.technique.subtechnique]]
70+
id = "T1069.002"
71+
name = "Domain Groups"
72+
reference = "https://attack.mitre.org/techniques/T1069/002/"
73+
74+
[[rule.threat.technique]]
75+
id = "T1087"
76+
name = "Account Discovery"
77+
reference = "https://attack.mitre.org/techniques/T1087/"
78+
[[rule.threat.technique.subtechnique]]
79+
id = "T1087.001"
80+
name = "Local Account"
81+
reference = "https://attack.mitre.org/techniques/T1087/001/"
82+
[[rule.threat.technique.subtechnique]]
83+
id = "T1087.002"
84+
name = "Domain Account"
85+
reference = "https://attack.mitre.org/techniques/T1087/002/"
86+
87+
88+
[rule.threat.tactic]
89+
id = "TA0007"
90+
name = "Discovery"
91+
reference = "https://attack.mitre.org/tactics/TA0007/"
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
[metadata]
2+
creation_date = "2023/07/13"
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/13"
8+
9+
[rule]
10+
author = ["Elastic"]
11+
description = """
12+
This rule identifies the execution of commands that can be used to enumerate running processes. Adversaries may
13+
enumerate processes to identify installed applications and security solutions.
14+
"""
15+
from = "now-119m"
16+
interval = "60m"
17+
index = ["logs-endpoint.events.*"]
18+
language = "eql"
19+
license = "Elastic License v2"
20+
name = "Process Discovery Using Built-in Tools"
21+
risk_score = 21
22+
rule_id = "4982ac3e-d0ee-4818-b95d-d9522d689259"
23+
severity = "low"
24+
tags = ["Domain: Endpoint", "OS: Windows", "Use Case: Threat Detection", "Tactic: Discovery", "Rule Type: BBR"]
25+
timestamp_override = "event.ingested"
26+
building_block_type = "default"
27+
type = "eql"
28+
29+
query = '''
30+
process where host.os.type == "windows" and event.type == "start" and
31+
(
32+
process.name == "reg.exe" and process.args : "query" or
33+
(process.name: ("powershell.exe", "pwsh.exe", "powershell_ise.exe") and
34+
(process.args: ("*Get-ChildItem*", "*Get-Item*", "*Get-ItemProperty*") and
35+
process.args : (
36+
"*HKLM*", "*HKCU*", "*HKEY_LOCAL_MACHINE*", "*HKEY_CURRENT_USER*", "Registry::"
37+
)))
38+
)
39+
'''
40+
41+
42+
[[rule.threat]]
43+
framework = "MITRE ATT&CK"
44+
[[rule.threat.technique]]
45+
id = "T1057"
46+
name = "Process Discovery"
47+
reference = "https://attack.mitre.org/techniques/T1057/"
48+
49+
50+
[rule.threat.tactic]
51+
id = "TA0007"
52+
name = "Discovery"
53+
reference = "https://attack.mitre.org/tactics/TA0007/"
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
[metadata]
2+
creation_date = "2023/07/13"
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/13"
8+
9+
[rule]
10+
author = ["Elastic"]
11+
description = """
12+
This rule identifies the execution of commands that can be used to query the Windows Registry. Adversaries may query the
13+
registry to gain situational awareness about the host, like installed security software, programs and settings.
14+
"""
15+
from = "now-119m"
16+
interval = "60m"
17+
index = ["logs-endpoint.events.*"]
18+
language = "eql"
19+
license = "Elastic License v2"
20+
name = "Query Registry using Built-in Tools"
21+
risk_score = 21
22+
rule_id = "ded09d02-0137-4ccc-8005-c45e617e8d4c"
23+
severity = "low"
24+
tags = ["Domain: Endpoint", "OS: Windows", "Use Case: Threat Detection", "Tactic: Discovery", "Rule Type: BBR"]
25+
timestamp_override = "event.ingested"
26+
building_block_type = "default"
27+
type = "eql"
28+
29+
query = '''
30+
process where host.os.type == "windows" and event.type == "start" and
31+
(
32+
(
33+
process.name == "reg.exe" and process.args : "query" and
34+
not process.parent.executable : ("?:\\Program Files\\*", "?:\\Program Files (x86)\\*")
35+
) or
36+
(
37+
process.name: ("powershell.exe", "pwsh.exe", "powershell_ise.exe") and
38+
(process.args: ("*Get-ChildItem*", "*Get-Item*", "*Get-ItemProperty*") and
39+
process.args : ("*HKLM*", "*HKCU*", "*HKEY_LOCAL_MACHINE*", "*HKEY_CURRENT_USER*", "*Registry::*"))
40+
)
41+
) and not user.id : "S-1-5-18"
42+
'''
43+
44+
45+
[[rule.threat]]
46+
framework = "MITRE ATT&CK"
47+
[[rule.threat.technique]]
48+
id = "T1012"
49+
name = "Query Registry"
50+
reference = "https://attack.mitre.org/techniques/T1012/"
51+
52+
53+
[rule.threat.tactic]
54+
id = "TA0007"
55+
name = "Discovery"
56+
reference = "https://attack.mitre.org/tactics/TA0007/"
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
[metadata]
2+
creation_date = "2023/07/14"
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/14"
8+
9+
[rule]
10+
author = ["Elastic"]
11+
description = """
12+
This rule identifies the execution of unsigned executables via service control manager (SCM). Adversaries may abuse SCM
13+
to execute malware or escalate privileges.
14+
"""
15+
from = "now-119m"
16+
interval = "60m"
17+
index = ["logs-endpoint.events.*"]
18+
language = "eql"
19+
license = "Elastic License v2"
20+
name = "Execution of an Unsigned Service"
21+
risk_score = 21
22+
rule_id = "56fdfcf1-ca7c-4fd9-951d-e215ee26e404"
23+
severity = "low"
24+
tags = ["Domain: Endpoint", "OS: Windows", "Use Case: Threat Detection", "Tactic: Execution", "Rule Type: BBR"]
25+
timestamp_override = "event.ingested"
26+
building_block_type = "default"
27+
type = "eql"
28+
29+
query = '''
30+
process where host.os.type == "windows" and event.type == "start" and
31+
(
32+
(
33+
process.parent.executable : "C:\\Windows\\System32\\services.exe" and
34+
(process.code_signature.exists == false or process.code_signature.trusted == false)
35+
)
36+
)
37+
'''
38+
39+
40+
[[rule.threat]]
41+
framework = "MITRE ATT&CK"
42+
[[rule.threat.technique]]
43+
id = "T1569"
44+
name = "System Services"
45+
reference = "https://attack.mitre.org/techniques/T1569/"
46+
[[rule.threat.technique.subtechnique]]
47+
id = "T1569.002"
48+
name = "Service Execution"
49+
reference = "https://attack.mitre.org/techniques/T1569/002/"
50+
51+
52+
53+
[rule.threat.tactic]
54+
id = "TA0002"
55+
name = "Execution"
56+
reference = "https://attack.mitre.org/tactics/TA0002/"

0 commit comments

Comments
 (0)