T1560

Archive Collected Data

Collection Last updated:

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).

What is T1560 Archive Collected Data?

Archive Collected Data (T1560) maps to the Collection tactic — the adversary is trying to gather data of interest to their goal in MITRE ATT&CK.

This page provides production-ready detection logic for Archive Collected Data, covering the data sources and telemetry it touches: Process: Process Creation, Command: Command Execution, Microsoft Defender for Endpoint. The queries below are rated medium severity at high confidence, and ship for 7 SIEM platforms — KQL, SPL, Elastic, QRadar, Sumo, YARA-L, LogScale.

MITRE ATT&CK

Tactic
Collection
Technique
T1560 Archive Collected Data
Canonical reference
https://attack.mitre.org/techniques/T1560/
Microsoft Sentinel / Defender
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

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.

medium severity high confidence

Data Sources

Process: Process Creation Command: Command Execution Microsoft Defender for Endpoint

Required Tables

DeviceProcessEvents

False Positives

  • 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

Sigma rule & cross-platform mapping

The detection logic for Archive Collected Data (T1560) above is provided in a vendor-neutral form so you can deploy it on any SIEM. The same logic is shipped here as native KQL (Microsoft Sentinel / Defender), SPL (Splunk), Elastic (Elastic Security (EQL)), QRadar (IBM QRadar (AQL)), Sumo (Sumo Logic CSE), YARA-L (Google Chronicle / SecOps), LogScale (CrowdStrike LogScale (CQL)) queries. In Sigma terms, this detection targets the following logsource:

logsource:
  category: process_creation
  product: windows

Browse the community-maintained Sigma rules for this technique:


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.


Response Playbook

Triage

  1. Examine the full command line — identify: which tool was used, what source paths were archived, where the output archive was written, and whether a password was supplied. The destination path is critical: archives written to temp dirs, network shares, or cloud sync folders are high-priority
  2. Identify the parent process — was the archive tool spawned interactively (explorer.exe parent), by a scheduled task, by a scripting engine (wscript.exe, powershell.exe), or by an Office application? Non-interactive parents with no corresponding change ticket indicate automated collection
  3. Determine whether the archive was password-protected — the presence of -hp (7-Zip header encryption), -p<password>, or -pass arguments strongly indicates the adversary is preparing for exfiltration and wishes to evade content inspection
  4. Check the user context — is this a privileged account, service account, or domain admin? Archiving by service accounts or machine accounts ($) on servers is unusual and warrants immediate escalation
  5. Review the timeline around the archive event: look for preceding data collection activity (large directory listings, xcopy/robocopy, database dump utilities, BloodHound or SharpHound execution) within the same session
  6. Verify whether the archive file still exists on disk (DeviceFileEvents or Sysmon EID 11) and whether any network transfer of the archive occurred within 10 minutes of creation (DeviceNetworkEvents correlated by DeviceName and time window)

Containment

  1. If network transfer of the archive is confirmed: immediately isolate the endpoint via EDR network isolation or emergency VLAN change to prevent further exfiltration
  2. If the archive file is still present on disk: preserve it as evidence before any remediation — copy to secure evidence store with hash verification. Do NOT delete until legal/forensics sign off
  3. If compromised credentials are suspected: disable the account in Active Directory, revoke active SSO/OAuth sessions and tokens, and force password reset for all accounts the user had access to
  4. Block the archive file extension at DLP and proxy level if exfiltration vector is identified (HTTP POST, FTP, cloud storage upload) — apply to the specific destination domain or IP
  5. If lateral movement preceded the archiving: extend the isolation and investigation scope to all systems the account accessed in the preceding 48 hours
  6. If the archive contained credential material (NTDS.dit, SAM hive, LSASS dump, password vault exports): treat as full credential compromise and initiate emergency password reset for all domain accounts

