title: Powershell in Windows Run Keys
id: 8d85cf08-bf97-4260-ba49-986a2a65129c
status: experimental
description: Adds a RUN key that contains a powershell keyword
references:
    - https://github.com/frack113/atomic-red-team/blob/master/atomics/T1547.001/T1547.001.md#atomic-test-9---systembc-malware-as-a-service-registry
author: frack113, Florian Roth
date: 2022/03/17
modified: 2022/03/18
logsource:
    category: registry_event
    product: windows
detection:
    selection: 
        EventType: SetValue
        TargetObject|contains: 
            - '\Software\Microsoft\Windows\CurrentVersion\Run'
            - '\Software\Microsoft\Windows\CurrentVersion\RunOnce'
        Details|contains: 
            - 'powershell'
            - 'FromBase64String'
            - '.DownloadFile('
            - '.DownloadString('
            - ' -w hidden '
            - ' -nop '
            - ' -encodedcommand '
    condition: selection
falsepositives:
    - Legitim admin script
level: medium
tags:
    - attack.persistence
    - attack.t1547.001
