Detectionmediumtest
Potentially Suspicious Powershell Script Execution From Temp Folder
Detects a potentially suspicious powershell 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 Tue Feb 17a6a39bdb-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 Logic5 selectors
detection:
selection:
Image|endswith:
- '\powershell.exe'
- '\pwsh.exe'
CommandLine|contains:
- '\Windows\Temp'
- '\Temporary Internet'
- '\AppData\Local\Temp'
- '\AppData\Roaming\Temp'
- '%TEMP%'
- '%TMP%'
- '%LocalAppData%\Temp'
filter_optional_vscode:
CommandLine|contains: '-WindowStyle hidden -Verb runAs'
filter_optional_amazon_ec2:
CommandLine|contains: '\Windows\system32\config\systemprofile\AppData\Local\Temp\Amazon\EC2-Windows\'
filter_optional_generic:
CommandLine|contains:
- ' >'
- 'Out-File'
- 'ConvertTo-Json'
filter_optional_chocolatey_installer:
ParentImage:
- 'C:\Windows\System32\Msiexec.exe'
- 'C:\Windows\SysWOW64\Msiexec.exe'
Image|endswith: '\powershell.exe'
CommandLine|contains|all:
- '-NoProfile -ExecutionPolicy Bypass -Command'
- 'AppData\Local\Temp\'
- 'Install-Chocolatey.ps1'
condition: selection and not 1 of filter_optional_*False Positives
Administrative scripts
References
MITRE ATT&CK
Tactics
Sub-techniques
Rule Metadata
Rule ID
a6a39bdb-935c-4f0a-ab77-35f4bbf44d33
Status
test
Level
medium
Type
Detection
Created
Wed Jul 14
Modified
Tue Feb 17
Path
rules/windows/process_creation/proc_creation_win_powershell_script_exec_from_temp_folder.yml
Raw Tags
attack.executionattack.t1059.001