Evidence Collection

  1. Full process tree for the archive execution: parent, grandparent, and any child processes spawned — Sysmon EID 1 or Security EID 4688 (requires process command line auditing via GPO)
  2. The archive command line in full — record the exact tool name, arguments, source paths, destination path, and any password argument (redact password before sharing outside IR team)
  3. The archive file itself if still present — collect with hash (MD5, SHA256), creation timestamp, file size, and owner. Attempt to open/inspect contents if no password was set
  4. Sysmon EID 11 (File Create) for the time window around the archive event — identifies all files written by the process, including intermediate staging files
  5. Network connection logs (Sysmon EID 3 or DeviceNetworkEvents) for the 15-minute window post-archive-creation — look for outbound connections from the archive process or any subsequent process carrying the archive name
  6. Prefetch files for the archive tool at C:\Windows\Prefetch\7Z.EXE-*.pf, RAR.EXE-*.pf — contain execution timestamps and file paths of recently accessed archives
  7. Security EID 4663 (Object Access) if file auditing is enabled on the source directories — identifies exactly which files the adversary read before archiving
  8. DLP and proxy logs for any HTTP/HTTPS POST, FTP transfer, or cloud storage (OneDrive, Dropbox, S3) upload matching the archive file size in the 30 minutes following archive creation

Escalation Criteria

  • ! Archive source paths include sensitive data stores: NTDS.dit, SAM hive, LSASS memory dump, password manager vaults, source code repositories, finance or HR data directories
  • ! Archive file was transferred off-system — network connection detected post-creation to an external IP or cloud storage endpoint
  • ! Archive was password-protected with a non-standard password (not a known backup password) indicating deliberate adversary obfuscation
  • ! Archiving executed by a service account, SYSTEM, or machine account with no corresponding authorised backup or maintenance window
  • ! Multiple systems showing archiving activity within the same 30-minute window — indicates a coordinated, potentially scripted collection campaign
  • ! Archive tool was spawned by an Office application, scripting engine, or any LOLBin — indicates exploitation of a macro, phishing payload, or script-based initial access
  • ! Archive contents include AD reconnaissance output (BloodHound zip, SharpHound zip) — indicates credential or lateral movement preparation

Investigation Guide

Forensic Artifacts

  • > Prefetch: C:\Windows\Prefetch\7Z.EXE-*.pf, RAR.EXE-*.pf, WINRAR.EXE-*.pf — execution timestamps and file path hashes of accessed archives
  • > Registry: HKCU\Software\7-Zip\FM\PanelPath0 and PanelPath1 — most recently browsed directories in 7-Zip file manager
  • > Registry: HKCU\Software\WinRAR\DialogEditHistory\ArcName — recent archive names used in WinRAR dialogs
  • > Registry: HKCU\Software\WinRAR\DialogEditHistory\ExtrPath — recent extraction paths
  • > MFT ($MFT) / USN Journal ($UsnJrnl) — archive file creation, modification, and deletion timestamps; recoverable even if archive was deleted
  • > Windows Search Index (C:\ProgramData\Microsoft\Search\Data\Applications\Windows\Windows.edb) — may have indexed archive file names and paths
  • > PowerShell history: $env:APPDATA\Microsoft\Windows\PowerShell\PSReadLine\ConsoleHost_history.txt — records Compress-Archive cmdlet invocations
  • > PowerShell ScriptBlock Log (Event ID 4104 in Microsoft-Windows-PowerShell/Operational) — full deobfuscated content of any Compress-Archive or IO.Compression code
  • > Sysmon EID 11 (File Create) records in EVTX — shows archive file creation with initiating process details
  • > ShimCache / AmCache (HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\AppCompatCache, C:\Windows\appcompat\Programs\Amcache.hve) — evidence of archive tool execution even if prefetch was cleared
  • > Linux: /var/log/audit/audit.log (auditd execve records) for tar, gzip, zip, openssl enc commands
  • > Linux: ~/.bash_history or ~/.zsh_history — command-line history for archive/encryption commands

Tuning Guidance

