Detection rules › Sigma
Unsigned AppX Installation Attempt Using Add-AppxPackage - PsScript
Detects usage of the "Add-AppxPackage" or it's alias "Add-AppPackage" to install unsigned AppX packages
MITRE ATT&CK coverage
| Tactic | Techniques |
|---|---|
| Persistence | No specific technique |
| Stealth | No specific technique |
Event coverage
| Provider | Event | Title |
|---|---|---|
| PowerShell | Event ID 4104 | Creating Scriptblock text (MessageNumber of MessageTotal). |
Rule body yaml
title: Unsigned AppX Installation Attempt Using Add-AppxPackage - PsScript
id: 975b2262-9a49-439d-92a6-0709cccdf0b2
related:
- id: 37651c2a-42cd-4a69-ae0d-22a4349aa04a
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:
product: windows
category: ps_script
definition: Script Block Logging must be enable
detection:
selection_cmdlet:
ScriptBlockText|contains:
- 'Add-AppPackage '
- 'Add-AppxPackage '
selection_flag:
ScriptBlockText|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_cmdlet
selection_cmdlet:
ScriptBlockText|contains:
- 'Add-AppPackage '
- 'Add-AppxPackage '
Stage 2: selection_flag
selection_flag:
ScriptBlockText|contains: ' -AllowUnsigned'
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.
| Field | Kind | Values |
|---|---|---|
ScriptBlockText | match |
|