Detect Transfer Data to Cloud Account in Splunk
Adversaries may exfiltrate data by transferring it to another cloud account they control on the same service. This technique abuses native cloud APIs, storage sharing mechanisms, and CLI tools (such as AzCopy, megatools, or AWS CLI) to move data across cloud account boundaries while blending into normal cloud traffic. Detection is complicated because the traffic stays within the provider's internal network and may not trigger perimeter data loss controls. Common methods include: sharing VM disk snapshots or AMIs to attacker-controlled accounts, generating shared access signature (SAS) URIs or pre-signed S3 URLs for anonymous access, using AzCopy or AWS S3 sync to copy storage contents cross-account, and creating cloud instance backups then exporting them to external subscriptions.
MITRE ATT&CK
- Tactic
- Exfiltration
- Technique
- T1537 Transfer Data to Cloud Account
- Canonical reference
- https://attack.mitre.org/techniques/T1537/
SPL Detection Query
| union
[search index=wineventlog sourcetype="XmlWinEventLog:Microsoft-Windows-Sysmon/Operational" EventCode=1
(Image="*\\azcopy.exe" OR CommandLine="*azcopy*")
(CommandLine="*copy*" OR CommandLine="*sync*" OR CommandLine="*cp *")
(CommandLine="*blob.core.windows.net*" OR CommandLine="*mega.nz*" OR CommandLine="*megatools*" OR CommandLine="*megacopy*" OR CommandLine="*megaput*")
| eval SignalType="AzCopy_Exfil"
| eval ExternalDest=if(match(CommandLine, "mega\.nz|megatools|megacopy|megaput"), "MEGA", if(match(CommandLine, "blob\.core\.windows\.net"), "AzureBlob", "Unknown"))
| table _time, host, User, Image, CommandLine, ParentImage, ParentCommandLine, SignalType, ExternalDest]
[search index=wineventlog sourcetype="XmlWinEventLog:Microsoft-Windows-Sysmon/Operational" EventCode=1
(Image="*\\powershell.exe" OR Image="*\\pwsh.exe" OR Image="*\\az.cmd" OR Image="*\\python.exe")
(CommandLine="*New-AzStorageBlobSASToken*" OR CommandLine="*New-AzStorageContainerSASToken*" OR CommandLine="*New-AzStorageAccountSASToken*"
OR CommandLine="*az storage*generate-sas*" OR CommandLine="*generate-sas*" OR CommandLine="*GenerateSasUri*")
| eval SignalType="SAS_Token_Generation"
| eval ExternalDest="AzureSAS"
| table _time, host, User, Image, CommandLine, ParentImage, ParentCommandLine, SignalType, ExternalDest]
[search index=wineventlog sourcetype="XmlWinEventLog:Microsoft-Windows-Sysmon/Operational" EventCode=1
(Image="*\\powershell.exe" OR Image="*\\pwsh.exe" OR Image="*\\az.cmd" OR Image="*\\aws.exe")
(CommandLine="*az snapshot create*" OR CommandLine="*az disk create*" OR CommandLine="*az snapshot grant-access*"
OR CommandLine="*New-AzSnapshot*" OR CommandLine="*Grant-AzSnapshotAccess*"
OR CommandLine="*ec2 copy-snapshot*" OR CommandLine="*ec2 modify-snapshot-attribute*"
OR CommandLine="*ec2 create-image*" OR CommandLine="*modify-image-attribute*")
| eval SignalType="Snapshot_Export"
| eval ExternalDest=if(match(CommandLine, "ec2|aws"), "AWS", "Azure")
| table _time, host, User, Image, CommandLine, ParentImage, ParentCommandLine, SignalType, ExternalDest]
[search index=wineventlog sourcetype="XmlWinEventLog:Microsoft-Windows-Sysmon/Operational" EventCode=1
(Image="*\\megacopy.exe" OR Image="*\\megaput.exe" OR Image="*\\MegaSync.exe" OR Image="*\\megacmd.exe"
OR CommandLine="*mega.nz*" OR CommandLine="*megatools*" OR CommandLine="*megacopy*" OR CommandLine="*megaput*")
| eval SignalType="Mega_Upload_Tool"
| eval ExternalDest="MEGA"
| table _time, host, User, Image, CommandLine, ParentImage, ParentCommandLine, SignalType, ExternalDest]
| sort - _time
| table _time, host, User, Image, CommandLine, ParentImage, ParentCommandLine, SignalType, ExternalDest Detects T1537 cloud exfiltration signals using Sysmon Event ID 1 (Process Creation) via a union of four detection branches: AzCopy targeting external blob storage or Mega, SAS token generation via PowerShell/Azure CLI, cloud snapshot export commands, and Mega.nz upload tool execution. The union pattern allows each branch to independently contribute detections while producing a unified output table for analyst review.
Data Sources
Required Sourcetypes
False Positives & Tuning
- Legitimate AzCopy usage by cloud operations teams migrating data between organizational subscriptions with proper change management approval
- SAS token generation by approved service accounts in DevOps pipelines for artifact storage and deployment automation
- Authorized use of MegaSync or similar tools for approved external data sharing with partners
- Cloud backup solutions creating snapshots and exporting to secondary DR subscriptions
- Azure Migrate assessments that enumerate and create snapshots of on-premises VM images for cloud migration planning
Other platforms for T1537
Testing Methodology
Validate this detection against 4 adversary techniques from Atomic Red Team. Each test below lists the behaviour to exercise and the telemetry you should expect to see. Executable commands and cleanup steps are available with Pro.
- Test 1AzCopy Transfer to External Azure Blob Storage
Expected signal: Sysmon Event ID 1: Process Create with Image=azcopy.exe (or azcopy path), CommandLine containing 'copy' and 'blob.core.windows.net' with a SAS token signature. Sysmon Event ID 3: Network Connection from azcopy.exe to TESTACCOUNT.blob.core.windows.net:443. Sysmon Event ID 11: File access events for the source files being read. AzCopy job log created at %USERPROFILE%\.azcopy\*.log.
- Test 2Azure SAS Token Generation via PowerShell
Expected signal: Sysmon Event ID 1: Process Create with Image=powershell.exe, CommandLine containing 'New-AzStorageContainerSASToken', '-Permission', 'rwdl', and '-ExpiryTime'. PowerShell ScriptBlock Log Event ID 4104 with full script contents including the SAS generation call. Sysmon Event ID 3: Network connection from powershell.exe to management.azure.com:443 for the Az module API calls.
- Test 3Azure Snapshot Creation and Export via Azure CLI
Expected signal: Sysmon Event ID 1 (two events): (1) az.cmd process with CommandLine 'az snapshot create ... --source /subscriptions/...'. (2) az.cmd with CommandLine 'az snapshot grant-access ... --duration-in-seconds 3600'. Sysmon Event ID 3: Network connections from az.cmd to management.azure.com:443. Azure Activity Log entries: OperationName=Microsoft.Compute/snapshots/write (Success) and Microsoft.Compute/snapshots/beginGetAccess/action (Success) — visible in AzureActivity table in Log Analytics within ~5 minutes.
- Test 4Mega.nz Upload Tool Execution (megatools)
Expected signal: Sysmon for Linux (or auditd) process creation event: Image=/usr/bin/megaput, CommandLine containing '--username', '--path', and the local file path. Sysmon Event ID 3 (Linux): Network connection from megaput to g.api.mega.co.nz:443 (initial API auth) and *.userstorage.mega.co.nz:443 (actual upload). Auditd SYSCALL record type=EXECVE with megaput binary. Linux /var/log/auth.log or syslog may record the process execution depending on auditing configuration.
References (14)
- https://attack.mitre.org/techniques/T1537/
- https://tldrsec.com/p/blog-lesser-known-aws-attacks
- https://docs.microsoft.com/en-us/rest/api/storageservices/delegate-access-with-shared-access-signature
- https://learn.microsoft.com/en-us/azure/storage/common/storage-sas-overview
- https://docs.microsoft.com/en-us/azure/storage/blobs/snapshots-overview
- https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-modifying-snapshot-permissions.html
- https://cdn.cnn.com/cnn/2018/images/07/13/gru.indictment.pdf
- https://www.microsoft.com/en-us/security/blog/2024/09/26/storm-0501-ransomware-attacks-expanding-to-hybrid-cloud-environments/
- https://www.secureworks.com/research/gold-ionic-inc-ransom
- https://www.group-ib.com/resources/research/redcurl/
- https://learn.microsoft.com/en-us/azure/storage/common/storage-use-azcopy-v10
- https://github.com/megous/megatools
- https://learn.microsoft.com/en-us/azure/azure-monitor/reference/tables/azureactivity
- https://learn.microsoft.com/en-us/defender-endpoint/advanced-hunting-devicenetworkevents-table
Unlock Pro Content
Get the full detection package for T1537 including response playbook, investigation guide, and atomic red team tests.