Files
splunk-security_content/detections/endpoint/mailsniper_invoke_functions.yml
2024-06-05 21:05:06 +00:00

69 lines
2.7 KiB
YAML

name: Mailsniper Invoke functions
id: a36972c8-b894-11eb-9f78-acde48001122
version: 3
date: '2024-05-07'
author: Teoderick Contreras, Splunk
status: production
type: TTP
description: The following analytic detects the execution of known MailSniper PowerShell
functions on a machine. It leverages PowerShell logs (EventCode 4104) to identify
specific script block text associated with MailSniper activities. This behavior
is significant as MailSniper is often used by attackers to harvest sensitive emails
from compromised Exchange servers. If confirmed malicious, this activity could lead
to unauthorized access to sensitive email data, credential theft, and further compromise
of the email infrastructure.
data_source:
- Powershell Script Block Logging 4104
search: '`powershell` EventCode=4104 ScriptBlockText IN ("*Invoke-GlobalO365MailSearch*",
"*Invoke-GlobalMailSearch*", "*Invoke-SelfSearch*", "*Invoke-PasswordSprayOWA*",
"*Invoke-PasswordSprayEWS*","*Invoke-DomainHarvestOWA*", "*Invoke-UsernameHarvestOWA*","*Invoke-OpenInboxFinder*","*Invoke-InjectGEventAPI*","*Invoke-InjectGEvent*","*Invoke-SearchGmail*",
"*Invoke-MonitorCredSniper*", "*Invoke-AddGmailRule*","*Invoke-PasswordSprayEAS*","*Invoke-UsernameHarvestEAS*")
| stats count min(_time) as firstTime max(_time) as lastTime by Opcode Computer
UserID EventCode ScriptBlockText | rename Computer as dest | rename UserID as user
| `security_content_ctime(firstTime)` | `security_content_ctime(lastTime)` | `mailsniper_invoke_functions_filter`'
how_to_implement: To successfully implement this search, you need to be ingesting
logs with the powershell logs from your endpoints. make sure you enable needed
registry to monitor this event.
known_false_positives: unknown
references:
- https://www.blackhillsinfosec.com/introducing-mailsniper-a-tool-for-searching-every-users-email-for-sensitive-data/
tags:
analytic_story:
- Data Exfiltration
asset_type: Endpoint
confidence: 80
impact: 90
message: Potential mailsniper.ps1 functions executed on dest $dest$ by user $user$.
mitre_attack_id:
- T1114
- T1114.001
observable:
- name: dest
type: Endpoint
role:
- Victim
- name: user
type: User
role:
- Victim
product:
- Splunk Enterprise
- Splunk Enterprise Security
- Splunk Cloud
required_fields:
- _time
- ScriptBlockText
- Opcode
- Computer
- UserID
- EventCode
risk_score: 72
security_domain: endpoint
tests:
- name: True Positive Test
attack_data:
- data:
https://media.githubusercontent.com/media/splunk/attack_data/master/datasets/attack_techniques/T1059.001/powershell_script_block_logging/sbl_xml.log
source: XmlWinEventLog:Microsoft-Windows-PowerShell/Operational
sourcetype: xmlwineventlog