T1560.003

Archive via Custom Method

An adversary may compress or encrypt data collected prior to exfiltration using a custom method rather than standard archive utilities. Custom implementations include XOR loops with static keys, stream ciphers (RC4, ChaCha20), block ciphers (Blowfish), byte rotation schemes, and substitution ciphers — all implemented inline in malware code or scripts without referencing external libraries or system utilities. This technique allows adversaries to transform staged data in a way that evades detection rules targeting standard archivers (7-Zip, WinRAR, zip) while also obfuscating data contents during staging and exfiltration. Threat actors employing this technique include FIN6 (single-byte XOR with key 0xAA, plus Base64 with character permutation), CopyKittens (substitution cipher), and malware families including Attor (custom Blowfish+RSA), BLUELIGHT (XOR binary blob), StrongPity (repeated XOR producing .sft archive parts), Duqu (zlib+XOR), RGDoor (XOR before C2 transmission), RawPOS (XOR-encoded POS card data), and FoggyWeb (dynamic XOR key with WebP steganography).

Microsoft Sentinel / Defender
kusto
let XORKeywords = dynamic([
  "-bxor", "BitXor", "xorkey", "xor_key", "xorBytes", "XorEncrypt",
  "0xAA", "0x23", "bxor 0x", "xor 0x",
  "[byte[]] $key", "ByteXor", "XorFile"
]);
let CustomCryptoKeywords = dynamic([
  "blowfish", " rc4 ", "arcfour", "stream cipher",
  "substitution", "rot13", "rotl(", "rotr(",
  "custom encrypt", "xor cipher", "xor encrypt"
]);
let SuspiciousOutputExtensions = dynamic([
  ".sft", ".enc", ".crypt", ".xor", ".locked", ".rms"
]);
let KnownArchivers = dynamic([
  "7z.exe", "winrar.exe", "winzip.exe", "pkzip.exe",
  "zip.exe", "tar.exe", "gzip.exe", "bzip2.exe"
]);
// Branch 1: Scripting engines with XOR or custom crypto keywords in command line
let ScriptBasedCustomCrypto =
  DeviceProcessEvents
  | where Timestamp > ago(24h)
  | where FileName in~ ("powershell.exe", "pwsh.exe", "python.exe", "python3.exe",
                        "wscript.exe", "cscript.exe", "cmd.exe")
  | where ProcessCommandLine has_any (XORKeywords)
      or ProcessCommandLine has_any (CustomCryptoKeywords)
  | extend EncryptionType = case(
      ProcessCommandLine has_any (XORKeywords), "XOR-based",
      ProcessCommandLine has_any (CustomCryptoKeywords), "Custom-cipher",
      "Unknown"
    )
  | project Timestamp, DeviceName, AccountName,
           ProcessName = FileName,
           ProcessCommandLine,
           ParentProcess = InitiatingProcessFileName,
           ParentCommandLine = InitiatingProcessCommandLine,
           EncryptionType,
           DetectionBranch = "ScriptCustomCrypto";
// Branch 2: High-volume creation of files with custom encrypted extensions by non-standard processes
let BulkCustomExtensionCreation =
  DeviceFileEvents
  | where Timestamp > ago(24h)
  | where ActionType == "FileCreated"
  | where FileName has_any (SuspiciousOutputExtensions)
  | where not(InitiatingProcessFileName has_any (KnownArchivers))
  | where FolderPath !has ":\\Windows" and FolderPath !has ":\\Program Files"
  | summarize
      FileCount = count(),
      SampleFiles = make_set(FileName, 10),
      Folders = make_set(FolderPath, 3)
    by DeviceName,
       AccountName = InitiatingProcessAccountName,
       ProcessName = InitiatingProcessFileName,
       ProcessCommandLine = InitiatingProcessCommandLine,
       ParentProcess = InitiatingProcessParentFileName,
       ParentCommandLine = InitiatingProcessParentCommandLine,
       bin(Timestamp, 5m)
  | where FileCount >= 5
  | extend EncryptionType = strcat("BulkCustomExtension:", FileCount, " files")
  | project Timestamp, DeviceName, AccountName, ProcessName,
           ProcessCommandLine, ParentProcess, ParentCommandLine,
           EncryptionType, DetectionBranch = "BulkEncryptedFiles";
ScriptBasedCustomCrypto
| union BulkCustomExtensionCreation
| sort by Timestamp desc
high severity medium confidence

Data Sources

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

Required Tables

DeviceProcessEvents DeviceFileEvents

False Positives

  • Enterprise backup and DLP software (VeraCrypt preparation scripts, enterprise encryption agents) creating .enc or .crypt files in bulk during scheduled backup operations
  • Software developers writing and testing custom encryption libraries or XOR-based data serialization code on developer workstations — the -bxor operator has legitimate scripting uses
  • In-house data processing pipelines or ETL jobs that use custom non-standard file extensions for intermediate processing artifacts
  • Security assessment tools and penetration testing frameworks implementing XOR transforms during authorized engagements
  • Ransomware simulation tools (RanSim, SafeKit) used by security teams for testing detection coverage that produce bulk encrypted output files

Unlock Pro Content

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

Response PlaybookInvestigation GuideHunting QueriesAtomic Red Team TestsTuning Guidance

Related Detections