action: global
title: Invoke-Obfuscation Via Stdin
description: Detects Obfuscated Powershell via Stdin in Scripts
status: experimental
author: Nikita Nazarov, oscd.community
date: 2020/10/12
modified: 2021/08/09
references:
    - https://github.com/Neo23x0/sigma/issues/1009 #(Task28)
tags:
    - attack.defense_evasion
    - attack.t1027
    - attack.execution
    - attack.t1059.001
falsepositives:
    - Unknown
level: high
detection:
    selection:
        ImagePath|re: '(?i).*(set).*&&\s?set.*(environment|invoke|\${?input).*&&.*"'
    condition: selection and selection_eventid
---
id: 487c7524-f892-4054-b263-8a0ace63fc25
logsource:
    product: windows
    service: system
detection:
    selection_eventid:
        EventID: 7045
---
id: 82b66143-53ee-4369-ab02-de2c70cd6352
logsource:
    product: windows
    category: driver_load
detection:
    selection_eventid:
        EventID: 6
---
id: 80b708f3-d034-40e4-a6c8-d23b7a7db3d1
logsource:
    product: windows
    service: security
detection:
    selection_eventid:
        EventID: 4697
