Sigma rule: Invoke-Obfuscation VAR+ Launcher - Security
A detection rule from the SigmaHQ repository, shown as its author published it. Dataset version ref-17ba2fc66876, updated 2022-11-29T00:00:00.000Z.
Rule
- Title
- Invoke-Obfuscation VAR+ Launcher - Security
- Status
- test
- Level
- high
- Author
- Jonathan Cheong, oscd.community
- Date
- 2020-10-15
- Modified
- 2022-11-29
- File
- rules/windows/builtin/security/win_security_invoke_obfuscation_var_services_security.yml
- Commit
- ccbb0369507f796db0b0ae6854c8a2be471b9d84
Detects Obfuscated use of Environment Variables to execute PowerShell
Log source
- product
- windows
- service
- security
- definition
- The 'System Security Extension' audit subcategory need to be enabled to log the EID 4697
Detection
selection:
EventID: 4697
# ServiceFileName|re: 'cmd.{0,5}(?:\/c|\/r)(?:\s|)\"set\s[a-zA-Z]{3,6}.*(?:\{\d\}){1,}\\\"\s+?\-f(?:.*\)){1,}.*\"'
# Example 1: C:\winDoWs\SySTeM32\cmd.Exe /C"SET NOtI=Invoke-Expression (New-Object Net.WebClient).DownloadString&& PowERshElL -NOl SET-iteM ( 'VAR' + 'i'+ 'A' + 'blE:Ao6' + 'I0') ( [TYpe](\"{2}{3}{0}{1}\"-F 'iRoN','mENT','e','nv') ) ; ${exECUtIONCOnTEXT}.\"IN`VO`KecOmMaND\".\"inVo`KES`crIPt\"( ( ( GEt-VAriAble ( 'a' + 'o6I0') -vaLU )::(\"{1}{4}{2}{3}{0}\" -f'e','gETenvIR','NtvaRIa','BL','ONme' ).Invoke(( \"{0}{1}\"-f'n','oti' ),( \"{0}{1}\" -f'pRoC','esS') )) )"
# Example 2: cMD.exe /C "seT SlDb=Invoke-Expression (New-Object Net.WebClient).DownloadString&& pOWErShell .(( ^&(\"{1}{0}{2}{3}\" -f 'eT-vaR','G','iab','lE' ) (\"{0}{1}\" -f '*m','DR*' ) ).\"na`ME\"[3,11,2]-JOIN'' ) ( ( ^&(\"{0}{1}\" -f'g','CI' ) (\"{0}{1}\" -f 'ENV',':SlDb' ) ).\"VA`luE\" ) "
ServiceFileName|contains|all:
- 'cmd'
- '"set'
- '-f'
ServiceFileName|contains:
- '/c'
- '/r'
condition: selectionFalse positives (as the rule lists them)
- Unknown
Tags
- attack.stealth
- attack.t1027
- attack.execution
- attack.t1059.001
MITRE ATT&CK ids this rule names
Related rules
References
Read on 2026-11-03T00:58:21.399Z under licence sigma-drl-1.1@d5f4c36a from https://github.com/SigmaHQ/sigma/blob/ccbb0369507f796db0b0ae6854c8a2be471b9d84/rules/windows/builtin/security/win_security_invoke_obfuscation_var_services_security.yml
Sources and licences
SigmaHQ
"Invoke-Obfuscation VAR+ Launcher - Security" by Jonathan Cheong, oscd.community (SigmaHQ). Rule: https://github.com/SigmaHQ/sigma/blob/ccbb0369507f796db0b0ae6854c8a2be471b9d84/rules/windows/builtin/security/win_security_invoke_obfuscation_var_services_security.yml.
Licensed under the Detection Rule License (DRL) 1.1: https://github.com/SigmaHQ/Detection-Rule-License
Cite this page
Dragons Eye Ransomware Tracker, "Sigma rule: Invoke-Obfuscation VAR+ Launcher - Security",
entity page, dataset version ref-17ba2fc66876, updated 2022-11-29T00:00:00.000Z,
https://ransomware-tracker.com/detections/sigma/dcf2db1f-f091-425b-a821-c05875b8925a (accessed 2026-11-03).
Underlying source: SigmaHQ rule dcf2db1f-f091-425b-a821-c05875b8925a, commit ccbb0369507f796db0b0ae6854c8a2be471b9d84.
Pages change. The dataset version identifies the data, but no archive of old versions is kept, so this citation cannot be replayed later.