Detection rules › Splunk
Application Discovery - Windows (PowerShell)
Adversaries may attempt to get a listing of software and software versions that are installed on a system or in a cloud environment. Adversaries may use the information from Software Discovery during automated discovery to shape follow-on behaviors, including whether or not the adversary fully infects the target and/or attempts specific actions. Adversaries may attempt to enumerate software for a variety of reasons, such as figuring out what security measures are present or if the compromised system has a version of software that is vulnerable to Exploitation for Privilege Escalation. This use case detects commands enumerating applications installed on a Windows system
MITRE ATT&CK coverage
| Tactic | Techniques |
|---|---|
| Discovery | T1518 Software Discovery |
References
Event coverage
| Provider | Event | Title |
|---|---|---|
| PowerShell | Event ID 4103 | Payload Context: ContextInfo User Data: UserData. |
| PowerShell | Event ID 4104 | Creating Scriptblock text (MessageNumber of MessageTotal). |
Rule body yaml
id: '17427.29297'
title: Application Discovery - Windows
description: 'Adversaries may attempt to get a listing of software and software versions
that are installed on a system or in a cloud environment. Adversaries may use the
information from Software Discovery during automated discovery to shape follow-on
behaviors, including whether or not the adversary fully infects the target and/or
attempts specific actions. Adversaries may attempt to enumerate software for a variety
of reasons, such as figuring out what security measures are present or if the compromised
system has a version of software that is vulnerable to Exploitation for Privilege
Escalation. This use case detects commands enumerating applications installed on
a Windows system. Atomics T1518 Test #2'
logic_format: Splunk
logic: '`get_endpoint_data` `get_endpoint_data_powershell` (TERM(EventCode=4103) OR
"<EventID>4103<" OR TERM(EventCode=4104) OR "<EventID>4104<") (TERM(query) OR (TERM(Get-ItemProperty)
OR TERM(gp)) "Software" "Uninstall") OR ("wmic" TERM(product)) | regex process="(?i)((\s+query\s+|Get-ItemProperty|gp\s+).*\x5cUninstall\x5c\*)|wmic\s+product\s+get\s+"
| table _time, host, user, process, process_*, parent_process_name | bin span=1s
| stats values(*) as * by _time, host '
techniques:
- discovery:software discovery
technique_id:
- T1518
data_category:
- PowerShell logs
references:
- https://github.com/redcanaryco/atomic-red-team/blob/master/atomics/T1518/T1518.md#atomic-test-2---applications-installed
Stages and Predicates
Stage 1: search
`get_endpoint_data` `get_endpoint_data_powershell` (TERM(EventCode=4103) OR "<EventID>4103<" OR TERM(EventCode=4104) OR "<EventID>4104<") (TERM(query) OR (TERM(Get-ItemProperty) OR TERM(gp)) "Software" "Uninstall") OR ("wmic" TERM(product))
Stage 2: regex
| regex process="(?i)((\s+query\s+|Get-ItemProperty|gp\s+).*\x5cUninstall\x5c\*)|wmic\s+product\s+get\s+"
Stage 3: table
| table _time, host, user, process, process_*, parent_process_name
Stage 4: bucket
| bin span=1s
Stage 5: stats
| stats values(*) as * by _time, host
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.
Search terms
Bare-string tokens in the SPL search body. Splunk matches each token against _raw (the untyped raw event text) anywhere it appears, not against a specific field. These don't surface in the Indicators table because they aren't predicates on a known field.
| Stage | Term |
|---|---|
| 1 | TERM |
| 1 | "<EventID>4103<" |
| 1 | TERM |
| 1 | "<EventID>4104<" |
| 1 | TERM |
| 1 | query |
| 1 | "Get-ItemProperty" |
| 1 | TERM |
| 1 | gp |
| 1 | "Software" |
| 1 | "Uninstall" |
| 1 | "wmic" |
| 1 | TERM |
| 1 | product |