GSuite Email Suspicious Attachment

Original Source: [splunk source]
Name:GSuite Email Suspicious Attachment
id:6d663014-fe92-11eb-ab07-acde48001122
version:3
date:2024-09-30
author:Teoderick Contreras, Splunk
status:production
type:Anomaly
Description:The following analytic detects suspicious attachment file extensions in GSuite emails, potentially indicating a spear-phishing attack. It leverages GSuite Gmail logs to identify emails with attachments having file extensions commonly associated with malware, such as .exe, .bat, and .js. This activity is significant as these file types are often used to deliver malicious payloads, posing a risk of compromising targeted machines. If confirmed malicious, this could lead to unauthorized code execution, data breaches, or further network infiltration.
Data_source:
  • -G Suite Gmail
search:`gsuite_gmail` "attachment{}.file_extension_type" IN ("pl", "py", "rb", "sh", "bat", "exe", "dll", "cpl", "com", "js", "vbs", "ps1", "reg","swf", "cmd", "go")
| eval phase="plan"
| eval severity="medium"
| stats count min(_time) as firstTime max(_time) as lastTime values(attachment{}.file_extension_type) as email_attachments, values(attachment{}.sha256) as attachment_sha256, values(payload_size) as payload_size by destination{}.service num_message_attachments subject destination{}.address source.address phase severity
| `security_content_ctime(firstTime)`
| `security_content_ctime(lastTime)`
| `gsuite_email_suspicious_attachment_filter`


how_to_implement:To successfully implement this search, you need to be ingesting logs related to gsuite having the file attachment metadata like file type, file extension, source email, destination email, num of attachment and etc.
known_false_positives:network admin and normal user may send this file attachment as part of their day to day work. having a good protocol in attaching this file type to an e-mail may reduce the risk of having a spear phishing attack.
References:
  -https://www.redhat.com/en/topics/devops/what-is-devsecops
drilldown_searches:
name:'View the detection results for - "$destination{}.address$"'
search:'%original_detection_search% | search destination{}.address = "$destination{}.address$"'
earliest_offset:'$info_min_time$'
latest_offset:'$info_max_time$'
name:'View risk events for the last 7 days for - "$destination{}.address$"'
search:'| from datamodel Risk.All_Risk | search normalized_risk_object IN ("$destination{}.address$") 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:
    - 'Dev Sec Ops'
  asset_type:GSuite
  confidence:70
  impact:70
  message:Suspicious email from $source.address$ to $destination{}.address$
  mitre_attack_id:
    - 'T1566.001'
    - 'T1566'
  observable:
    name:'source.address'
    type:'Email Address'
    - role:
      - 'Attacker'
    name:'destination{}.address'
    type:'Email Address'
    - role:
      - 'Victim'
  product:
    - 'Splunk Enterprise'
    - 'Splunk Enterprise Security'
    - 'Splunk Cloud'
  required_fields:
    - '_time'
    - 'attachment{}.file_extension_type'
    - 'attachment{}.sha256'
    - 'destination{}.service'
    - 'num_message_attachments'
    - 'payload_size'
    - 'subject'
    - 'destination{}.address'
    - 'source.address'
  risk_score:49
  security_domain:endpoint

tests:
name:'True Positive Test'
 attack_data:
  data: https://media.githubusercontent.com/media/splunk/attack_data/master/datasets/attack_techniques/T1566.001/gsuite_susp_attachment_ext/gsuite_gmail_file_ext.log
  source: http:gsuite
  sourcetype: gsuite:gmail:bigquery
manual_test:None

Related Analytic Stories


Dev Sec Ops