Start by baselining which accounts, systems, and time windows archive operations are expected in your environment. Backup servers and backup service accounts will generate significant volume — build an allowlist by account name (matching your backup service account naming convention) AND parent process (e.g., backup agent executable) to suppress these. For password-protected archive detection, the -hp flag (header encryption) is the cleanest signal with very few legitimate uses — this can run with minimal tuning. The -p flag is noisier; require it to be combined with suspicious parent processes or unusual user context before alerting. For PowerShell Compress-Archive, build an allowlist of known deployment automation scripts by their exact command-line hash or parent process. On developer workstations, Compress-Archive usage will be frequent — consider scoping the detection to exclude devices in developer device groups if you manage device tagging in MDE. For certutil -encode, legitimate PKI admin use always involves certificate file extensions (.cer, .crt, .p7b); add a filter for ProcessCommandLine has_any (".cer", ".crt", ".p7b", ".pfx") to suppress these. On Linux endpoints, baseline which users run tar/gzip/zip and add auditd rules targeting archive tool execve calls on servers where archiving is not expected. Consider pairing this detection with T1041/T1048 network exfiltration detections to build a compound alert: archive creation followed within 10 minutes by large outbound data transfer is a much higher-fidelity signal than archiving alone.


Hunting Queries

Hunt for archive files created in staging and temp directories by processes that are not standard archive utilities. This catches malware, custom scripts, or LOLBins writing archives as a staging step before exfiltration, which the main process-based detection may miss if the archiving code is embedded rather than invoking a standalone tool.

Hunting — KQL
kql
// Hunt 1: Archive files created in staging/temp directories by non-archive processes
// Catches adversaries using custom scripts, malware, or LOLBins to create archives
DeviceFileEvents
| where Timestamp > ago(7d)
| where FileName has_any (".zip", ".7z", ".rar", ".gz", ".tar", ".bz2", ".cab", ".lzh")
| where FolderPath has_any ("\\temp\\", "\\tmp\\", "\\windows\\temp\\", "\\appdata\\local\\temp\\", "\\users\\public\\", "\\programdata\\")
| where InitiatingProcessFileName !in~ ("7z.exe", "7za.exe", "7zr.exe", "winrar.exe", "rar.exe", "explorer.exe", "msiexec.exe", "setup.exe", "install.exe")
| where FileSize > 102400  // > 100KB to filter trivial archives
| project Timestamp, DeviceName, AccountName, FileName, FolderPath, FileSize,
         InitiatingProcessFileName, InitiatingProcessCommandLine
| sort by Timestamp desc
Hunting — SPL
spl
index=wineventlog sourcetype="XmlWinEventLog:Microsoft-Windows-Sysmon/Operational" EventCode=11
  (TargetFilename="*.zip" OR TargetFilename="*.7z" OR TargetFilename="*.rar" OR TargetFilename="*.gz" OR TargetFilename="*.tar" OR TargetFilename="*.cab")
  (TargetFilename="*\\Temp\\*" OR TargetFilename="*\\tmp\\*" OR TargetFilename="*\\Users\\Public\\*" OR TargetFilename="*\\ProgramData\\*" OR TargetFilename="*\\Windows\\Temp\\*")
NOT (Image="*\\7z.exe" OR Image="*\\7za.exe" OR Image="*\\winrar.exe" OR Image="*\\rar.exe" OR Image="*\\explorer.exe" OR Image="*\\msiexec.exe")
| table _time, host, User, Image, CommandLine, TargetFilename
| sort - _time

Hunt for archive utility execution under service accounts, SYSTEM, or machine accounts. Legitimate scheduled backup jobs will typically appear at consistent times with consistent command lines — deviations (new times, new paths, new password arguments) warrant investigation. This catches adversaries who have compromised service accounts to run data collection and staging tasks.

Hunting — KQL
kql
// Hunt 2: Archive tool usage by service accounts, SYSTEM, or machine accounts on servers
// Legitimate backup jobs are typically scheduled and expected — unexpected invocations are high-priority
DeviceProcessEvents
| where Timestamp > ago(7d)
| where FileName in~ ("7z.exe", "7za.exe", "7zr.exe", "rar.exe", "winrar.exe")
| where AccountName endswith "$"
      or AccountName =~ "SYSTEM"
      or AccountName has_any ("svc", "service", "backup", "agent")
