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
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 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
Required Tables
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
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.
- 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.
- 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.
- 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.
- 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.
References (5)
- https://attack.mitre.org/techniques/T1027/011/
- https://learn.microsoft.com/microsoft-365/security/intelligence/fileless-threats
- https://securelist.com/a-new-secret-stash-for-fileless-malware/106393/
- https://www.elastic.co/guide/en/security/7.17/prebuilt-rule-7-16-3-binary-executed-from-shared-memory-directory.html
- https://www.akamai.com/blog/security-research/fritzfrog-botnet-new-capabilities-log4shell
Unlock Pro Content
Get the full detection package for T1027.011 including response playbook, investigation guide, and atomic red team tests.