Rules

YARA: catching GLASSWING's string decryptor

One rule for the inlined rolling-XOR decryptor, tested against six builds and 40,000 clean binaries.

This rule targets the stack-string decryptor described in the GLASSWING teardown. It’s the most stable code across builds: the seed changes, the register allocation shifts a little, but the add / rol 3 / xor core stays the same.

glasswing_decryptor.yar
rule GLASSWING_StackString_Decryptor
{
    meta:
        author      = "Jeff Meendering"
        description = "Rolling-XOR stack string decryptor used by GLASSWING stage 2"
        date        = "2026-11-19"
        tlp         = "CLEAR"

    strings:
        // mov r9b, r8b ; add r9b, al ; rol r9b, 3 ; xor [rcx+rax], r9b
        $dec = { 45 88 C1 41 00 C1 41 C0 C1 03 44 30 0C 01 }
        $ua  = "Microsoft-CryptoAPI/10.0" wide ascii
        $mtx = "{7E1F2A90-" wide ascii

    condition:
        uint16(0) == 0x5A4D
        and filesize < 2MB
        and #dec >= 20
        and ($ua or $mtx or #dec >= 100)
}

How it behaves#

The decryptor is inlined, so a real sample contains it hundreds of times. Requiring at least 20 hits keeps the rule from firing on a binary that happens to contain the byte sequence once.

Test setFilesHits
GLASSWING stage 2 builds66
Clean Windows system binaries31,2120
Clean third-party installers9,0040

Sigma, for the persistence step#

If you can’t scan memory, catch the scheduled task instead:

glasswing_schtask.yml
title: Scheduled task masquerading as Edge telemetry
status: experimental
logsource:
  product: windows
  service: security
detection:
  selection:
    EventID: 4698
    TaskName|contains: 'MicrosoftEdgeTelemetrySvc'
  condition: selection
falsepositives:
  - None known; real Edge tasks are named MicrosoftEdgeUpdateTask*
level: high