T1480.001 IBM QRadar · QRadar

Detect Environmental Keying in IBM QRadar

Adversaries may environmentally key payloads to constrain execution to a specific target by deriving cryptographic decryption keys from target-specific values such as volume serial numbers, machine GUIDs, hostnames, domain membership, or DPAPI-bound credentials. Because the decryption key is never transmitted and is derived solely from the victim environment, the payload cannot be analyzed in sandboxes or reversed without access to the exact target system. Real-world examples include APT41 using DPAPI to bind payloads to specific user accounts and machines, PowerPunch using volume serial numbers to generate XOR keys, InvisiMole using DPAPI to prevent decryption outside the compromised host, ROKRAT requiring a specific victim hostname to decrypt strings, and the Ninja implant storing payloads encrypted with keys derived from drive serial numbers.

MITRE ATT&CK

Tactic
Defense Evasion
Technique
T1480 Execution Guardrails
Sub-technique
T1480.001 Environmental Keying
Canonical reference
https://attack.mitre.org/techniques/T1480/001/

QRadar Detection Query

IBM QRadar (QRadar)
sql
SELECT
  DATEFORMAT(starttime, 'yyyy-MM-dd HH:mm:ss') AS EventTime,
  logsourcename(logsourceid) AS LogSource,
  username,
  sourceip,
  QIDNAME(qid) AS EventName,
  "Image" AS ProcessImage,
  "CommandLine" AS ProcessCommandLine,
  "TargetObject" AS RegistryTarget,
  CASE
    WHEN LOWER("CommandLine") MATCHES '(win32_diskdrive|win32_logicaldisk|win32_volume|serialnumber|volumeserialnumber|win32_computersystemproduct|uuid|identifyingnumber)'
     AND LOWER("Image") MATCHES '(wscript\.exe|cscript\.exe|mshta\.exe|regsvr32\.exe|rundll32\.exe|wmic\.exe|powershell\.exe|pwsh\.exe)'
    THEN 'WMI_Hardware_Serial_Query'
    WHEN LOWER("Image") MATCHES 'wmic\.exe'
     AND LOWER("CommandLine") MATCHES '(bios|baseboard|csproduct|uuid|serialnumber|identifyingnumber)'
    THEN 'WMIC_UUID_Serial_Enum'
    WHEN LOWER("TargetObject") MATCHES '(microsoft\\\\cryptography.*machineguid|windows nt\\\\currentversion.*(productid|digitalproductid))'
     AND NOT LOWER("Image") MATCHES '(svchost\.exe|wmiprvse\.exe|lsass\.exe|searchindexer\.exe|msmpeng\.exe)'
    THEN 'Registry_MachineID_Queried'
    WHEN LOWER("Image") MATCHES '(powershell\.exe|pwsh\.exe)'
     AND LOWER("CommandLine") MATCHES '(cryptprotectdata|cryptunprotectdata|protecteddata|system\.security\.cryptography|\[dpapi\])'
    THEN 'DPAPI_PowerShell_Keying'
    ELSE 'Unknown'
  END AS DetectionMethod
FROM events
WHERE
  LOGSOURCETYPEID IN (12, 13, 14, 15)
  AND starttime > NOW() - 86400000
  AND (
    (
      LOWER("CommandLine") MATCHES '(win32_diskdrive|win32_logicaldisk|serialnumber|win32_computersystemproduct|uuid|identifyingnumber)'
      AND LOWER("Image") MATCHES '(wscript\.exe|cscript\.exe|mshta\.exe|regsvr32\.exe|rundll32\.exe|wmic\.exe|powershell\.exe|pwsh\.exe|certutil\.exe)'
    )
    OR (
      LOWER("Image") MATCHES 'wmic\.exe'
      AND LOWER("CommandLine") MATCHES '(bios|baseboard|csproduct|uuid|serialnumber|identifyingnumber)'
    )
    OR (
      LOWER("TargetObject") MATCHES '(microsoft\\\\cryptography|windows nt\\\\currentversion)'
      AND LOWER("TargetObject") MATCHES '(machineguid|productid|digitalproductid)'
      AND NOT LOWER("Image") MATCHES '(svchost\.exe|wmiprvse\.exe|lsass\.exe|searchindexer\.exe|msmpeng\.exe|sgrmbroker\.exe|spoolsv\.exe|services\.exe|runtimebroker\.exe|taskhostw\.exe)'
    )
    OR (
      LOWER("Image") MATCHES '(powershell\.exe|pwsh\.exe)'
      AND LOWER("CommandLine") MATCHES '(cryptprotectdata|cryptunprotectdata|protecteddata|system\.security\.cryptography\.protecteddata|\[dpapi\])'
    )
  )
ORDER BY starttime DESC
high severity medium confidence

QRadar AQL detection for T1480.001 Environmental Keying — correlates Sysmon and Windows Security event sources to flag hardware serial WMI queries, registry MachineGuid reads, DPAPI PowerShell abuse, and wmic UUID enumeration characteristic of environmentally-keyed payload derivation.

Data Sources

Windows Security Event LogSysmon Operational LogQRadar WinCollect agent

Required Tables

events

False Positives & Tuning

  • Hardware inventory platforms such as Lansweeper or SCCM querying WMI for asset tracking
  • License enforcement software reading MachineGuid for machine-bound licensing
  • PowerShell DSC or configuration management scripts using DPAPI for credential storage
Download portable Sigma rule (.yml)

Other platforms for T1480.001


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 1Volume Serial Number Query via WMIC (PowerPunch/Ninja Pattern)

    Expected signal: Sysmon Event ID 1: Process Create with Image=wmic.exe, CommandLine containing 'logicaldisk' and 'VolumeSerialNumber'. Security Event ID 4688 (if command line auditing enabled) with ProcessCommandLine showing the full query. WMI activity log in Microsoft-Windows-WMI-Activity/Operational.

  2. Test 2Machine GUID Registry Read via PowerShell (Environmental Key Seed Collection)

    Expected signal: Sysmon Event ID 1: Process Create with Image=powershell.exe, CommandLine containing 'HKLM' and 'MachineGuid'. Sysmon Event ID 13 (RegistryValueSet) or equivalent registry read event in Microsoft-Windows-Security-Auditing if object access auditing is enabled. PowerShell ScriptBlock Log Event ID 4104 showing the full script.

  3. Test 3DPAPI Encrypt and Decrypt Simulation (APT41/InvisiMole Pattern)

    Expected signal: Sysmon Event ID 1: Process Create with Image=powershell.exe, CommandLine containing 'ProtectedData', 'Protect', and 'Unprotect'. Sysmon Event ID 7 (ImageLoad): dpapi.dll and crypt32.dll loaded by powershell.exe. PowerShell ScriptBlock Log Event ID 4104 with the full ProtectedData usage. Microsoft-Windows-Crypto-DPAPI/Operational Event IDs 12288 and 12290 for protect/unprotect operations.

  4. Test 4Multi-Identifier Environmental Fingerprinting (Combined Key Material Collection)

    Expected signal: Sysmon Event ID 1: Process Create with Image=powershell.exe, CommandLine containing 'Win32_LogicalDisk', 'VolumeSerialNumber', 'MachineGuid', and 'Win32_ComputerSystem'. PowerShell ScriptBlock Log Event ID 4104 with full multi-identifier collection script. Registry read events for MachineGuid. WMI activity events for both WMI object queries.

Unlock Pro Content

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

Response PlaybookInvestigation GuideHunting QueriesAtomic Red Team TestsTuning Guidance

Related Detections