name: Mailsniper Invoke functions id: a36972c8-b894-11eb-9f78-acde48001122 version: 2 date: '2022-05-02' author: Teoderick Contreras, Splunk type: TTP datamodel: - Endpoint description: This search is to detect known mailsniper.ps1 functions executed in a machine. This technique was seen in some attacker to harvest some sensitive e-mail in a compromised exchange server. 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 | `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 confidence: 80 context: - Source:Endpoint - Stage:Exfiltration dataset: - https://media.githubusercontent.com/media/splunk/attack_data/master/datasets/attack_techniques/T1059.001/powershell_script_block_logging/sbl_xml.log impact: 90 kill_chain_phases: - Exploitation message: mailsniper.ps1 functions $ScriptBlockText$ executed on a $Computer$ by user $user$. mitre_attack_id: - T1114 - T1114.001 observable: - name: Computer 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 asset_type: Endpoint