|
1 | 1 | [metadata]
|
2 | 2 | creation_date = "2020/04/23"
|
3 | 3 | maturity = "production"
|
4 |
| -updated_date = "2020/12/17" |
| 4 | +updated_date = "2021/01/19" |
5 | 5 |
|
6 | 6 | [rule]
|
7 | 7 | author = ["Elastic"]
|
8 | 8 | description = """
|
9 |
| -An adversary may add the setuid bit to a file or directory in order to run a file with the privileges of the owning |
10 |
| -user. An adversary can take advantage of this to either do a shell escape or exploit a vulnerability in an application |
11 |
| -with the setuid bit to get code running in a different user’s context. Additionally, adversaries can use this mechanism |
12 |
| -on their own malware to make sure they're able to execute in elevated contexts in the future. |
| 9 | +An adversary may add the setuid or setgid bit to a file or directory in order to run a file with the privileges of the |
| 10 | +owning user or group. An adversary can take advantage of this to either do a shell escape or exploit a vulnerability in |
| 11 | +an application with the setuid or setgid bit to get code running in a different user’s context. Additionally, |
| 12 | +adversaries can use this mechanism on their own malware to make sure they're able to execute in elevated contexts in the |
| 13 | +future. |
13 | 14 | """
|
14 | 15 | from = "now-9m"
|
15 | 16 | index = ["auditbeat-*", "logs-endpoint.events.*"]
|
16 | 17 | language = "lucene"
|
17 | 18 | license = "Elastic License"
|
18 | 19 | max_signals = 33
|
19 |
| -name = "Setuid Bit Set via chmod" |
| 20 | +name = "Setuid / Setgid Bit Set via chmod" |
20 | 21 | risk_score = 21
|
21 | 22 | rule_id = "8a1b0278-0f9a-487d-96bd-d4833298e87a"
|
22 | 23 | severity = "low"
|
23 |
| -tags = ["Elastic", "Host", "Linux", "Threat Detection", "Privilege Escalation"] |
| 24 | +tags = ["Elastic", "Host", "Linux", "macOS", "Threat Detection", "Privilege Escalation"] |
24 | 25 | type = "query"
|
25 | 26 |
|
26 | 27 | query = '''
|
27 |
| -event.category:process AND event.type:(start or process_started) AND process.name:chmod AND |
28 |
| - process.args:(u+s OR /4[0-9]{3}/) AND |
29 |
| - NOT user.name:root |
| 28 | +event.category:process AND event.type:(start OR process_started) AND process.name:chmod AND |
| 29 | + process.args:("+s" OR "u+s" OR /4[0-9]{3}/ OR g+s OR /2[0-9]{3}/) |
30 | 30 | '''
|
31 | 31 |
|
32 | 32 |
|
|
0 commit comments