Skip to content

Commit b68524f

Browse files
authored
Merge branch 'develop' into remove-uncomatible-ds
2 parents f26afe8 + 5182ac3 commit b68524f

File tree

4 files changed

+263
-0
lines changed

4 files changed

+263
-0
lines changed
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
name: O365 Exfiltration via File Access
2+
id: 80b44ae2-60ff-43f1-8e56-34beb49a340a
3+
version: 1
4+
date: '2024-10-14'
5+
author: Steven Dick
6+
status: production
7+
type: Anomaly
8+
description: The following analytic detects when an excessive number of files are access from o365 by the same user over a short period of time. A malicious actor may abuse the "open in app" functionality of SharePoint through scripted or Graph API based access to evade triggering the FileDownloaded Event. This behavior may indicate an attacker staging data for exfiltration or an insider threat removing organizational data. Additional attention should be take with any Azure Guest (#EXT#) accounts.
9+
data_source:
10+
- Office 365 Universal Audit Log
11+
search: |-
12+
`o365_management_activity` Operation IN ("fileaccessed") UserId!=app@sharepoint NOT SourceFileExtension IN (bmp,png,jpeg,jpg)
13+
| eval user = replace(mvindex(split(lower(UserId),"#ext#"),0),"_","@"), user_flat = replace(UserId, "[^A-Za-z0-9]","_")
14+
| where NOT match(SiteUrl,user_flat)
15+
| stats values(user) as user, latest(ClientIP) as src values(ZipFileName) as file_name, values(Operation) as signature, values(UserAgent) as http_user_agent, dc(SourceFileName) as count, min(_time) as firstTime, max(_time) as lastTime by Workload,UserId,SiteUrl
16+
| eventstats avg(count) as avg stdev(count) as stdev by Workload
17+
| rename SiteUrl as file_path,Workload as app
18+
| where count > 50 AND count > (avg + (3*(stdev)))
19+
| `security_content_ctime(firstTime)`
20+
| `security_content_ctime(lastTime)`
21+
| `o365_exfiltration_via_file_access_filter`
22+
how_to_implement: You must install the Splunk Microsoft Office 365 Add-on and ingest Office 365 management activity events.
23+
known_false_positives: It is possible that certain file access scenarios may trigger this alert, specifically OneDrive syncing and users accessing personal onedrives of other users. Adjust threshold and filtering as needed.
24+
references:
25+
- https://attack.mitre.org/techniques/T1567/exfil
26+
- https://www.varonis.com/blog/sidestepping-detection-while-exfiltrating-sharepoint-data
27+
- https://thedfirjournal.com/posts/m365-data-exfiltration-rclone/
28+
drilldown_searches:
29+
- name: View the detection results for - "$user$"
30+
search: '%original_detection_search% | search user = "$user$"'
31+
earliest_offset: $info_min_time$
32+
latest_offset: $info_max_time$
33+
- name: View risk events for the last 7 days for - "$user$"
34+
search: '| from datamodel Risk.All_Risk | search normalized_risk_object IN ("$user$") 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)`'
35+
earliest_offset: $info_min_time$
36+
latest_offset: $info_max_time$
37+
- name: Investigate file access by $user$
38+
search: '`o365_management_activity` Operation IN ("fileaccessed") UserId="$UserId$"'
39+
earliest_offset: $info_min_time$
40+
latest_offset: $info_max_time$
41+
rba:
42+
message: The user $user$ accessed an excessive number of files [$count$] from $file_path$ using $src$
43+
risk_objects:
44+
- field: user
45+
type: user
46+
score: 20
47+
threat_objects:
48+
- field: src
49+
type: ip_address
50+
tags:
51+
analytic_story:
52+
- Data Exfiltration
53+
- Office 365 Account Takeover
54+
asset_type: O365 Tenant
55+
mitre_attack_id:
56+
- T1567
57+
- T1530
58+
product:
59+
- Splunk Enterprise
60+
- Splunk Enterprise Security
61+
- Splunk Cloud
62+
security_domain: threat
63+
tests:
64+
- name: True Positive Test
65+
attack_data:
66+
- data: https://media.githubusercontent.com/media/splunk/attack_data/master/datasets/attack_techniques/T1567/o365_sus_file_activity/o365_sus_file_activity.log
67+
source: o365
68+
sourcetype: o365:management:activity
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
name: O365 Exfiltration via File Download
2+
id: 06b23921-bfe2-4576-89dd-616f06e129da
3+
version: 1
4+
date: '2024-10-14'
5+
author: Steven Dick
6+
status: production
7+
type: Anomaly
8+
description: The following analytic detects when an excessive number of files are downloaded from o365 by the same user over a short period of time. O365 may bundle these files together as a ZIP file, however each file will have it's own download event. This behavior may indicate an attacker staging data for exfiltration or an insider threat removing organizational data. Additional attention should be taken with any Azure Guest (#EXT#) accounts.
9+
data_source:
10+
- Office 365 Universal Audit Log
11+
search: |-
12+
`o365_management_activity` Operation IN ("filedownloaded")
13+
| eval user = replace(mvindex(split(lower(UserId),"#ext#"),0),"_","@"), user_flat = replace(UserId, "[^A-Za-z0-9]","_")
14+
| stats values(user) as user, latest(ClientIP) as src values(ZipFileName) as file_name, values(Operation) as signature, values(UserAgent) as http_user_agent, dc(SourceFileName) as count, min(_time) as firstTime, max(_time) as lastTime by Workload,UserId,SiteUrl
15+
| rename SiteUrl as file_path,Workload as app
16+
| where count > 50
17+
| `security_content_ctime(firstTime)`
18+
| `security_content_ctime(lastTime)`
19+
| `o365_exfiltration_via_file_download_filter`
20+
how_to_implement: You must install the Splunk Microsoft Office 365 Add-on and ingest Office 365 management activity events.
21+
known_false_positives: It is possible that certain file download scenarios may trigger this alert, specifically OneDrive syncing. Adjust threshold and filtering as needed.
22+
references:
23+
- https://attack.mitre.org/techniques/T1567/exfil
24+
- https://www.varonis.com/blog/sidestepping-detection-while-exfiltrating-sharepoint-data
25+
- https://thedfirjournal.com/posts/m365-data-exfiltration-rclone/
26+
drilldown_searches:
27+
- name: View the detection results for - "$user$"
28+
search: '%original_detection_search% | search user = "$user$"'
29+
earliest_offset: $info_min_time$
30+
latest_offset: $info_max_time$
31+
- name: View risk events for the last 7 days for - "$user$"
32+
search: '| from datamodel Risk.All_Risk | search normalized_risk_object IN ("$user$") 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)`'
33+
earliest_offset: $info_min_time$
34+
latest_offset: $info_max_time$
35+
- name: Investigate file downloads by $user$
36+
search: '`o365_management_activity` Operation IN ("filedownloaded") UserId="$UserId$"'
37+
earliest_offset: $info_min_time$
38+
latest_offset: $info_max_time$
39+
rba:
40+
message: The user $user$ downloaded an excessive number of files [$count$] from $file_path$ using $src$
41+
risk_objects:
42+
- field: user
43+
type: user
44+
score: 25
45+
threat_objects:
46+
- field: src
47+
type: ip_address
48+
tags:
49+
analytic_story:
50+
- Data Exfiltration
51+
- Office 365 Account Takeover
52+
asset_type: O365 Tenant
53+
mitre_attack_id:
54+
- T1567
55+
- T1530
56+
product:
57+
- Splunk Enterprise
58+
- Splunk Enterprise Security
59+
- Splunk Cloud
60+
security_domain: threat
61+
tests:
62+
- name: True Positive Test
63+
attack_data:
64+
- data: https://media.githubusercontent.com/media/splunk/attack_data/master/datasets/attack_techniques/T1567/o365_sus_file_activity/o365_sus_file_activity.log
65+
source: o365
66+
sourcetype: o365:management:activity
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
name: O365 Exfiltration via File Sync Download
2+
id: 350837b5-13d3-4c06-b688-db07afbe5050
3+
version: 1
4+
date: '2024-10-14'
5+
author: Steven Dick
6+
status: production
7+
type: Anomaly
8+
description: The following analytic detects when an excessive number of files are sync from o365 by the same user over a short period of time. A malicious actor abuse the user-agent string through GUI or API access to evade triggering the FileDownloaded event. This behavior may indicate an attacker staging data for exfiltration or an insider threat removing organizational data. Additional attention should be taken with any Azure Guest (#EXT#) accounts.
9+
data_source:
10+
- Office 365 Universal Audit Log
11+
search: |-
12+
`o365_management_activity` Operation IN ("filesyncdownload*") UserAgent="*SkyDriveSync*"
13+
| eval user = replace(mvindex(split(lower(UserId),"#ext#"),0),"_","@"), user_flat = replace(UserId, "[^A-Za-z0-9]","_")
14+
| where NOT match(SiteUrl,user_flat)
15+
| stats values(user) as user, latest(ClientIP) as src values(ZipFileName) as file_name, values(Operation) as signature, values(UserAgent) as http_user_agent, dc(SourceFileName) as count, min(_time) as firstTime, max(_time) as lastTime by Workload,UserId,SiteUrl
16+
| rename SiteUrl as file_path,Workload as app
17+
| where count > 50
18+
| `security_content_ctime(firstTime)`
19+
| `security_content_ctime(lastTime)`
20+
| `o365_exfiltration_via_file_sync_download_filter`
21+
how_to_implement: You must install the Splunk Microsoft Office 365 Add-on and ingest Office 365 management activity events.
22+
known_false_positives: It is possible that certain file sync scenarios may trigger this alert, specifically OneNote. Adjust threshold and filtering as needed.
23+
references:
24+
- https://attack.mitre.org/techniques/T1567/exfil
25+
- https://www.varonis.com/blog/sidestepping-detection-while-exfiltrating-sharepoint-data
26+
- https://thedfirjournal.com/posts/m365-data-exfiltration-rclone/
27+
drilldown_searches:
28+
- name: View the detection results for - "$user$"
29+
search: '%original_detection_search% | search user = "$user$"'
30+
earliest_offset: $info_min_time$
31+
latest_offset: $info_max_time$
32+
- name: View risk events for the last 7 days for - "$user$"
33+
search: '| from datamodel Risk.All_Risk | search normalized_risk_object IN ("$user$") 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)`'
34+
earliest_offset: $info_min_time$
35+
latest_offset: $info_max_time$
36+
- name: Investigate file sync downloads by $user$
37+
search: '`o365_management_activity` Operation IN ("filesyncdownload*") UserId="$UserId$"'
38+
earliest_offset: $info_min_time$
39+
latest_offset: $info_max_time$
40+
rba:
41+
message: The user $user$ synced an excessive number of files [$count$] from $file_path$ using $src$
42+
risk_objects:
43+
- field: user
44+
type: user
45+
score: 25
46+
threat_objects:
47+
- field: src
48+
type: ip_address
49+
tags:
50+
analytic_story:
51+
- Data Exfiltration
52+
- Office 365 Account Takeover
53+
asset_type: O365 Tenant
54+
mitre_attack_id:
55+
- T1567
56+
- T1530
57+
product:
58+
- Splunk Enterprise
59+
- Splunk Enterprise Security
60+
- Splunk Cloud
61+
security_domain: threat
62+
tests:
63+
- name: True Positive Test
64+
attack_data:
65+
- data: https://media.githubusercontent.com/media/splunk/attack_data/master/datasets/attack_techniques/T1567/o365_sus_file_activity/o365_sus_file_activity.log
66+
source: o365
67+
sourcetype: o365:management:activity
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
name: Potential Telegram API Request Via CommandLine
2+
id: d6b0d627-d0bf-46b1-936f-c48284767d21
3+
version: 1
4+
date: '2025-02-19'
5+
author: Nasreddine Bencherchali, Splunk, Zaki Zarkasih Al Mustafa
6+
status: production
7+
type: Anomaly
8+
description: The following analytic detects the presence of "api.telegram.org" in the CommandLine of a process. It leverages data from Endpoint Detection and Response (EDR) agents, focusing on process execution logs that include command-line details. This activity can be significant as the telegram API has been used as an exfiltration mechanism or even as a C2 channel. If confirmed malicious, this could allow an attacker or malware to exfiltrate data or receive additional C2 instruction, potentially leading to further compromise and persistence within the network.
9+
data_source:
10+
- Sysmon EventID 1
11+
- Windows Event Log Security 4688
12+
- CrowdStrike ProcessRollup2
13+
search: '| tstats `security_content_summariesonly` count min(_time) as firstTime max(_time) as lastTime from datamodel=Endpoint.Processes where Processes.process= "*api.telegram.org*" NOT Processes.process IN ("*-osint -url*", "* --single-argument*") by Processes.dest Processes.user Processes.parent_process_name Processes.parent_process_id Processes.process_name Processes.process Processes.process_id Processes.process_guid | `drop_dm_object_name(Processes)` | `security_content_ctime(firstTime)` | `security_content_ctime(lastTime)` | `potential_telegram_api_request_via_commandline_filter`'
14+
how_to_implement: The detection is based on data that originates from Endpoint Detection and Response (EDR) agents. These agents are designed to provide security-related telemetry from the endpoints where the agent is installed. To implement this search, you must ingest logs that contain the process GUID, process name, and parent process. Additionally, you must ingest complete command-line executions. These logs must be processed using the appropriate Splunk Technology Add-ons that are specific to the EDR product. The logs must also be mapped to the `Processes` node of the `Endpoint` data model. Use the Splunk Common Information Model (CIM) to normalize the field names and speed up the data modeling process.
15+
known_false_positives: False positive may stem from application or users requesting the API directly via CommandLine for testing purposes. Investigate the matches and apply the necessary filters.
16+
references:
17+
- https://www.virustotal.com/gui/file/0b3ef5e04329cefb5bb4bf30b3edcb32d1ec6bbcb29d22695a079bfb5b56e8ac/behavior
18+
- https://www.virustotal.com/gui/file/72c59eeb15b5ec1d95e72e4b06a030bc058822bc10e5cb807e78a4624d329666/behavior
19+
- https://www.virustotal.com/gui/file/72c59eeb15b5ec1d95e72e4b06a030bc058822bc10e5cb807e78a4624d329666/content
20+
- https://www.virustotal.com/gui/file/1c4541bf70b6e251ef024ec4dde8dce400539c2368461c0d90e15a81b11ace44/content
21+
drilldown_searches:
22+
- name: View the detection results for - "$dest$"
23+
search: '%original_detection_search% | search dest = "$dest$"'
24+
earliest_offset: $info_min_time$
25+
latest_offset: $info_max_time$
26+
- name: View risk events for the last 7 days for - "$dest$"
27+
search: '| from datamodel Risk.All_Risk | search normalized_risk_object IN ("$dest$")
28+
starthoursago=168 | stats count min(_time) as firstTime max(_time) as lastTime
29+
values(search_name) as "Search Name" values(risk_message) as "Risk Message" values(analyticstories)
30+
as "Analytic Stories" values(annotations._all) as "Annotations" values(annotations.mitre_attack.mitre_tactic)
31+
as "ATT&CK Tactics" by normalized_risk_object | `security_content_ctime(firstTime)`
32+
| `security_content_ctime(lastTime)`'
33+
earliest_offset: $info_min_time$
34+
latest_offset: $info_max_time$
35+
rba:
36+
message: Process $process_name$ with command line $process$ in $dest$
37+
risk_objects:
38+
- field: dest
39+
type: system
40+
score: 30
41+
threat_objects:
42+
- field: process_name
43+
type: process_name
44+
tags:
45+
analytic_story:
46+
- XMRig
47+
asset_type: Endpoint
48+
mitre_attack_id:
49+
- T1102.002
50+
- T1041
51+
product:
52+
- Splunk Enterprise
53+
- Splunk Enterprise Security
54+
- Splunk Cloud
55+
security_domain: endpoint
56+
tests:
57+
- name: True Positive Test
58+
attack_data:
59+
- data:
60+
https://media.githubusercontent.com/media/splunk/attack_data/master/datasets/attack_techniques/T1102.002/telegram_api_cli/telegram_cli.log
61+
source: XmlWinEventLog:Microsoft-Windows-Sysmon/Operational
62+
sourcetype: XmlWinEventLog

0 commit comments

Comments
 (0)