Exfiltration Over Web Service

Adversaries may use an existing, legitimate external Web service to exfiltrate data rather than their primary command and control channel. Popular Web services acting as an exfiltration mechanism may give a significant amount of cover due to the likelihood that hosts within a network are already communicating with them prior to compromise. Firewall rules may also already exist to permit traffic to these services.

Web service providers also commonly use SSL/TLS encryption, giving adversaries an added level of protection.

ID: T1567
Sub-techniques:  T1567.001, T1567.002, T1567.003, T1567.004
Tactic: Exfiltration
Platforms: ESXi, Linux, Office Suite, SaaS, Windows, macOS
Contributors: William Cain
Version: 1.5
Created: 09 March 2020
Last Modified: 15 April 2025

Procedure Examples

ID Name Description
S0622 AppleSeed

AppleSeed has exfiltrated files using web services.[1]

G0007 APT28

APT28 can exfiltrate data over Google Drive.[2]

C0051 APT28 Nearest Neighbor Campaign

During APT28 Nearest Neighbor Campaign, APT28 exfiltrated data over public-facing webservers – such as Google Drive.[3]

G1043 BlackByte

BlackByte has used services such as anonymfiles.com and file.io to exfiltrate victim data.[4]

C0017 C0017

During C0017, APT41 used Cloudflare services for data exfiltration.[5]

S0547 DropBook

DropBook has used legitimate web services to exfiltrate data.[6]

S1179 Exbyte

Exbyte exfiltrates collected data to online file hosting sites such as Mega.co.nz.[7][8]

G0059 Magic Hound

Magic Hound has used the Telegram API sendMessage to relay data on compromised devices.[9]

S0508 ngrok

ngrok has been used by threat actors to configure servers for data exfiltration.[10]

S1171 OilCheck

OilCheck can upload documents from compromised hosts to a shared Microsoft Office 365 Outlook email account for exfiltration.[11]

S1168 SampleCheck5000

SampleCheck5000 can use the Microsoft Office Exchange Web Services API to access an actor-controlled account and retrieve files for exfiltration.[12][11]

Mitigations

ID Mitigation Description
M1057 Data Loss Prevention

Data loss prevention can be detect and block sensitive data being uploaded to web services via web browsers.

M1021 Restrict Web-Based Content

Web proxies can be used to enforce an external network communication policy that prevents use of unauthorized external services.

Detection

ID Data Source Data Component Detects
DS0015 Application Log Application Log Content

Review logs for SaaS services, including Office 365 and Google Workspace, to detect the configuration of new webhooks or other features that could be abused to exfiltrate data.

Analytic 1 - Detecting Large File Uploads to Web Services

(EventCode="FileUploaded" OR EventCode="PutObject" OR source="O365_audit" OR source="Google_Admin_Logs")| where (file_size > 5000000) // Detects files larger than 5MB
| stats count by _time, host, user, action, service_name, file_size| where count >= 3| eval risk_score=case( file_size > 50000000, 9, // High-risk large file transfer file_size > 5000000, 8)| where risk_score >= 8| table _time, host, user, action, service_name, file_size, risk_score

DS0017 Command Command Execution

Monitor for execution of cloud storage CLI tools (e.g., AWS CLI, rclone, gdrive, azcopy, gsutil), scripts automating file transfers to cloud services, or use of PowerShell or Bash to upload files to external web services.

Analytic 1 - Detecting Web Service File Upload via CLI Tools

(EventCode=1 OR source="/var/log/audit/audit.log" type="execve")| where (command IN ("rclone copy", "aws s3 cp", "gsutil cp", "azcopy copy", "curl -T", "wget --post-file"))| eval risk_score=case( command IN ("rclone copy", "aws s3 cp"), 9, command IN ("curl -T", "wget --post-file"), 8)| where risk_score >= 8| stats count by _time, host, user, command, risk_score

DS0022 File File Access

Monitor for files being accessed by an existing, legitimate external Web service to exfiltrate data rather than their primary command and control channel.

Analytic 1 - Detecting File Staging Before Web Service Upload

(EventCode=11 OR EventCode=4663 OR source="/var/log/audit/audit.log" type="open")| where (file_path IN ("/tmp/", "/var/tmp/", "/home//Downloads/", "C:\Users\\Documents\exfil"))| eval risk_score=case( file_path LIKE "/tmp/%", 9, file_path LIKE "C:\Users\\Documents\exfil", 8)| where risk_score >= 8| stats count by _time, host, user, file_path, risk_score

DS0029 Network Traffic Network Connection Creation

Monitor for newly constructed network connections to web and cloud services associated with abnormal or non-browser processes.

Analytic 1 - Detecting Large Data Transfers to Web Services

(EventCode=3 OR source="zeek_conn.log" OR source="firewall_logs")| where (dest_ip IN (known_cloud_services) AND bytes_out > 5000000)| stats count, sum(bytes_out) as total_bytes by _time, host, process, dest_ip| where total_bytes > 50000000| eval risk_score=case( total_bytes > 100000000, 9, total_bytes > 50000000, 8)| where risk_score >= 8| table host, dest_ip, total_bytes, risk_score

Network Traffic Content

Monitor and analyze traffic patterns and packet inspection associated to protocol(s) that do not follow the expected protocol standards and traffic flows (e.g extraneous packets that do not belong to established flows, gratuitous or anomalous traffic patterns, anomalous syntax, or structure). Consider correlation with process monitoring and command line to detect anomalous processes execution and command line arguments associated to traffic patterns (e.g. monitor anomalies in use of files that do not normally initiate connections for respective protocol(s)).

Network Traffic Flow

Monitor network data for uncommon data flows. Processes utilizing the network that do not normally have network communication or have never been seen before are suspicious.

References