Detection rules › Sigma

PowerShell Web Access Installation - PsScript

Status
test
Severity
high
Log source
product windows, category ps_script
Author
Michael Haag
Source
github.com/SigmaHQ/sigma

Detects the installation and configuration of PowerShell Web Access, which could be used for remote access and potential abuse

MITRE ATT&CK coverage

Event coverage

Rule body yaml

title: PowerShell Web Access Installation - PsScript
id: 5f9c7f1a-7c21-4c39-b2f3-8d8006e0e51f
status: test
description: Detects the installation and configuration of PowerShell Web Access, which could be used for remote access and potential abuse
references:
    - https://docs.microsoft.com/en-us/powershell/module/powershellwebaccess/install-pswawebapplication
    - https://www.cisa.gov/news-events/cybersecurity-advisories/aa24-241a
    - https://gist.github.com/MHaggis/7e67b659af9148fa593cf2402edebb41
author: Michael Haag
date: 2024-09-03
tags:
    - attack.persistence
    - attack.execution
    - attack.t1059.001
logsource:
    product: windows
    category: ps_script
    definition: 'Requirements: Script Block Logging must be enabled'
detection:
    selection_install:
        ScriptBlockText|contains: 'Install-WindowsFeature WindowsPowerShellWebAccess'
    selection_config:
        ScriptBlockText|contains: 'Install-PswaWebApplication'
    selection_auth:
        ScriptBlockText|contains|all:
            - 'Add-PswaAuthorizationRule'
            - '-UserName *'
            - '-ComputerName *'
    condition: 1 of selection_*
falsepositives:
    - Legitimate PowerShell Web Access installations by administrators
level: high

Stages and Predicates

Stage 0: condition

1 of selection_*

Stage 1: selection_install

selection_install:
    ScriptBlockText|contains: 'Install-WindowsFeature WindowsPowerShellWebAccess'

Stage 2: selection_config

selection_config:
    ScriptBlockText|contains: 'Install-PswaWebApplication'

Stage 3: selection_auth

selection_auth:
    ScriptBlockText|contains|all:
        - 'Add-PswaAuthorizationRule'
        - '-UserName *'
        - '-ComputerName *'

Indicators

Each row is a field, operator, and value that the rule matches. The corpus column counts how many other rules in the catalog look for the same combination: high numbers point to widely-used, community-vetted indicators. Blank or 1 shows that the indicator is specific to this rule.

FieldKindValues
ScriptBlockTextmatch
  • -ComputerName *
  • -UserName *
  • Add-PswaAuthorizationRule
  • Install-PswaWebApplication
  • Install-WindowsFeature WindowsPowerShellWebAccess