Skip to content

Commit bda72d8

Browse files
authored
Merge pull request #3246 from splunk/xorddos
xorddos
2 parents ab2ea08 + cd0fb26 commit bda72d8

14 files changed

+446
-113
lines changed

detections/endpoint/linux_add_files_in_known_crontab_directories.yml

Lines changed: 29 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,30 @@
11
name: Linux Add Files In Known Crontab Directories
22
id: 023f3452-5f27-11ec-bf00-acde48001122
3-
version: 3
4-
date: '2024-09-30'
3+
version: '4'
4+
date: '2024-12-17'
55
author: Teoderick Contreras, Splunk
66
status: production
77
type: Anomaly
8-
description: The following analytic detects unauthorized file creation in known crontab directories on Unix-based systems. It leverages filesystem data to identify new files in directories such as /etc/cron* and /var/spool/cron/*. This activity is significant as it may indicate an attempt by threat actors or malware to establish persistence on a compromised host. If confirmed malicious, this could allow attackers to execute arbitrary code at scheduled intervals, potentially leading to further system compromise and unauthorized access to sensitive information.
8+
description: The following analytic detects unauthorized file creation in known crontab
9+
directories on Unix-based systems. It leverages filesystem data to identify new
10+
files in directories such as /etc/cron* and /var/spool/cron/*. This activity is
11+
significant as it may indicate an attempt by threat actors or malware to establish
12+
persistence on a compromised host. If confirmed malicious, this could allow attackers
13+
to execute arbitrary code at scheduled intervals, potentially leading to further
14+
system compromise and unauthorized access to sensitive information.
915
data_source:
1016
- Sysmon for Linux EventID 11
11-
search: '| tstats `security_content_summariesonly` count min(_time) as firstTime max(_time) as lastTime FROM datamodel=Endpoint.Filesystem where Filesystem.file_path IN ("*/etc/cron*", "*/var/spool/cron/*") by Filesystem.dest Filesystem.file_create_time Filesystem.file_name Filesystem.process_guid Filesystem.file_path | `drop_dm_object_name(Filesystem)` | `security_content_ctime(lastTime)` | `security_content_ctime(firstTime)` | `linux_add_files_in_known_crontab_directories_filter`'
12-
how_to_implement: To successfully implement this search, you need to be ingesting logs with the file name, file path, and process_guid executions from your endpoints. If you are using Sysmon, you can use the Add-on for Linux Sysmon from Splunkbase.
13-
known_false_positives: Administrator or network operator can create file in crontab folders for automation purposes. Please update the filter macros to remove false positives.
17+
search: '| tstats `security_content_summariesonly` count min(_time) as firstTime max(_time)
18+
as lastTime FROM datamodel=Endpoint.Filesystem where Filesystem.file_path IN ("*/etc/cron*",
19+
"*/var/spool/cron/*") by Filesystem.dest Filesystem.file_create_time Filesystem.file_name
20+
Filesystem.process_guid Filesystem.file_path | `drop_dm_object_name(Filesystem)`
21+
| `security_content_ctime(lastTime)` | `security_content_ctime(firstTime)` | `linux_add_files_in_known_crontab_directories_filter`'
22+
how_to_implement: To successfully implement this search, you need to be ingesting
23+
logs with the file name, file path, and process_guid executions from your endpoints.
24+
If you are using Sysmon, you can use the Add-on for Linux Sysmon from Splunkbase.
25+
known_false_positives: Administrator or network operator can create file in crontab
26+
folders for automation purposes. Please update the filter macros to remove false
27+
positives.
1428
references:
1529
- https://www.sandflysecurity.com/blog/detecting-cronrat-malware-on-linux-instantly/
1630
- https://www.cyberciti.biz/faq/how-do-i-add-jobs-to-cron-under-linux-or-unix-oses/
@@ -20,15 +34,21 @@ drilldown_searches:
2034
earliest_offset: $info_min_time$
2135
latest_offset: $info_max_time$
2236
- name: View risk events for the last 7 days for - "$dest$"
23-
search: '| from datamodel Risk.All_Risk | search normalized_risk_object IN ("$dest$") starthoursago=168 | stats count min(_time) as firstTime max(_time) as lastTime values(search_name) as "Search Name" values(risk_message) as "Risk Message" values(analyticstories) as "Analytic Stories" values(annotations._all) as "Annotations" values(annotations.mitre_attack.mitre_tactic) as "ATT&CK Tactics" by normalized_risk_object | `security_content_ctime(firstTime)` | `security_content_ctime(lastTime)`'
37+
search: '| from datamodel Risk.All_Risk | search normalized_risk_object IN ("$dest$")
38+
starthoursago=168 | stats count min(_time) as firstTime max(_time) as lastTime
39+
values(search_name) as "Search Name" values(risk_message) as "Risk Message" values(analyticstories)
40+
as "Analytic Stories" values(annotations._all) as "Annotations" values(annotations.mitre_attack.mitre_tactic)
41+
as "ATT&CK Tactics" by normalized_risk_object | `security_content_ctime(firstTime)`
42+
| `security_content_ctime(lastTime)`'
2443
earliest_offset: $info_min_time$
2544
latest_offset: $info_max_time$
2645
tags:
2746
analytic_story:
28-
- Linux Privilege Escalation
29-
- Linux Persistence Techniques
47+
- XorDDos
3048
- Linux Living Off The Land
49+
- Linux Privilege Escalation
3150
- Scheduled Tasks
51+
- Linux Persistence Techniques
3252
asset_type: Endpoint
3353
confidence: 50
3454
impact: 50

