T1560 Microsoft Sentinel · KQL

Detect Archive Collected Data in Microsoft Sentinel

Adversaries may compress and/or encrypt data that is collected prior to exfiltration. Compressing the data can help to obfuscate collected data and minimize the amount of data sent over the network. Encryption can be used to hide information that is being exfiltrated from detection or make exfiltration less conspicuous upon inspection by a defender. Both compression and encryption are done prior to exfiltration and can be performed using a utility, third-party library, or custom method. Common tools include 7-Zip, WinRAR, the Windows built-in compact and certutil utilities, PowerShell Compress-Archive and .NET IO.Compression classes, and tar/gzip/openssl on Linux and macOS. Threat actors including Dragonfly, Lazarus Group, Ember Bear, BlackByte, and Axiom have all used archiving and encryption as a pre-exfiltration staging step. Sub-techniques cover archive via utility (T1560.001), archive via library (T1560.002), and archive via custom method (T1560.003).

MITRE ATT&CK

Tactic
Collection
Technique
T1560 Archive Collected Data
Canonical reference
https://attack.mitre.org/techniques/T1560/

KQL Detection Query

Microsoft Sentinel (KQL)
kusto
let ArchiveUtilities = dynamic(["7z.exe", "7za.exe", "7zr.exe", "rar.exe", "winrar.exe"]);
let SuspiciousParents = dynamic(["winword.exe", "excel.exe", "outlook.exe", "powerpnt.exe", "mshta.exe", "wscript.exe", "cscript.exe", "mmc.exe", "regsvr32.exe", "rundll32.exe"]);
// Detection 1: Password-protected archives — strongest indicator of pre-exfiltration data staging
let PasswordProtectedArchive = DeviceProcessEvents
| where Timestamp > ago(24h)
| where FileName in~ (ArchiveUtilities)
| where ProcessCommandLine has "-hp"
      or ProcessCommandLine has_any ("-pass", "-password")
      or ProcessCommandLine matches regex @"\s+-p\S"
| extend DetectionType = "Password-Protected Archive", RiskLevel = "High";
// Detection 2: Archive utilities spawned by Office apps or scripting engines (macro/script-based staging)
let SuspiciousParentArchive = DeviceProcessEvents
| where Timestamp > ago(24h)
| where FileName in~ (ArchiveUtilities)
| where InitiatingProcessFileName in~ (SuspiciousParents)
| extend DetectionType = "Archive via Suspicious Parent Process", RiskLevel = "High";
// Detection 3: PowerShell compression using .NET classes (custom staging or library-based archiving)
let PSCompression = DeviceProcessEvents
| where Timestamp > ago(24h)
| where FileName in~ ("powershell.exe", "pwsh.exe")
| where ProcessCommandLine has_any ("Compress-Archive", "IO.Compression.ZipFile", "IO.Compression.GZipStream", "System.IO.Compression", "ZipArchive", "DeflateStream", "GZipStream")
| extend DetectionType = "PowerShell .NET Compression", RiskLevel = "Medium";
// Detection 4: certutil base64 encoding — encodes binary blobs for text-channel or clipboard exfiltration
let CertutilEncoding = DeviceProcessEvents
| where Timestamp > ago(24h)
| where FileName =~ "certutil.exe"
| where ProcessCommandLine has_any ("-encode", "-decode", "-encodehex")
| extend DetectionType = "CertUtil Base64 Encoding", RiskLevel = "Medium";
// Combine all detections
union PasswordProtectedArchive, SuspiciousParentArchive, PSCompression, CertutilEncoding
| project Timestamp, DeviceName, AccountName, FileName, ProcessCommandLine,
         InitiatingProcessFileName, InitiatingProcessCommandLine,
         DetectionType, RiskLevel
| sort by Timestamp desc
medium severity high confidence

Detects pre-exfiltration data archiving and encoding activity using Microsoft Defender for Endpoint DeviceProcessEvents. Covers four distinct patterns: (1) archive utilities (7z, rar, winrar) invoked with password-protection flags (-hp, -p, -pass), indicating deliberate data hiding; (2) archive utilities spawned by Office applications or scripting engines suggesting macro or script-driven collection; (3) PowerShell using .NET IO.Compression classes for custom in-memory or on-disk archiving; and (4) certutil -encode/-decode for base64 encoding of binary data prior to text-channel exfiltration. Each detection branch is separately labelled for triage prioritisation.

Data Sources

Process: Process CreationCommand: Command ExecutionMicrosoft Defender for Endpoint

Required Tables

DeviceProcessEvents

False Positives & Tuning

  • IT backup and archiving jobs (Veeam, Acronis, custom scripts) that use 7-Zip or WinRAR with passwords to protect backup archives
  • Software release pipelines packaging artifacts into password-protected zip files for deployment
  • DBA scripts compressing and encrypting database exports or log files before offsite transfer
  • certutil legitimately used by PKI administrators to encode/decode certificate files (.cer, .p7b) for transport
  • PowerShell-based software deployment tools (SCCM, Intune, Ansible) using Compress-Archive to bundle installation packages
Download portable Sigma rule (.yml)

Other platforms for T1560


Testing Methodology

Validate this detection against 5 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.

  1. Test 17-Zip Password-Protected Archive of Sensitive Directory

    Expected signal: Sysmon Event ID 1: Process Create with Image ending in 7z.exe, CommandLine containing '-hp' and 'staged_exfil.zip'. Sysmon Event ID 11: File Create event for C:\Windows\Temp\staged_exfil.zip with InitiatingProcessFileName=7z.exe. Security Event ID 4688 (if process command line auditing enabled) with same details.

  2. Test 2PowerShell Compress-Archive Staging in Temp Directory

    Expected signal: Sysmon Event ID 1: Process Create with Image=powershell.exe, CommandLine containing 'Compress-Archive' and 'C:\Windows\Temp\recent_files_staged.zip'. Sysmon Event ID 11: File Create for the zip archive. PowerShell ScriptBlock Log Event ID 4104 in Microsoft-Windows-PowerShell/Operational with full cmdlet and path.

  3. Test 3certutil Base64 Encode Binary File

    Expected signal: Sysmon Event ID 1: Process Create with Image=certutil.exe, CommandLine containing '-encode' and 'encoded_payload.txt'. Sysmon Event ID 11: File Create for C:\Windows\Temp\encoded_payload.txt. Security Event ID 4688 with the same certutil command line if process auditing is enabled.

  4. Test 4Linux tar + gzip Collection and Staging

    Expected signal: Auditd execve record: type=EXECVE with argv containing 'tar' 'czf' '/tmp/sys_backup_...' '/etc/passwd' '/etc/shadow'. Syslog process creation record (if auditd not deployed). File creation event for /tmp/sys_backup_*.tar.gz. If using a SIEM with Linux file integrity monitoring, alert on new file creation in /tmp matching *.tar.gz by root or privileged account.

  5. Test 5WinRAR Archive with Password and Locked Headers

    Expected signal: Sysmon Event ID 1: Process Create with Image ending rar.exe, CommandLine containing '-hp' and 'staging.rar'. Sysmon Event ID 11: File Create for C:\ProgramData\Microsoft\staging.rar with InitiatingProcessFileName=rar.exe. Security Event ID 4688 with full command line.

Unlock Pro Content

Get the full detection package for T1560 including response playbook, investigation guide, and atomic red team tests.

Response PlaybookInvestigation GuideHunting QueriesAtomic Red Team TestsTuning Guidance

Related Detections