Skip to content

Commit 7c5f17e

Browse files
Aegrahbrokensound77w0rk3r
authored
[New Rules] User / Group Creation & Privileged Group Addition (#2546)
* [New Rules] user/group creation * Update rules/linux/persistence_linux_group_creation.toml Co-authored-by: Justin Ibarra <[email protected]> * Update rules/linux/persistence_linux_user_account_creation.toml Co-authored-by: Justin Ibarra <[email protected]> * Update rules/linux/persistence_linux_user_added_to_privileged_group.toml Co-authored-by: Justin Ibarra <[email protected]> * added backdoor user account * added host.os.type == linux for unit testing fix * unit testing fixes * Update rules/linux/persistence_linux_backdoor_user_creation.toml Co-authored-by: Jonhnathan <[email protected]> * Update rules/linux/persistence_linux_backdoor_user_creation.toml Co-authored-by: Jonhnathan <[email protected]> * Added OSQuery to Investigation Guides * Update rules/linux/persistence_linux_backdoor_user_creation.toml Co-authored-by: Jonhnathan <[email protected]> * Update rules/linux/persistence_linux_backdoor_user_creation.toml Co-authored-by: Jonhnathan <[email protected]> * removed investigation guides to add in future PR * Fixed some issues with the rules * fixed typo * Update rules/linux/persistence_linux_backdoor_user_creation.toml Co-authored-by: Jonhnathan <[email protected]> * Update rules/linux/persistence_linux_user_account_creation.toml Co-authored-by: Jonhnathan <[email protected]> * Update rules/linux/persistence_linux_user_added_to_privileged_group.toml Co-authored-by: Jonhnathan <[email protected]> * Update rules/linux/persistence_linux_group_creation.toml Co-authored-by: Jonhnathan <[email protected]> --------- Co-authored-by: Justin Ibarra <[email protected]> Co-authored-by: Jonhnathan <[email protected]>
1 parent 71186c8 commit 7c5f17e

4 files changed

+194
-0
lines changed
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
[metadata]
2+
creation_date = "2023/03/07"
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/06/22"
8+
9+
[rule]
10+
author = ["Elastic"]
11+
description = """
12+
Identifies the attempt to create a new backdoor user by setting the user's UID to 0. Attackers may alter a user's UID to
13+
0 to establish persistence on a system.
14+
"""
15+
from = "now-9m"
16+
index = ["logs-endpoint.events.*", "endgame-*"]
17+
language = "eql"
18+
license = "Elastic License v2"
19+
name = "Potential Linux Backdoor User Account Creation"
20+
risk_score = 47
21+
rule_id = "494ebba4-ecb7-4be4-8c6f-654c686549ad"
22+
severity = "medium"
23+
tags = ["Elastic", "Host", "Linux", "Threat Detection", "Persistence", "Elastic Endgame"]
24+
timestamp_override = "event.ingested"
25+
type = "eql"
26+
query = '''
27+
process where host.os.type == "linux" and event.type == "start" and
28+
event.action in ("exec", "exec_event") and process.name == "usermod" and
29+
process.args : "-u" and process.args : "0" and process.args : "-o"
30+
'''
31+
32+
[[rule.threat]]
33+
framework = "MITRE ATT&CK"
34+
35+
[[rule.threat.technique]]
36+
id = "T1136"
37+
name = "Create Account"
38+
reference = "https://attack.mitre.org/techniques/T1136/"
39+
40+
[[rule.threat.technique.subtechnique]]
41+
id = "T1136.001"
42+
name = "Local Account"
43+
reference = "https://attack.mitre.org/techniques/T1136/001/"
44+
45+
[rule.threat.tactic]
46+
id = "TA0003"
47+
name = "Persistence"
48+
reference = "https://attack.mitre.org/tactics/TA0003/"
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
[metadata]
2+
creation_date = "2023/02/13"
3+
integration = ["system"]
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/06/22"
8+
9+
[rule]
10+
author = ["Elastic"]
11+
description = """
12+
Identifies attempts to create a new group. Attackers may create new groups to establish persistence on a system.
13+
"""
14+
from = "now-9m"
15+
index = ["logs-system.auth-*"]
16+
language = "eql"
17+
license = "Elastic License v2"
18+
name = "Linux Group Creation"
19+
risk_score = 21
20+
rule_id = "a1c2589e-0c8c-4ca8-9eb6-f83c4bbdbe8f"
21+
severity = "low"
22+
tags = ["Elastic", "Host", "Linux", "Threat Detection", "Persistence"]
23+
timestamp_override = "event.ingested"
24+
type = "eql"
25+
query = '''
26+
iam where host.os.type == "linux" and (event.type == "group" and event.type == "creation") and
27+
process.name in ("groupadd", "addgroup") and group.name != null
28+
'''
29+
30+
[[rule.threat]]
31+
framework = "MITRE ATT&CK"
32+
33+
[[rule.threat.technique]]
34+
id = "T1136"
35+
name = "Create Account"
36+
reference = "https://attack.mitre.org/techniques/T1136/"
37+
38+
[[rule.threat.technique.subtechnique]]
39+
id = "T1136.001"
40+
name = "Local Account"
41+
reference = "https://attack.mitre.org/techniques/T1136/001/"
42+
43+
[rule.threat.tactic]
44+
id = "TA0003"
45+
name = "Persistence"
46+
reference = "https://attack.mitre.org/tactics/TA0003/"
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
[metadata]
2+
creation_date = "2023/02/13"
3+
integration = ["system"]
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/06/22"
8+
9+
[rule]
10+
author = ["Elastic"]
11+
description = """
12+
Identifies attempts to create new users. Attackers may add new users to establish persistence on a system.
13+
"""
14+
from = "now-9m"
15+
index = ["logs-system.auth-*"]
16+
language = "eql"
17+
license = "Elastic License v2"
18+
name = "Linux User Account Creation"
19+
risk_score = 21
20+
rule_id = "edfd5ca9-9d6c-44d9-b615-1e56b920219c"
21+
severity = "low"
22+
tags = ["Elastic", "Host", "Linux", "Threat Detection", "Persistence"]
23+
timestamp_override = "event.ingested"
24+
type = "eql"
25+
query = '''
26+
iam where host.os.type == "linux" and (event.type == "user" and event.type == "creation") and
27+
process.name in ("useradd", "adduser") and user.name != null
28+
'''
29+
30+
[[rule.threat]]
31+
framework = "MITRE ATT&CK"
32+
33+
[[rule.threat.technique]]
34+
id = "T1136"
35+
name = "Create Account"
36+
reference = "https://attack.mitre.org/techniques/T1136/"
37+
38+
[[rule.threat.technique.subtechnique]]
39+
id = "T1136.001"
40+
name = "Local Account"
41+
reference = "https://attack.mitre.org/techniques/T1136/001/"
42+
43+
[rule.threat.tactic]
44+
id = "TA0003"
45+
name = "Persistence"
46+
reference = "https://attack.mitre.org/tactics/TA0003/"
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
[metadata]
2+
creation_date = "2023/02/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/06/22"
8+
9+
[rule]
10+
author = ["Elastic"]
11+
description = """
12+
Identifies attempts to add a user to a privileged group. Attackers may add users to a privileged group in order to
13+
establish persistence on a system.
14+
"""
15+
from = "now-9m"
16+
index = ["logs-endpoint.events.*", "endgame-*"]
17+
language = "eql"
18+
license = "Elastic License v2"
19+
name = "Linux User Added to Privileged Group"
20+
risk_score = 47
21+
rule_id = "43d6ec12-2b1c-47b5-8f35-e9de65551d3b"
22+
severity = "medium"
23+
tags = ["Elastic", "Host", "Linux", "Threat Detection", "Persistence", "Elastic Endgame"]
24+
timestamp_override = "event.ingested"
25+
type = "eql"
26+
query = '''
27+
process where host.os.type == "linux" and event.type == "start" and
28+
process.parent.name == "sudo" and
29+
process.args in ("root", "admin", "wheel", "staff", "sudo",
30+
"disk", "video", "shadow", "lxc", "lxd") and
31+
(
32+
process.name in ("usermod", "adduser") or
33+
process.name == "gpasswd" and
34+
process.args in ("-a", "--add", "-M", "--members")
35+
)
36+
'''
37+
38+
[[rule.threat]]
39+
framework = "MITRE ATT&CK"
40+
41+
[[rule.threat.technique]]
42+
id = "T1136"
43+
name = "Create Account"
44+
reference = "https://attack.mitre.org/techniques/T1136/"
45+
46+
[[rule.threat.technique.subtechnique]]
47+
id = "T1136.001"
48+
name = "Local Account"
49+
reference = "https://attack.mitre.org/techniques/T1136/001/"
50+
51+
[rule.threat.tactic]
52+
id = "TA0003"
53+
name = "Persistence"
54+
reference = "https://attack.mitre.org/tactics/TA0003/"

0 commit comments

Comments
 (0)