Detection rules › Sigma

Unsigned AppX Installation Attempt Using Add-AppxPackage

Status
test
Severity
medium
Log source
category process_creation, product windows
Author
Nasreddine Bencherchali (Nextron Systems)
Source
github.com/SigmaHQ/sigma

Detects usage of the "Add-AppxPackage" or it's alias "Add-AppPackage" to install unsigned AppX packages

Known false positives

  • Installation of unsigned packages for testing purposes

MITRE ATT&CK coverage

TacticTechniques
PersistenceNo specific technique
StealthNo specific technique

Telemetry coverage

ProviderRecord / event type
SysmonEvent ID 1: Process creation

Rule body

title: Unsigned AppX Installation Attempt Using Add-AppxPackage
id: 37651c2a-42cd-4a69-ae0d-22a4349aa04a
related:
    - id: 975b2262-9a49-439d-92a6-0709cccdf0b2
      type: similar
    - id: 9a025188-6f2d-42f8-bb2f-d3a83d24a5af
      type: similar
status: test
description: Detects usage of the "Add-AppxPackage" or it's alias "Add-AppPackage" to install unsigned AppX packages
references:
    - https://learn.microsoft.com/en-us/windows/msix/package/unsigned-package
    - https://twitter.com/WindowsDocs/status/1620078135080325122
author: Nasreddine Bencherchali (Nextron Systems)
date: 2023-01-31
tags:
    - attack.persistence
    - attack.stealth
logsource:
    category: process_creation
    product: windows
detection:
    selection_img:
        - Image|endswith:
              - '\powershell.exe'
              - '\pwsh.exe'
        - OriginalFileName:
              - 'PowerShell.EXE'
              - 'pwsh.dll'
    selection_cmdlet:
        CommandLine|contains:
            - 'Add-AppPackage '
            - 'Add-AppxPackage '
    selection_flag:
        CommandLine|contains: ' -AllowUnsigned'
    condition: all of selection_*
falsepositives:
    - Installation of unsigned packages for testing purposes
level: medium

Stages and Predicates

Stage 0: condition

all of selection_*

Stage 1: selection_img

selection_img:
    - Image|endswith:
          - '\powershell.exe'
          - '\pwsh.exe'
    - OriginalFileName:
          - 'PowerShell.EXE'
          - 'pwsh.dll'

Stage 2: selection_cmdlet

selection_cmdlet:
    CommandLine|contains:
        - 'Add-AppPackage '
        - 'Add-AppxPackage '

Stage 3: selection_flag

selection_flag:
    CommandLine|contains: ' -AllowUnsigned'

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
CommandLinematch
  • -AllowUnsigned
  • Add-AppPackage
  • Add-AppxPackage
field:"CommandLine" kind:match
Imageends_with
  • \powershell.exe corpus 179 (sigma 178, kusto 1)
  • \pwsh.exe corpus 165 (sigma 164, kusto 1)
field:"Image" kind:ends_with
OriginalFileNameeq
  • PowerShell.EXE corpus 138 (sigma 84, splunk 30, elastic 24)
  • pwsh.dll corpus 112 (sigma 79, splunk 30, elastic 3)
field:"OriginalFileName" kind:eq