detections/endpoint/linux_auditd_file_permission_modification_via_chmod.yml

Lines changed: 38 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,37 @@
11
name: Linux Auditd File Permission Modification Via Chmod
22
id: 5f1d2ea7-eec0-4790-8b24-6875312ad492
3-
version: 3
4-
date: '2024-12-02'
5-
author: Teoderick Contreras, Splunk, Ivar Nygård
3+
version: '4'
4+
date: '2024-12-17'
5+
author: "Teoderick Contreras, Splunk, Ivar Nyg\xE5rd"
66
status: production
77
type: Anomaly
8-
description: The following analytic detects suspicious file permission modifications using the `chmod` command, which may indicate an attacker attempting to alter access controls on critical files or directories. Such modifications can be used to grant unauthorized users elevated privileges or to conceal malicious activities by restricting legitimate access. By monitoring for unusual or unauthorized `chmod` usage, this analytic helps identify potential security breaches, allowing security teams to respond promptly to prevent privilege escalation, data tampering, or other unauthorized actions on the system.
8+
description: The following analytic detects suspicious file permission modifications
9+
using the `chmod` command, which may indicate an attacker attempting to alter access
10+
controls on critical files or directories. Such modifications can be used to grant
11+
unauthorized users elevated privileges or to conceal malicious activities by restricting
12+
legitimate access. By monitoring for unusual or unauthorized `chmod` usage, this
13+
analytic helps identify potential security breaches, allowing security teams to
14+
respond promptly to prevent privilege escalation, data tampering, or other unauthorized
15+
actions on the system.
916
data_source:
1017
- Linux Auditd Proctitle
11-
search: '`linux_auditd` `linux_auditd_normalized_proctitle_process` | rename host as dest | where LIKE(process_exec, "%chmod%") AND (LIKE(process_exec, "% 777 %") OR LIKE(process_exec, "% 755 %") OR LIKE(process_exec, "%+%x%") OR LIKE(process_exec, "% 754 %") OR LIKE(process_exec, "% 700 %")) | stats count min(_time) as firstTime max(_time) as lastTime by process_exec proctitle dest | `security_content_ctime(firstTime)` | `security_content_ctime(lastTime)`| `linux_auditd_file_permission_modification_via_chmod_filter`'
12-
how_to_implement: To implement this detection, the process begins by ingesting auditd data, that consist SYSCALL, TYPE, EXECVE and PROCTITLE events, which captures command-line executions and process details on Unix/Linux systems. These logs should be ingested and processed using Splunk Add-on for Unix and Linux (https://splunkbase.splunk.com/app/833), which is essential for correctly parsing and categorizing the data. The next step involves normalizing the field names to match the field names set by the Splunk Common Information Model (CIM) to ensure consistency across different data sources and enhance the efficiency of data modeling. This approach enables effective monitoring and detection of linux endpoints where auditd is deployed
13-
known_false_positives: Administrator or network operator can use this application for automation purposes. Please update the filter macros to remove false positives.
18+
search: '`linux_auditd` `linux_auditd_normalized_proctitle_process` | rename host
19+
as dest | where LIKE(process_exec, "%chmod%") AND (LIKE(process_exec, "% 777 %")
20+
OR LIKE(process_exec, "% 755 %") OR LIKE(process_exec, "%+%x%") OR LIKE(process_exec,
21+
"% 754 %") OR LIKE(process_exec, "% 700 %")) | stats count min(_time) as firstTime
22+
max(_time) as lastTime by process_exec proctitle dest | `security_content_ctime(firstTime)`
23+
| `security_content_ctime(lastTime)`| `linux_auditd_file_permission_modification_via_chmod_filter`'
24+
how_to_implement: To implement this detection, the process begins by ingesting auditd
25+
data, that consist SYSCALL, TYPE, EXECVE and PROCTITLE events, which captures command-line
26+
executions and process details on Unix/Linux systems. These logs should be ingested
27+
and processed using Splunk Add-on for Unix and Linux (https://splunkbase.splunk.com/app/833),
28+
which is essential for correctly parsing and categorizing the data. The next step
29+
involves normalizing the field names to match the field names set by the Splunk
30+
Common Information Model (CIM) to ensure consistency across different data sources
31+
and enhance the efficiency of data modeling. This approach enables effective monitoring
32+
and detection of linux endpoints where auditd is deployed
33+
known_false_positives: Administrator or network operator can use this application
34+
for automation purposes. Please update the filter macros to remove false positives.
1435
references:
1536
- https://www.splunk.com/en_us/blog/security/deep-dive-on-persistence-privilege-escalation-technique-and-detection-in-linux-platform.html
1637
drilldown_searches:
@@ -19,19 +40,26 @@ drilldown_searches:
1940
earliest_offset: $info_min_time$
2041
latest_offset: $info_max_time$
2142
- name: View risk events for the last 7 days for - "$dest$"
22-
search: '| from datamodel Risk.All_Risk | search normalized_risk_object IN ("$dest$") starthoursago=168 | stats count min(_time) as firstTime max(_time) as lastTime values(search_name) as "Search Name" values(risk_message) as "Risk Message" values(analyticstories) as "Analytic Stories" values(annotations._all) as "Annotations" values(annotations.mitre_attack.mitre_tactic) as "ATT&CK Tactics" by normalized_risk_object | `security_content_ctime(firstTime)` | `security_content_ctime(lastTime)`'
43+
search: '| from datamodel Risk.All_Risk | search normalized_risk_object IN ("$dest$")
44+
starthoursago=168 | stats count min(_time) as firstTime max(_time) as lastTime
45+
values(search_name) as "Search Name" values(risk_message) as "Risk Message" values(analyticstories)
46+
as "Analytic Stories" values(annotations._all) as "Annotations" values(annotations.mitre_attack.mitre_tactic)
47+
as "ATT&CK Tactics" by normalized_risk_object | `security_content_ctime(firstTime)`
48+
| `security_content_ctime(lastTime)`'
2349
earliest_offset: $info_min_time$
2450
latest_offset: $info_max_time$
2551
tags:
2652
analytic_story:
53+
- XorDDos
2754
- Linux Living Off The Land
55+
- Compromised Linux Host
2856
- Linux Privilege Escalation
2957
- Linux Persistence Techniques
30-
- Compromised Linux Host
3158
asset_type: Endpoint
3259
confidence: 50
3360
impact: 50
34-
message: A [$process_exec$] event occurred on host - [$dest$] to modify file permissions using the "chmod" command.
61+
message: A [$process_exec$] event occurred on host - [$dest$] to modify file permissions
62+
using the "chmod" command.
3563
mitre_attack_id:
3664
- T1222.002
3765
- T1222

detections/endpoint/linux_auditd_insert_kernel_module_using_insmod_utility.yml

Lines changed: 35 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,34 @@
11
name: Linux Auditd Insert Kernel Module Using Insmod Utility
22
id: bc0ca53f-dea6-4906-9b12-09c396fdf1d3
3-
version: 2
4-
date: '2024-09-30'
3+
version: '3'
4+
date: '2024-12-17'
55
author: Teoderick Contreras, Splunk
66
status: production
77
type: Anomaly
8-
description: The following analytic detects the insertion of a Linux kernel module using the insmod utility. It leverages data from Linux Auditd, focusing on process execution logs that include process names and command-line details. This activity is significant as it may indicate the installation of a rootkit or malicious kernel module, potentially allowing an attacker to gain elevated privileges and bypass security detections. If confirmed malicious, this could lead to unauthorized code execution, persistent access, and severe compromise of the affected system.
8+
description: The following analytic detects the insertion of a Linux kernel module
9+
using the insmod utility. It leverages data from Linux Auditd, focusing on process
10+
execution logs that include process names and command-line details. This activity
11+
is significant as it may indicate the installation of a rootkit or malicious kernel
12+
module, potentially allowing an attacker to gain elevated privileges and bypass
13+
security detections. If confirmed malicious, this could lead to unauthorized code
14+
execution, persistent access, and severe compromise of the affected system.
915
data_source:
1016
- Linux Auditd Syscall
11-
search: '`linux_auditd` type=SYSCALL comm=insmod | rename host as dest | stats count min(_time) as firstTime max(_time) as lastTime by comm exe SYSCALL UID ppid pid success dest | `security_content_ctime(firstTime)` | `security_content_ctime(lastTime)`| `linux_auditd_insert_kernel_module_using_insmod_utility_filter`'
12-
how_to_implement: To implement this detection, the process begins by ingesting auditd data, that consist SYSCALL, TYPE, EXECVE and PROCTITLE events, which captures command-line executions and process details on Unix/Linux systems. These logs should be ingested and processed using Splunk Add-on for Unix and Linux (https://splunkbase.splunk.com/app/833), which is essential for correctly parsing and categorizing the data. The next step involves normalizing the field names to match the field names set by the Splunk Common Information Model (CIM) to ensure consistency across different data sources and enhance the efficiency of data modeling. This approach enables effective monitoring and detection of linux endpoints where auditd is deployed
13-
known_false_positives: Administrator or network operator can execute this command. Please update the filter macros to remove false positives.
17+
search: '`linux_auditd` type=SYSCALL comm=insmod | rename host as dest | stats count
18+
min(_time) as firstTime max(_time) as lastTime by comm exe SYSCALL UID ppid pid
19+
success dest | `security_content_ctime(firstTime)` | `security_content_ctime(lastTime)`|
20+
`linux_auditd_insert_kernel_module_using_insmod_utility_filter`'
21+
how_to_implement: To implement this detection, the process begins by ingesting auditd
22+
data, that consist SYSCALL, TYPE, EXECVE and PROCTITLE events, which captures command-line
23+
executions and process details on Unix/Linux systems. These logs should be ingested
24+
and processed using Splunk Add-on for Unix and Linux (https://splunkbase.splunk.com/app/833),
25+
which is essential for correctly parsing and categorizing the data. The next step
26+
involves normalizing the field names to match the field names set by the Splunk
27+
Common Information Model (CIM) to ensure consistency across different data sources
28+
and enhance the efficiency of data modeling. This approach enables effective monitoring
29+
and detection of linux endpoints where auditd is deployed
30+
known_false_positives: Administrator or network operator can execute this command.
31+
Please update the filter macros to remove false positives.
1432
references:
1533
- https://docs.fedoraproject.org/en-US/fedora/rawhide/system-administrators-guide/kernel-module-driver-configuration/Working_with_Kernel_Modules/
1634
- https://security.stackexchange.com/questions/175953/how-to-load-a-malicious-lkm-at-startup
@@ -21,19 +39,26 @@ drilldown_searches:
2139
earliest_offset: $info_min_time$
2240
latest_offset: $info_max_time$
2341
- name: View risk events for the last 7 days for - "$dest$"
24-
search: '| from datamodel Risk.All_Risk | search normalized_risk_object IN ("$dest$") starthoursago=168 | stats count min(_time) as firstTime max(_time) as lastTime values(search_name) as "Search Name" values(risk_message) as "Risk Message" values(analyticstories) as "Analytic Stories" values(annotations._all) as "Annotations" values(annotations.mitre_attack.mitre_tactic) as "ATT&CK Tactics" by normalized_risk_object | `security_content_ctime(firstTime)` | `security_content_ctime(lastTime)`'
42+
search: '| from datamodel Risk.All_Risk | search normalized_risk_object IN ("$dest$")
43+
starthoursago=168 | stats count min(_time) as firstTime max(_time) as lastTime
44+
values(search_name) as "Search Name" values(risk_message) as "Risk Message" values(analyticstories)
45+
as "Analytic Stories" values(annotations._all) as "Annotations" values(annotations.mitre_attack.mitre_tactic)
46+
as "ATT&CK Tactics" by normalized_risk_object | `security_content_ctime(firstTime)`
47+
| `security_content_ctime(lastTime)`'
2548
earliest_offset: $info_min_time$
2649
latest_offset: $info_max_time$
2750
tags:
2851
analytic_story:
29-
- Linux Privilege Escalation
52+
- XorDDos
3053
- Linux Rootkit
31-
- Linux Persistence Techniques
3254
- Compromised Linux Host
55+
- Linux Privilege Escalation
56+
- Linux Persistence Techniques
3357
asset_type: Endpoint
3458
confidence: 80
3559
impact: 80
36-
message: A SYSCALL - [$comm$] event was executed on host - [$dest$] to insert a Linux kernel module using the insmod utility.
60+
message: A SYSCALL - [$comm$] event was executed on host - [$dest$] to insert a
61+
Linux kernel module using the insmod utility.
3762
mitre_attack_id:
3863
- T1547.006
3964
- T1547

0 commit comments

Comments
 (0)