-
Notifications
You must be signed in to change notification settings - Fork 375
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
211 additions
and
0 deletions.
There are no files selected for viewing
70 changes: 70 additions & 0 deletions
70
detections/endpoint/windows_account_access_removal_via_powershell_initiate_logoff.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,70 @@ | ||
name: 'Windows Account Access Removal via Powershell Initiate Logoff' | ||
id: 223572ab-8768-4e20-9b39-c38707af80dc | ||
version: 1 | ||
date: '2024-12-17' | ||
author: Teoderick Contreras, Splunk | ||
data_sources: | ||
- Sysmon EventID 1 | ||
- Windows Event Log Security 4688 | ||
type: Anomaly | ||
status: production | ||
description: The following analytic detects the process of logging off a user through the use of the quser and logoff commands. By monitoring for these commands, the analytic identifies actions where a user session is forcibly terminated, which could be part of an administrative task or a potentially unauthorized access attempt. This detection helps identify potential misuse or malicious activity where a user’s access is revoked without proper authorization, providing insight into potential security incidents involving account management or session manipulation. | ||
kind: endpoint | ||
search: '| tstats `security_content_summariesonly` min(_time) as firstTime max(_time) as lastTime from datamodel=Endpoint.Processes | ||
where Processes.parent_process_name = powershell.exe AND Processes.process_name = logoff.exe | ||
by Processes.parent_process_name Processes.parent_process Processes.process_name Processes.process Processes.process_guid Processes.dest Processes.user | ||
| `drop_dm_object_name(Processes)` | ||
| `security_content_ctime(firstTime)` | ||
| `security_content_ctime(lastTime)` | ||
| `windows_account_access_removal_via_powershell_initiate_logoff_filter`' | ||
how_to_implement: The following Hunting analytic requires PowerShell operational logs to be imported. Modify the powershell macro as needed to match the sourcetype or add index. This analytic is specific to 4104, or PowerShell Script Block Logging. | ||
known_false_positives: Administrators or power users may use this command. | ||
references: | ||
- https://devblogs.microsoft.com/scripting/automating-quser-through-powershell/ | ||
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$ | ||
tags: | ||
analytic_story: | ||
- Crypto Stealer | ||
asset_type: Endpoint | ||
confidence: 50 | ||
impact: 50 | ||
message: Powershell process having commandline [$ScriptBlockText$] used to logoff user on [$dest$]. | ||
mitre_attack_id: | ||
- T1531 | ||
- T1059.001 | ||
- T1059 | ||
observable: | ||
- name: dest | ||
type: Hostname | ||
role: | ||
- Victim | ||
- name: user | ||
type: User | ||
role: | ||
- Victim | ||
product: | ||
- Splunk Enterprise | ||
- Splunk Enterprise Security | ||
- Splunk Cloud | ||
required_fields: | ||
- _time | ||
- EventCode | ||
- Message | ||
- dest | ||
- user | ||
risk_score: 25 | ||
security_domain: endpoint | ||
tests: | ||
- name: True Positive Test | ||
attack_data: | ||
- data: https://media.githubusercontent.com/media/splunk/attack_data/master/datasets/attack_techniques/T1531/powershell_log_process_tree/powershell_logoff.log | ||
source: XmlWinEventLog:Microsoft-Windows-Sysmon/Operational | ||
sourcetype: XmlWinEventLog |
67 changes: 67 additions & 0 deletions
67
detections/endpoint/windows_bidirectional_communication_via_telegram_bot.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: Windows Bidirectional Communication via Telegram Bot | ||
id: 86f66f44-94d9-412d-a71d-5d8ed0fef72e | ||
version: 1 | ||
date: '2024-12-12' | ||
author: Teoderick Contreras, Splunk | ||
data_sources: | ||
- Sysmon EventID 22 | ||
type: Anomaly | ||
status: production | ||
description: The following analytic detects the use of DNS API calls associated with Telegram, which may indicate access via a Telegram bot commonly used by malware for command and control (C2) communications. By monitoring DNS queries related to Telegram's infrastructure, the detection identifies potential attempts to establish covert communication channels between a compromised system and external malicious actors. This behavior is often observed in cyberattacks where Telegram bots are used to receive commands or exfiltrate data, making it a key indicator of suspicious or malicious activity within a network. | ||
kind: endpoint | ||
search: '`sysmon` EventCode=22 query = "api.telegram.org" | ||
| stats count min(_time) as firstTime max(_time) as lastTime by query answer QueryResults QueryStatus process_name process_guid Computer | ||
| rename Computer as dest | ||
| `security_content_ctime(firstTime)` | ||
| `security_content_ctime(lastTime)` | ||
| `windows_bidirectional_communication_via_telegram_bot_filter`' | ||
how_to_implement: To successfully implement this search, you need to be ingesting logs with the process name and eventcode = 22 dnsquery executions from your endpoints. If you are using Sysmon, you must have at least version 6.0.4 of the Sysmon TA. | ||
known_false_positives: a third part automation using telegram API. | ||
references: | ||
- https://www.splunk.com/en_us/blog/security/threat-advisory-telegram-crypto-botnet-strt-ta01.html | ||
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$ | ||
tags: | ||
analytic_story: | ||
- Crypto Stealer | ||
asset_type: Endpoint | ||
confidence: 30 | ||
impact: 30 | ||
message: a DNS query to [$query$] on [$dest$]. | ||
mitre_attack_id: | ||
- T1102.002 | ||
observable: | ||
- name: dest | ||
type: Hostname | ||
role: | ||
- Victim | ||
- name: process_name | ||
type: Process | ||
role: | ||
- Attacker | ||
product: | ||
- Splunk Enterprise | ||
- Splunk Enterprise Security | ||
- Splunk Cloud | ||
required_fields: | ||
- _time | ||
- Image | ||
- QueryName | ||
- QueryStatus | ||
- ProcessId | ||
- dest | ||
risk_score: 9 | ||
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_dns/telegram_dns.log | ||
source: XmlWinEventLog:Microsoft-Windows-Sysmon/Operational | ||
sourcetype: XmlWinEventLog |
74 changes: 74 additions & 0 deletions
74
detections/endpoint/windows_file_and_directory_enable_readonly_permissions.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,74 @@ | ||
name: Windows File and Directory Enable ReadOnly Permissions | ||
id: 1ae407b0-a042-4eb0-834a-590da055575e | ||
version: 1 | ||
date: '2024-12-13' | ||
author: Teoderick Contreras, Splunk | ||
data_sources: | ||
- Sysmon EventID 1 | ||
- Windows Event Log Security 4688 | ||
type: TTP | ||
status: production | ||
description: The following analytic detects instances where file or folder permissions are modified to grant read-only access. Such changes are characterized by the presence of read-related permissions (e.g., R, REA, RA, RD) and the absence of write (W) or execute (E) permissions. Monitoring these events is crucial for tracking access control changes that could be intentional for restricting access or indicative of malicious behavior. Alerts generated by this detection help ensure that legitimate security measures are enforced while unauthorized changes are promptly investigated. | ||
kind: endpoint | ||
search: '| tstats `security_content_summariesonly` min(_time) as firstTime max(_time) as lastTime from datamodel=Endpoint.Processes | ||
where Processes.process_name IN( "icacls.exe", "cacls.exe", "xcacls.exe") AND Processes.process IN ("*/grant*", "*/G*") AND Processes.process IN ("*SYSTEM*", "*admin*", "*S-1-1-0*", "*EVERYONE*") | ||
by Processes.parent_process_name Processes.parent_process Processes.process_name Processes.process Processes.process_guid Processes.dest Processes.user | ||
| `drop_dm_object_name(Processes)` | ||
| rex field=process ":\\((?<permission>[^)]+)\\)" | ||
| eval has_write_execute=if(match(permission, "(W|GE|X|M|F)"), "true", "false") | ||
| where has_write_execute="false" | ||
| `security_content_ctime(firstTime)` | ||
| `security_content_ctime(lastTime)` | ||
| `windows_file_and_directory_enable_readonly_permissions_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: Administrators or administrative scripts may use this application. Filter as needed. | ||
references: | ||
- https://www.splunk.com/en_us/blog/security/-applocker-rules-as-defense-evasion-complete-analysis.html | ||
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$ | ||
tags: | ||
analytic_story: | ||
- Crypto Stealer | ||
asset_type: Endpoint | ||
confidence: 80 | ||
impact: 80 | ||
message: A [$process_name$] was executed on [$dest$] attempting to change the access to a file or directory into readonly permissions. | ||
mitre_attack_id: | ||
- T1222.001 | ||
observable: | ||
- name: dest | ||
type: Hostname | ||
role: | ||
- Victim | ||
- name: process_name | ||
type: Process | ||
role: | ||
- Attacker | ||
product: | ||
- Splunk Enterprise | ||
- Splunk Enterprise Security | ||
- Splunk Cloud | ||
required_fields: | ||
- _time | ||
- Processes.process | ||
- Processes.process_guid | ||
- Processes.process_name | ||
- Processes.parent_process_name | ||
- Processes.dest | ||
- Processes.user | ||
- Processes.parent_process | ||
risk_score: 64 | ||
security_domain: endpoint | ||
tests: | ||
- name: True Positive Test | ||
attack_data: | ||
- data: https://media.githubusercontent.com/media/splunk/attack_data/master/datasets/attack_techniques/T1222.001/icacls_inheritance/icacls_process_1.log | ||
source: XmlWinEventLog:Microsoft-Windows-Sysmon/Operational | ||
sourcetype: XmlWinEventLog |