Manual Execution of Script Inside of a Compressed File
A Sigma rule for process creation on Windows, from SigmaHQ’s threat hunting rules, by @kostastsale.
medium 1 ATT&CK technique 5 programs it names
What it looks for
detection:
selection_child:
CommandLine|endswith:
- '.hta'
- '.js'
- '.jse'
- '.ps1'
- '.vbe'
- '.vbs'
- '.wsf'
- '.wsh'
Image|endswith:
- '\cscript.exe'
- '\mshta.exe'
- '\powershell.exe'
- '\pwsh.exe'
- '\wscript.exe'
selection_parent_7zip:
CommandLine|contains: '\AppData\local\temp\7z*\'
ParentImage|endswith: '\7z*.exe'
selection_parent_explorer:
CommandLine|contains:
- '\AppData\local\temp\*.rar\'
- '\AppData\local\temp\*.zip\'
ParentImage|endswith: '\explorer.exe'
selection_parent_winrar:
CommandLine|contains: '\AppData\local\temp\rar*\'
ParentImage|endswith: '\winrar.exe'
condition: 1 of selection_parent_* and selection_child
The rule’s detection, its selections and fields in order of name. The whole rule, with its references and false positives, is on SigmaHQ, by @kostastsale, under the Detection Rule License 1.1. CmdID evaluates it on a command line alone: a test on what a command line cannot show, such as the parent process or the user, is not met.
None of the everyday examples and documented commands on CmdID’s program pages trips it. To see whether a command line does, paste it into CmdID.
Programs and files it names
ATT&CK
T1059Command and Scripting Interpreter