ID | Technique | Tactic |
---|---|---|
T1048.003 | Exfiltration Over Unencrypted Non-C2 Protocol | Exfiltration |
T1048 | Exfiltration Over Alternative Protocol | Exfiltration |
Detection: Gsuite Outbound Email With Attachment To External Domain
Description
The following analytic detects outbound emails with attachments sent from an internal email domain to an external domain. It leverages Gsuite Gmail logs, parsing the source and destination email domains, and flags emails with fewer than 20 outbound instances. This activity is significant as it may indicate potential data exfiltration or insider threats. If confirmed malicious, an attacker could use this method to exfiltrate sensitive information, leading to data breaches and compliance violations.
Search
1`gsuite_gmail` num_message_attachments > 0
2| rex field=source.from_header_address "[^@]+@(?<source_domain>[^@]+)"
3| rex field=destination{}.address "[^@]+@(?<dest_domain>[^@]+)"
4| where source_domain="internal_test_email.com" and not dest_domain="internal_test_email.com"
5| eval phase="plan"
6| eval severity="low"
7| stats values(subject) as subject, values(source.from_header_address) as src_domain_list, count as numEvents, dc(source.from_header_address) as numSrcAddresses, min(_time) as firstTime max(_time) as lastTime by dest_domain phase severity
8| where numSrcAddresses < 20
9|sort - numSrcAddresses
10| `security_content_ctime(firstTime)`
11| `security_content_ctime(lastTime)`
12| `gsuite_outbound_email_with_attachment_to_external_domain_filter`
Data Source
Name | Platform | Sourcetype | Source | Supported App |
---|---|---|---|---|
G Suite Gmail | N/A | 'gsuite:gmail:bigquery' |
'http:gsuite' |
N/A |
Macros Used
Name | Value |
---|---|
gsuite_gmail | sourcetype=gsuite:gmail:bigquery |
gsuite_outbound_email_with_attachment_to_external_domain_filter | search * |
gsuite_outbound_email_with_attachment_to_external_domain_filter
is an empty macro by default. It allows the user to filter out any results (false positives) without editing the SPL.
Annotations
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 | False |
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
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.
Associated Analytic Story
Risk Based Analytics (RBA)
Risk Message | Risk Score | Impact | Confidence |
---|---|---|---|
Suspicious email from $src_domain_list$ to $dest_domain$ | 9 | 30 | 30 |
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: 3