Sigma rule: Manual Execution of Script Inside of a Compressed File

A detection rule from the SigmaHQ repository, shown as its author published it. Dataset version ref-b4427bdd8f5d, updated 2024-08-13T00:00:00.000Z.

Rule

Title
Manual Execution of Script Inside of a Compressed File
Status
test
Level
medium
Author
@kostastsale
Date
2023-02-15
Modified
2024-08-13
File
rules-threat-hunting/windows/process_creation/proc_creation_win_susp_script_exec_from_compressed_parent.yml
Commit
ccbb0369507f796db0b0ae6854c8a2be471b9d84

This is a threat-hunting query to collect information related to the interactive execution of a script from inside a compressed file (zip/rar). Windows will automatically run the script using scripting interpreters such as wscript and cscript binaries.

From the query below, the child process is the script interpreter that will execute the script. The script extension is also a set of standard extensions that Windows OS recognizes. Selections 1-3 contain three different execution scenarios.
1. Compressed file opened using 7zip.
2. Compressed file opened using WinRar.
3. Compressed file opened using native windows File Explorer capabilities.

When the malicious script is double-clicked, it will be extracted to the respected directories as signified by the CommandLine on each of the three Selections. It will then be executed using the relevant script interpreter."

Log source

product
windows
category
process_creation

Detection

selection_parent_7zip:
    ParentImage|endswith: '\7z*.exe'
    CommandLine|contains: '\AppData\local\temp\7z*\'
selection_parent_winrar:
    ParentImage|endswith: '\winrar.exe'
    CommandLine|contains: '\AppData\local\temp\rar*\'
selection_parent_explorer:
    ParentImage|endswith: '\explorer.exe'
    CommandLine|contains:
        - '\AppData\local\temp\*.rar\'
        - '\AppData\local\temp\*.zip\'
selection_child:
    Image|endswith:
        - '\cscript.exe'
        - '\mshta.exe'
        - '\powershell.exe'
        - '\pwsh.exe'
        - '\wscript.exe'
    CommandLine|endswith:
        - '.hta'
        - '.js'
        - '.jse'
        - '.ps1'
        - '.vbe'
        - '.vbs'
        - '.wsf'
        - '.wsh'
condition: 1 of selection_parent_* and selection_child

False positives (as the rule lists them)

  • Batch files may produce a lot of noise, as many applications appear to bundle them as part of their installation process. You should baseline your environment and generate a new query excluding the noisy and expected activity. Some false positives may come up depending on your environment. All results should be investigated thoroughly before filtering out results.

Tags

  • attack.execution
  • attack.t1059
  • detection.threat-hunting

MITRE ATT&CK ids this rule names

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-threat-hunting/windows/process_creation/proc_creation_win_susp_script_exec_from_compressed_parent.yml

Sources and licences

  • SigmaHQ

    "Manual Execution of Script Inside of a Compressed File" by @kostastsale (SigmaHQ). Rule: https://github.com/SigmaHQ/sigma/blob/ccbb0369507f796db0b0ae6854c8a2be471b9d84/rules-threat-hunting/windows/process_creation/proc_creation_win_susp_script_exec_from_compressed_parent.yml.
    Licensed under the Detection Rule License (DRL) 1.1: https://github.com/SigmaHQ/Detection-Rule-License

    Detection Rule License (DRL) 1.1

Cite this page

Dragons Eye Ransomware Tracker, "Sigma rule: Manual Execution of Script Inside of a Compressed File",
entity page, dataset version ref-b4427bdd8f5d, updated 2024-08-13T00:00:00.000Z,
https://ransomware-tracker.com/detections/sigma/95724fc1-a258-4674-97db-a30351981c5a (accessed 2026-11-03).
Underlying source: SigmaHQ rule 95724fc1-a258-4674-97db-a30351981c5a, 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.