| summarize
    ArchiveCount = count(),
    UniqueCommands = dcount(ProcessCommandLine),
    Commands = make_set(ProcessCommandLine, 10),
    Parents = make_set(InitiatingProcessFileName, 5),
    FirstSeen = min(Timestamp),
    LastSeen = max(Timestamp)
    by DeviceName, AccountName, FileName
| sort by ArchiveCount desc
Hunting — SPL
spl
index=wineventlog sourcetype="XmlWinEventLog:Microsoft-Windows-Sysmon/Operational" EventCode=1
  (Image="*\\7z.exe" OR Image="*\\7za.exe" OR Image="*\\7zr.exe" OR Image="*\\rar.exe" OR Image="*\\winrar.exe")
| where match(User, "(?i)(system|\$$|svc|service|backup|agent)")
| stats count as ArchiveCount, dc(CommandLine) as UniqueCommands, values(CommandLine) as Commands,
        values(ParentImage) as Parents, earliest(_time) as FirstSeen, latest(_time) as LastSeen
        by host, User, Image
| sort - ArchiveCount

Hunt for anomalous spikes in daily archiving activity per device and account, using a 14-day baseline. A single day with 3x the normal archive frequency or more than 5 archive operations on a device that rarely archives suggests bulk data staging. This catches adversaries who use existing archive tools that are present in the environment but run them at an unusual scale or cadence.

Hunting — KQL
kql
// Hunt 3: Spike detection — unusual frequency of archiving activity per device in a single day
// Adversaries staging large data collections will often run many archive operations in a short window
DeviceProcessEvents
| where Timestamp > ago(14d)
| where FileName in~ ("7z.exe", "7za.exe", "7zr.exe", "rar.exe", "winrar.exe", "compact.exe")
| summarize
    DailyCount = count(),
    UniqueSourcePaths = dcount(ProcessCommandLine),
    Commands = make_set(ProcessCommandLine, 20)
    by DeviceName, AccountName, bin(Timestamp, 1d)
| summarize
    AvgDaily = avg(DailyCount),
    MaxDaily = max(DailyCount),
    DaysObserved = count()
    by DeviceName, AccountName
| where MaxDaily > AvgDaily * 3 and MaxDaily > 5
| sort by MaxDaily desc
Hunting — SPL
spl
index=wineventlog sourcetype="XmlWinEventLog:Microsoft-Windows-Sysmon/Operational" EventCode=1
  (Image="*\\7z.exe" OR Image="*\\7za.exe" OR Image="*\\7zr.exe" OR Image="*\\rar.exe" OR Image="*\\winrar.exe" OR Image="*\\compact.exe")
| bucket span=1d _time
| stats count as DailyCount, dc(CommandLine) as UniqueCommands by host, User, _time
| stats avg(DailyCount) as AvgDaily, max(DailyCount) as MaxDaily, count as DaysObserved by host, User
| where MaxDaily > (AvgDaily * 3) AND MaxDaily > 5
| sort - MaxDaily

Atomic Red Team Tests

Test 1 7-Zip Password-Protected Archive of Sensitive Directory
windows

Creates a password-protected 7-Zip archive of the current user's Documents folder using the -hp flag (which encrypts both file contents and archive headers). The -hp flag is a strong indicator of deliberate data hiding for exfiltration, as it prevents forensic tools from reading file names inside the archive without the password. Uses a staging path in the Windows Temp directory, a common adversary staging location.

Command

powershell
7z.exe a -tzip -hp"Adv3rsaryP@ss" -mx=5 C:\Windows\Temp\staged_exfil.zip C:\Users\%USERNAME%\Documents\*.docx C:\Users\%USERNAME%\Documents\*.xlsx

Cleanup

powershell
del /f /q C:\Windows\Temp\staged_exfil.zip

Expected Telemetry

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.

Expected Detection

Alert fires on PasswordProtected detection branch: ProcessCommandLine contains '-hp'. KQL: DetectionType='Password-Protected Archive', RiskLevel='High'. SPL: PasswordProtected=1, SuspicionScore=1.

Test 2 PowerShell Compress-Archive Staging in Temp Directory
windows

