Detectionhightest

Suspicious Script Execution From Temp Folder

Detects a suspicious script executions from temporary folder

Convert In Phoenix Studio

Open this Sigma rule in the converter with the YAML preloaded and ready for backend selection.

Launch
Florian Roth (Nextron Systems), Max Altgelt (Nextron Systems), Tim SheltonCreated Wed Jul 14Updated Wed Oct 05a6a39bdb-935c-4f0a-ab77-35f4bbf44d33windows
Log Source
WindowsProcess Creation
ProductWindows← raw: windows
CategoryProcess Creation← raw: process_creation

Events generated when a new process is spawned on the system. Covers command-line arguments, parent/child relationships, and process metadata.

Detection Logic
Detection Logic2 selectors
detection:
    selection:
        Image|endswith:
            - '\powershell.exe'
            - '\pwsh.exe'
            - '\mshta.exe'
            - '\wscript.exe'
            - '\cscript.exe'
        CommandLine|contains:
            - '\Windows\Temp'
            - '\Temporary Internet'
            - '\AppData\Local\Temp'
            - '\AppData\Roaming\Temp'
            - '%TEMP%'
            - '%TMP%'
            - '%LocalAppData%\Temp'
    filter:
        CommandLine|contains:
            - ' >'
            - 'Out-File'
            - 'ConvertTo-Json'
            - '-WindowStyle hidden -Verb runAs'  # VSCode behaviour if file cannot be written as current user
            - '\Windows\system32\config\systemprofile\AppData\Local\Temp\Amazon\EC2-Windows\' # EC2 AWS
    condition: selection and not filter
False Positives

Administrative scripts

Rule Metadata
Rule ID
a6a39bdb-935c-4f0a-ab77-35f4bbf44d33
Status
test
Level
high
Type
Detection
Created
Wed Jul 14
Modified
Wed Oct 05
Path
rules/windows/process_creation/proc_creation_win_susp_script_exec_from_temp.yml
Raw Tags
attack.executionattack.t1059
View on GitHub