title: Suspicious Script Execution From Temp Folder
id: a6a39bdb-935c-4f0a-ab77-35f4bbf44d33
description: Detects a suspicious script executions from temporary folder
status: experimental
references:
    - https://www.microsoft.com/security/blog/2021/07/13/microsoft-discovers-threat-actor-targeting-solarwinds-serv-u-software-with-0-day-exploit/
author: Florian Roth, Max Altgelt
date: 2021/07/14
modified: 2021/11/11
tags:
    - attack.execution
    - attack.t1059
logsource:
    category: process_creation
    product: windows
detection:
    selection:
        Image|endswith:
            - '\powershell.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
    condition: selection and not filter
falsepositives:
    - Administrative scripts
level: high
