Detect Transfer Data to Cloud Account in Elastic Security
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/
Elastic Detection Query
process where event.type == "start" and (
(
process.name : ("azcopy.exe", "azcopy") and
process.command_line : ("*copy*", "*sync*", "*cp *") and
(
process.command_line : "*blob.core.windows.net*" or
process.command_line : "*mega.nz*" or
process.command_line : "*megatools*" or
process.command_line : "*megacopy*" or
process.command_line : "*megaput*" or
process.command_line : "*s3.amazonaws.com*"
)
) or
(
process.name : ("powershell.exe", "pwsh.exe", "az.cmd", "az", "python.exe", "python3") and
(
process.command_line : "*New-AzStorageBlobSASToken*" or
process.command_line : "*New-AzStorageContainerSASToken*" or
process.command_line : "*New-AzStorageAccountSASToken*" or
process.command_line : "*az storage*generate-sas*" or
process.command_line : "*GenerateSasUri*" or
process.command_line : "*generate-sas*"
) and
(
process.command_line : "*--expiry*" or
process.command_line : "*-ExpiryTime*" or
process.command_line : "*--permissions*" or
process.command_line : "*rwdl*" or
process.command_line : "*racwdl*"
)
) or
(
process.name : ("powershell.exe", "pwsh.exe", "az.cmd", "aws.exe", "aws", "python.exe", "python3") and
(
process.command_line : "*az snapshot create*" or
process.command_line : "*az disk create*" or
process.command_line : "*az snapshot grant-access*" or
process.command_line : "*New-AzSnapshot*" or
process.command_line : "*Grant-AzSnapshotAccess*" or
process.command_line : "*ec2 copy-snapshot*" or
process.command_line : "*ec2 modify-snapshot-attribute*" or
process.command_line : "*ec2 create-image*" or
process.command_line : "*ec2 modify-image-attribute*" or
process.command_line : "*CreateSnapshot*" or
process.command_line : "*CopySnapshot*"
)
) or
(
process.name : ("megacopy.exe", "megaput.exe", "megals.exe", "MegaSync.exe", "megatools.exe", "megacmd.exe", "mega-put", "mega-copy") or
(
process.command_line : "*mega.nz*" or
process.command_line : "*megatools*" or
process.command_line : "*megacopy*" or
process.command_line : "*megaput*" or
process.command_line : "*MegaSync*"
)
)
) Detects T1537 (Transfer Data to Cloud Account) across four signal types: AzCopy exfiltration to external blob storage or MEGA, SAS token generation for cross-account access, cloud disk snapshot creation and export (Azure/AWS), and direct use of MEGA upload tools. Uses Elastic Common Schema process fields sourced from Elastic Endpoint Security or Winlogbeat with Sysmon.
Data Sources
Required Tables
False Positives & Tuning
- Authorized cloud migration or disaster recovery teams running AzCopy to sync data between storage accounts within the same tenant during planned migrations.
- DevOps or infrastructure engineers creating Azure disk snapshots or AWS AMIs as part of routine backup automation or infrastructure-as-code pipelines.
- Security or IT teams generating short-lived SAS tokens for legitimate third-party vendor data sharing agreements with documented approval.
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.