Uses the built-in PowerShell Compress-Archive cmdlet to collect and compress files into a staging directory. This technique requires no third-party tools and is increasingly used by adversaries leveraging living-off-the-land approaches. The destination path in Windows Temp mimics pre-exfiltration staging behaviour seen in Lazarus Group and BlackByte intrusions.

Command

powershell
powershell.exe -NoProfile -Command "Compress-Archive -Path C:\Users\$env:USERNAME\AppData\Roaming\Microsoft\Windows\Recent -DestinationPath C:\Windows\Temp\recent_files_staged.zip -Force"

Cleanup

powershell
Remove-Item C:\Windows\Temp\recent_files_staged.zip -ErrorAction SilentlyContinue

Expected Telemetry

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.

Expected Detection

Alert fires on PSCompression detection branch: ProcessCommandLine contains 'Compress-Archive'. KQL: DetectionType='PowerShell .NET Compression', RiskLevel='Medium'. SPL: PSCompression=1, SuspicionScore=1.

Test 3 certutil Base64 Encode Binary File
windows

Uses the built-in Windows certutil.exe utility to base64-encode a binary file, converting it to ASCII text. This technique is used by adversaries to prepare binary payloads or collected data for exfiltration over text channels (HTTP body, email, clipboard). The encoded output can be decoded on the attacker's system with certutil -decode or standard base64 tooling. This was observed in multiple APT intrusions as a data staging step.

Command

powershell
certutil.exe -encode C:\Windows\System32\notepad.exe C:\Windows\Temp\encoded_payload.txt && echo Encoded file size: && for %i in (C:\Windows\Temp\encoded_payload.txt) do echo %~zi bytes

Cleanup

powershell
del /f /q C:\Windows\Temp\encoded_payload.txt

Expected Telemetry

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.

Expected Detection

Alert fires on CertutilEncoding detection branch: ProcessCommandLine has '-encode'. KQL: DetectionType='CertUtil Base64 Encoding', RiskLevel='Medium'. SPL: CertutilEncode=1, SuspicionScore=1.

Test 4 Linux tar + gzip Collection and Staging
linux

Uses the native tar utility with gzip compression to collect sensitive system files into a staging archive in /tmp. This pattern is observed in Linux server intrusions where adversaries collect /etc credentials, application configs, and log files before exfiltration. The archive name includes a timestamp to mimic legitimate log rotation or backup script output.

Command

bash
tar czf /tmp/sys_backup_$(date +%Y%m%d%H%M%S).tar.gz /etc/passwd /etc/shadow /etc/hosts /etc/ssh/ssh_host_* /root/.bash_history 2>/dev/null; ls -lh /tmp/sys_backup_*.tar.gz

Cleanup

bash
rm -f /tmp/sys_backup_*.tar.gz

Expected Telemetry

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.

Expected Detection

Detection via auditd execve rules monitoring for tar with -z or -j flags collecting from /etc, /root, or /home paths into /tmp. Syslog sourcetype in Splunk: search for 'tar' with 'czf' or 'cjf' and destination path '/tmp/' in process audit records.

Test 5 WinRAR Archive with Password and Locked Headers
windows

Uses WinRAR command-line interface to create a password-protected archive with header encryption (-hp), compressing a sensitive directory and writing the output to a staging location under ProgramData. The -ep1 flag strips leading directory paths to obfuscate the original file structure. This pattern was observed in Dragonfly and HAFNIUM intrusions for pre-exfiltration data packaging.

Command

powershell
rar.exe a -hp"C0mp!ex#Pass" -ep1 -m5 C:\ProgramData\Microsoft\staging.rar C:\Users\%USERNAME%\Desktop\*.* C:\Users\%USERNAME%\Documents\*.*

Cleanup

powershell
del /f /q C:\ProgramData\Microsoft\staging.rar

Expected Telemetry

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.

Expected Detection

Alert fires on PasswordProtected detection branch: ProcessCommandLine matches regex for -p prefix or contains '-hp'. KQL: DetectionType='Password-Protected Archive'. SPL: PasswordProtected=1, SuspicionScore=1.

Related Detections

Tactic Hub