Detection: Gsuite Email Suspicious Subject With Attachment

Description

The following analytic identifies Gsuite emails with suspicious subjects and attachments commonly used in spear phishing attacks. It leverages Gsuite email logs, focusing on specific keywords in the subject line and known malicious file types in attachments. This activity is significant for a SOC as spear phishing is a prevalent method for initial compromise, often leading to further malicious actions. If confirmed malicious, this activity could result in unauthorized access, data exfiltration, or further malware deployment, posing a significant risk to the organization's security.

 1`gsuite_gmail` num_message_attachments > 0 subject IN ("*dhl*", "* ups *", "*delivery*", "*parcel*", "*label*", "*invoice*", "*postal*", "* fedex *", "* usps *", "* express *", "*shipment*", "*Banking/Tax*","*shipment*", "*new order*") attachment{}.file_extension_type IN ("doc", "docx", "xls", "xlsx", "ppt", "pptx", "pdf", "zip", "rar", "html","htm","hta") 
 2| rex field=source.from_header_address "[^@]+@(?<source_domain>[^@]+)" 
 3| rex field=destination{}.address "[^@]+@(?<dest_domain>[^@]+)" 
 4| where not source_domain="internal_test_email.com" and dest_domain="internal_test_email.com" 
 5| eval phase="plan" 
 6| eval severity="medium" 
 7| 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 
 8| `security_content_ctime(firstTime)` 
 9| `security_content_ctime(lastTime)` 
10| `gsuite_email_suspicious_subject_with_attachment_filter`

Data Source

Name Platform Sourcetype Source
G Suite Gmail N/A 'gsuite:gmail:bigquery' 'http:gsuite'

Macros Used

Name Value
gsuite_gmail sourcetype=gsuite:gmail:bigquery
gsuite_email_suspicious_subject_with_attachment_filter search *
gsuite_email_suspicious_subject_with_attachment_filter is an empty macro by default. It allows the user to filter out any results (false positives) without editing the SPL.

Annotations

- MITRE ATT&CK
+ Kill Chain Phases
+ NIST
+ CIS
- Threat Actors
ID Technique Tactic
T1566.001 Spearphishing Attachment Initial Access
T1566 Phishing Initial Access
Delivery
DE.AE
CIS 10

Default Configuration

This detection is configured by default in Splunk Enterprise Security to run with the following settings:

Setting Value
Disabled true
Cron Schedule 0 * * * *
Earliest Time -70m@m
Latest Time -10m@m
Schedule Window auto
Creates Risk Event True
This configuration file applies to all detections of type anomaly. These detections will use Risk Based Alerting.

Implementation

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

normal user or normal transaction may contain the subject and file type attachment that this detection try to search.

Associated Analytic Story

Risk Based Analytics (RBA)

Risk Message:

Suspicious email from $source.address$ to $destination{}.address$

Risk Object Risk Object Type Risk Score Threat Objects
destination{}.address user 25 source.address

References

Detection Testing

Test Type Status Dataset Source Sourcetype
Validation Passing N/A N/A N/A
Unit Passing Dataset http:gsuite gsuite:gmail:bigquery
Integration ✅ Passing Dataset http:gsuite gsuite:gmail:bigquery

Replay any dataset to Splunk Enterprise by using our replay.py tool or the UI. Alternatively you can replay a dataset into a Splunk Attack Range


Source: GitHub | Version: 4