Potentially Suspicious Powershell Script Execution From Temp Folder (via process_creation)

This rule detects a potentially anomalous powershell script executions from temporary folder

SigmamediumWindowsv1
sigma
title: Potentially Suspicious Powershell Script Execution From Temp Folder (via process_creation)
id: b41e7fe8-87ba-5fa4-bd27-befd32cc0378
status: stable
description: This rule detects a potentially anomalous powershell script executions from temporary folder
references:
    - https://attack.mitre.org/techniques/T1059/001/
    - https://www.microsoft.com/security/blog/2021/07/13/microsoft-discovers-threat-actor-targeting-solarwinds-serv-u-software-with-0-day-exploit/
author: Huntrule Team
date: 2026-06-02
tags:
    - attack.execution
    - attack.t1059.001
logsource:
    category: process_creation
    product: windows
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_*
falsepositives:
    - Unknown
level: medium

Known false positives

  • Unknown

Detection content is published as a reviewed draft. Tune thresholds and exclusions against your own telemetry before enabling this rule for alerting.