-
Notifications
You must be signed in to change notification settings - Fork 387
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' into remove-uncomatible-ds
- Loading branch information
Showing
4 changed files
with
263 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
name: O365 Exfiltration via File Access | ||
id: 80b44ae2-60ff-43f1-8e56-34beb49a340a | ||
version: 1 | ||
date: '2024-10-14' | ||
author: Steven Dick | ||
status: production | ||
type: Anomaly | ||
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. | ||
data_source: | ||
- Office 365 Universal Audit Log | ||
search: |- | ||
`o365_management_activity` Operation IN ("fileaccessed") UserId!=app@sharepoint NOT SourceFileExtension IN (bmp,png,jpeg,jpg) | ||
| eval user = replace(mvindex(split(lower(UserId),"#ext#"),0),"_","@"), user_flat = replace(UserId, "[^A-Za-z0-9]","_") | ||
| where NOT match(SiteUrl,user_flat) | ||
| 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 | ||
| eventstats avg(count) as avg stdev(count) as stdev by Workload | ||
| rename SiteUrl as file_path,Workload as app | ||
| where count > 50 AND count > (avg + (3*(stdev))) | ||
| `security_content_ctime(firstTime)` | ||
| `security_content_ctime(lastTime)` | ||
| `o365_exfiltration_via_file_access_filter` | ||
how_to_implement: You must install the Splunk Microsoft Office 365 Add-on and ingest Office 365 management activity events. | ||
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. | ||
references: | ||
- https://attack.mitre.org/techniques/T1567/exfil | ||
- https://www.varonis.com/blog/sidestepping-detection-while-exfiltrating-sharepoint-data | ||
- https://thedfirjournal.com/posts/m365-data-exfiltration-rclone/ | ||
drilldown_searches: | ||
- name: View the detection results for - "$user$" | ||
search: '%original_detection_search% | search user = "$user$"' | ||
earliest_offset: $info_min_time$ | ||
latest_offset: $info_max_time$ | ||
- name: View risk events for the last 7 days for - "$user$" | ||
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)`' | ||
earliest_offset: $info_min_time$ | ||
latest_offset: $info_max_time$ | ||
- name: Investigate file access by $user$ | ||
search: '`o365_management_activity` Operation IN ("fileaccessed") UserId="$UserId$"' | ||
earliest_offset: $info_min_time$ | ||
latest_offset: $info_max_time$ | ||
rba: | ||
message: The user $user$ accessed an excessive number of files [$count$] from $file_path$ using $src$ | ||
risk_objects: | ||
- field: user | ||
type: user | ||
score: 20 | ||
threat_objects: | ||
- field: src | ||
type: ip_address | ||
tags: | ||
analytic_story: | ||
- Data Exfiltration | ||
- Office 365 Account Takeover | ||
asset_type: O365 Tenant | ||
mitre_attack_id: | ||
- T1567 | ||
- T1530 | ||
product: | ||
- Splunk Enterprise | ||
- Splunk Enterprise Security | ||
- Splunk Cloud | ||
security_domain: threat | ||
tests: | ||
- name: True Positive Test | ||
attack_data: | ||
- data: https://media.githubusercontent.com/media/splunk/attack_data/master/datasets/attack_techniques/T1567/o365_sus_file_activity/o365_sus_file_activity.log | ||
source: o365 | ||
sourcetype: o365:management:activity |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
name: O365 Exfiltration via File Download | ||
id: 06b23921-bfe2-4576-89dd-616f06e129da | ||
version: 1 | ||
date: '2024-10-14' | ||
author: Steven Dick | ||
status: production | ||
type: Anomaly | ||
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. | ||
data_source: | ||
- Office 365 Universal Audit Log | ||
search: |- | ||
`o365_management_activity` Operation IN ("filedownloaded") | ||
| eval user = replace(mvindex(split(lower(UserId),"#ext#"),0),"_","@"), user_flat = replace(UserId, "[^A-Za-z0-9]","_") | ||
| 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 | ||
| rename SiteUrl as file_path,Workload as app | ||
| where count > 50 | ||
| `security_content_ctime(firstTime)` | ||
| `security_content_ctime(lastTime)` | ||
| `o365_exfiltration_via_file_download_filter` | ||
how_to_implement: You must install the Splunk Microsoft Office 365 Add-on and ingest Office 365 management activity events. | ||
known_false_positives: It is possible that certain file download scenarios may trigger this alert, specifically OneDrive syncing. Adjust threshold and filtering as needed. | ||
references: | ||
- https://attack.mitre.org/techniques/T1567/exfil | ||
- https://www.varonis.com/blog/sidestepping-detection-while-exfiltrating-sharepoint-data | ||
- https://thedfirjournal.com/posts/m365-data-exfiltration-rclone/ | ||
drilldown_searches: | ||
- name: View the detection results for - "$user$" | ||
search: '%original_detection_search% | search user = "$user$"' | ||
earliest_offset: $info_min_time$ | ||
latest_offset: $info_max_time$ | ||
- name: View risk events for the last 7 days for - "$user$" | ||
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)`' | ||
earliest_offset: $info_min_time$ | ||
latest_offset: $info_max_time$ | ||
- name: Investigate file downloads by $user$ | ||
search: '`o365_management_activity` Operation IN ("filedownloaded") UserId="$UserId$"' | ||
earliest_offset: $info_min_time$ | ||
latest_offset: $info_max_time$ | ||
rba: | ||
message: The user $user$ downloaded an excessive number of files [$count$] from $file_path$ using $src$ | ||
risk_objects: | ||
- field: user | ||
type: user | ||
score: 25 | ||
threat_objects: | ||
- field: src | ||
type: ip_address | ||
tags: | ||
analytic_story: | ||
- Data Exfiltration | ||
- Office 365 Account Takeover | ||
asset_type: O365 Tenant | ||
mitre_attack_id: | ||
- T1567 | ||
- T1530 | ||
product: | ||
- Splunk Enterprise | ||
- Splunk Enterprise Security | ||
- Splunk Cloud | ||
security_domain: threat | ||
tests: | ||
- name: True Positive Test | ||
attack_data: | ||
- data: https://media.githubusercontent.com/media/splunk/attack_data/master/datasets/attack_techniques/T1567/o365_sus_file_activity/o365_sus_file_activity.log | ||
source: o365 | ||
sourcetype: o365:management:activity |
67 changes: 67 additions & 0 deletions
67
detections/cloud/o365_exfiltration_via_file_sync_download.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
name: O365 Exfiltration via File Sync Download | ||
id: 350837b5-13d3-4c06-b688-db07afbe5050 | ||
version: 1 | ||
date: '2024-10-14' | ||
author: Steven Dick | ||
status: production | ||
type: Anomaly | ||
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. | ||
data_source: | ||
- Office 365 Universal Audit Log | ||
search: |- | ||
`o365_management_activity` Operation IN ("filesyncdownload*") UserAgent="*SkyDriveSync*" | ||
| eval user = replace(mvindex(split(lower(UserId),"#ext#"),0),"_","@"), user_flat = replace(UserId, "[^A-Za-z0-9]","_") | ||
| where NOT match(SiteUrl,user_flat) | ||
| 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 | ||
| rename SiteUrl as file_path,Workload as app | ||
| where count > 50 | ||
| `security_content_ctime(firstTime)` | ||
| `security_content_ctime(lastTime)` | ||
| `o365_exfiltration_via_file_sync_download_filter` | ||
how_to_implement: You must install the Splunk Microsoft Office 365 Add-on and ingest Office 365 management activity events. | ||
known_false_positives: It is possible that certain file sync scenarios may trigger this alert, specifically OneNote. Adjust threshold and filtering as needed. | ||
references: | ||
- https://attack.mitre.org/techniques/T1567/exfil | ||
- https://www.varonis.com/blog/sidestepping-detection-while-exfiltrating-sharepoint-data | ||
- https://thedfirjournal.com/posts/m365-data-exfiltration-rclone/ | ||
drilldown_searches: | ||
- name: View the detection results for - "$user$" | ||
search: '%original_detection_search% | search user = "$user$"' | ||
earliest_offset: $info_min_time$ | ||
latest_offset: $info_max_time$ | ||
- name: View risk events for the last 7 days for - "$user$" | ||
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)`' | ||
earliest_offset: $info_min_time$ | ||
latest_offset: $info_max_time$ | ||
- name: Investigate file sync downloads by $user$ | ||
search: '`o365_management_activity` Operation IN ("filesyncdownload*") UserId="$UserId$"' | ||
earliest_offset: $info_min_time$ | ||
latest_offset: $info_max_time$ | ||
rba: | ||
message: The user $user$ synced an excessive number of files [$count$] from $file_path$ using $src$ | ||
risk_objects: | ||
- field: user | ||
type: user | ||
score: 25 | ||
threat_objects: | ||
- field: src | ||
type: ip_address | ||
tags: | ||
analytic_story: | ||
- Data Exfiltration | ||
- Office 365 Account Takeover | ||
asset_type: O365 Tenant | ||
mitre_attack_id: | ||
- T1567 | ||
- T1530 | ||
product: | ||
- Splunk Enterprise | ||
- Splunk Enterprise Security | ||
- Splunk Cloud | ||
security_domain: threat | ||
tests: | ||
- name: True Positive Test | ||
attack_data: | ||
- data: https://media.githubusercontent.com/media/splunk/attack_data/master/datasets/attack_techniques/T1567/o365_sus_file_activity/o365_sus_file_activity.log | ||
source: o365 | ||
sourcetype: o365:management:activity |
62 changes: 62 additions & 0 deletions
62
detections/endpoint/potential_telegram_api_request_via_commandline.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
name: Potential Telegram API Request Via CommandLine | ||
id: d6b0d627-d0bf-46b1-936f-c48284767d21 | ||
version: 1 | ||
date: '2025-02-19' | ||
author: Nasreddine Bencherchali, Splunk, Zaki Zarkasih Al Mustafa | ||
status: production | ||
type: Anomaly | ||
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. | ||
data_source: | ||
- Sysmon EventID 1 | ||
- Windows Event Log Security 4688 | ||
- CrowdStrike ProcessRollup2 | ||
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`' | ||
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. | ||
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. | ||
references: | ||
- https://www.virustotal.com/gui/file/0b3ef5e04329cefb5bb4bf30b3edcb32d1ec6bbcb29d22695a079bfb5b56e8ac/behavior | ||
- https://www.virustotal.com/gui/file/72c59eeb15b5ec1d95e72e4b06a030bc058822bc10e5cb807e78a4624d329666/behavior | ||
- https://www.virustotal.com/gui/file/72c59eeb15b5ec1d95e72e4b06a030bc058822bc10e5cb807e78a4624d329666/content | ||
- https://www.virustotal.com/gui/file/1c4541bf70b6e251ef024ec4dde8dce400539c2368461c0d90e15a81b11ace44/content | ||
drilldown_searches: | ||
- name: View the detection results for - "$dest$" | ||
search: '%original_detection_search% | search dest = "$dest$"' | ||
earliest_offset: $info_min_time$ | ||
latest_offset: $info_max_time$ | ||
- name: View risk events for the last 7 days for - "$dest$" | ||
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)`' | ||
earliest_offset: $info_min_time$ | ||
latest_offset: $info_max_time$ | ||
rba: | ||
message: Process $process_name$ with command line $process$ in $dest$ | ||
risk_objects: | ||
- field: dest | ||
type: system | ||
score: 30 | ||
threat_objects: | ||
- field: process_name | ||
type: process_name | ||
tags: | ||
analytic_story: | ||
- XMRig | ||
asset_type: Endpoint | ||
mitre_attack_id: | ||
- T1102.002 | ||
- T1041 | ||
product: | ||
- Splunk Enterprise | ||
- Splunk Enterprise Security | ||
- Splunk Cloud | ||
security_domain: endpoint | ||
tests: | ||
- name: True Positive Test | ||
attack_data: | ||
- data: | ||
https://media.githubusercontent.com/media/splunk/attack_data/master/datasets/attack_techniques/T1102.002/telegram_api_cli/telegram_cli.log | ||
source: XmlWinEventLog:Microsoft-Windows-Sysmon/Operational | ||
sourcetype: XmlWinEventLog |