Detection rules › Splunk
PowerShell Clipboard Access (PowerShell)
Infostealer malware including Bbystealer may use PowerShell commands to access the clipboard to retrieve or store information. This use case detects PowerShell cmdlets and commands used to access the clipboard.
MITRE ATT&CK coverage
| Tactic | Techniques |
|---|---|
| Execution | T1059.001 Command and Scripting Interpreter: PowerShell |
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: '23306.42453'
title: PowerShell Clipboard Access
description: Infostealer malware including Bbystealer may use PowerShell commands
to access the clipboard to retrieve or store information. This use case detects
PowerShell cmdlets and commands used to access the clipboard.
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(Get-Clipboard)
OR TERM(gcb) OR TERM(Set-Clipboard) OR TERM(scb) OR ".Clipboard" | table _time,
host, user, signature_id, process, process_name, parent_process_name | bin span=1s
| stats values(*) as * by _time, host '
techniques:
- execution:command and scripting interpreter:powershell
- collection:clipboard data
technique_id:
- T1059.001
data_category:
- PowerShell logs
references:
- https://cyble.com/blog/bbystealer-malware-resurfaces-sets-sights-on-vpn-users/
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(Get-Clipboard) OR TERM(gcb) OR TERM(Set-Clipboard) OR TERM(scb) OR ".Clipboard"
Stage 2: table
| table _time, host, user, signature_id, process, process_name, parent_process_name
Stage 3: bucket
| bin span=1s
Stage 4: 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.
| Field | Kind | Values |
|---|---|---|
EventCode | eq |
|
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 | "Get-Clipboard" |
| 1 | TERM |
| 1 | gcb |
| 1 | "Set-Clipboard" |
| 1 | TERM |
| 1 | scb |
| 1 | ".Clipboard" |