T1027.011 Microsoft Sentinel · KQL

Detect Fileless Storage in Microsoft Sentinel

Adversaries may store data in fileless formats to conceal malicious activity from defenses. Fileless storage includes the Windows Registry, event logs, WMI repository, and on Linux, shared memory directories (/dev/shm, /run/shm) and volatile paths (/tmp). Windows Registry-based storage is widely used by malware including QakBot, ComRAT, ShadowPad, DarkWatchman, Turla, APT32, and Volgmer to store encrypted configurations, payloads, and C2 data. Linux malware including FritzFrog (FrogShell), Muhstik, and others abuse /dev/shm and /run/shm to store binaries that are executed directly from shared memory without writing to persistent disk storage.

MITRE ATT&CK

Tactic
Defense Evasion
Technique
T1027 Obfuscated Files or Information
Sub-technique
T1027.011 Fileless Storage
Canonical reference
https://attack.mitre.org/techniques/T1027/011/

KQL Detection Query

Microsoft Sentinel (KQL)
kusto
let SuspiciousRegistryPaths = dynamic([
  "HKCU\\Software\\Microsoft\\[^\\\\]+$",
  "HKLM\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\ShellCompatibility",
  "HKLM\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\PrintConfigs",
  "HKLM\\SOFTWARE\\Microsoft\\DRM",
  "HKLM\\SOFTWARE\\Classes\\.wav\\",
  "HKCU\\Software\\ApplicationContainer\\",
  "HKLM\\SOFTWARE\\Plus",
  "HKCU\\SOFTWARE\\Plus"
]);
DeviceRegistryEvents
| where Timestamp > ago(24h)
| where ActionType in ("RegistryValueSet", "RegistryKeyCreated")
| where RegistryValueData has_any ("MZ", "TVqQ", "4D5A") // PE magic bytes in Base64 or hex
    or (strlen(RegistryValueData) > 10000
        and (RegistryValueData matches regex @"^[A-Za-z0-9+/=]{100,}$"))  // Large Base64 blob
| where RegistryKey !startswith "HKLM\\SYSTEM\\CurrentControlSet\\Services\\"
    and RegistryKey !startswith "HKLM\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Winlogon"
| project Timestamp, DeviceName, AccountName, ActionType, RegistryKey, RegistryValueName,
         RegistryValueData, InitiatingProcessFileName, InitiatingProcessCommandLine
| sort by Timestamp desc
high severity high confidence

Detects fileless payload storage in the Windows Registry by identifying registry values containing PE file magic bytes (MZ header / Base64 'TVqQ' encoding) or large Base64-encoded blobs. Malware like ComRAT, ShadowPad, and Turla store encrypted payloads and configurations in registry values. The large Base64 regex identifies values that are too large to be normal configuration data and contain base64-encoded binary content.

Data Sources

Windows Registry: Registry Key ModificationMicrosoft Defender for Endpoint

Required Tables

DeviceRegistryEvents

False Positives & Tuning

  • Some legitimate software stores large Base64-encoded configuration or license data in registry values
  • Group Policy preferences that store Base64-encoded data in registry keys for computer configuration
  • Certificate enrollment and management software that stores certificate data in registry values
  • Backup and synchronization tools that cache serialized objects (sometimes Base64-encoded) in registry
Download portable Sigma rule (.yml)

Other platforms for T1027.011


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.

  1. Test 1Store Base64-Encoded Payload in Registry (QakBot/Sibot Pattern)

    Expected signal: Sysmon Event ID 12 (Registry Key Creation): new key under HKCU\Software\Microsoft. Sysmon Event ID 13 (Registry Value Set): Config value with Base64 data. PowerShell ScriptBlock Log Event ID 4104: New-ItemProperty command with Base64 value.

  2. Test 2Store Encrypted Configuration in Non-Standard Registry Path

    Expected signal: Sysmon Event ID 12/13: registry key and value creation at HKCU\Software\ApplicationContainer\Appsw64. The Appsw64 key path matches Valak malware's known storage location. Process creation for reg.exe.

  3. Test 3Execute Binary from Linux Shared Memory (/dev/shm)

    Expected signal: Process creation events for cp, chmod, and /dev/shm/fileless_test. Auditd execve records showing execution from /dev/shm path. Process listing would show exe=/dev/shm/fileless_test for the running process.

  4. Test 4WMI-Based Fileless Storage (Event Subscription)

    Expected signal: Sysmon Event ID 19 (WMI Event Filter Activity): new filter created. WMI provider host (WmiPrvSE.exe) activity. The filter is stored in the WMI repository database, not as a file.

Unlock Pro Content

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

Response PlaybookInvestigation GuideHunting QueriesAtomic Red Team TestsTuning Guidance

Related Detections