Detection rules › Splunk
Account Password Changed from Command Line - Windows (PowerShell)
Adversaries may interrupt availability of system and network resources by inhibiting access to accounts utilized by legitimate users. Accounts may be deleted, locked, or manipulated (ex: changed credentials) to remove access to accounts. This use case detects commands involving the use of net.exe to change account passwords
MITRE ATT&CK coverage
| Tactic | Techniques |
|---|---|
| Impact | T1531 Account Access Removal |
References
Event coverage
| Provider | Event | Title |
|---|---|---|
| PowerShell | Event ID 4104 | Creating Scriptblock text (MessageNumber of MessageTotal). |
Rule body yaml
id: '19280.34213'
title: Account Password Changed from Command Line - Windows
description: 'Adversaries may interrupt availability of system and network resources
by inhibiting access to accounts utilized by legitimate users. Accounts may be deleted,
locked, or manipulated (ex: changed credentials) to remove access to accounts. This
use case detects commands involving the use of net.exe to change account passwords.
Atomics T1531 Test #1'
logic_format: Splunk
logic: '`get_endpoint_data` `get_endpoint_data_powershell` (TERM(EventCode=4104) OR
"<EventID>4104<") (TERM(net) OR TERM(net1) OR "net.exe" OR "net1.exe") TERM(user)
| regex process="(?i)net1?(\.exe)?\s+user\s+\S+\s+\S+"| regex process!="(?i)\/\S+"
| rex field=process "(?i)user\s+(?<target_account>[^\s]+)\s+\S+" | table _time,
host, user process, process_*, parent_process, target_account | bin span=1s | stats
values(*) as * by _time, host '
techniques:
- impact:account access removal
technique_id:
- T1531
data_category:
- PowerShell logs
- Process command-line parameters
references:
- https://github.com/redcanaryco/atomic-red-team/blob/master/atomics/T1531/T1531.md#atomic-test-1---change-user-password---windows
- https://www.trendmicro.com/vinfo/us/security/news/cyber-attacks/what-you-need-to-know-about-the-lockergoga-ransomware
Stages and Predicates
Stage 1: search
`get_endpoint_data` `get_endpoint_data_powershell` (TERM(EventCode=4104) OR "<EventID>4104<") (TERM(net) OR TERM(net1) OR "net.exe" OR "net1.exe") TERM(user)
Stage 2: regex
| regex process="(?i)net1?(\.exe)?\s+user\s+\S+\s+\S+"
Stage 3: regex
| regex process!="(?i)\/\S+"
Stage 4: rex
| rex field=process "(?i)user\s+(?<target_account>[^\s]+)\s+\S+"
Stage 5: table
| table _time, host, user process, process_*, parent_process, target_account
Stage 6: bucket
| bin span=1s
Stage 7: stats
| stats values(*) as * by _time, host
Exclusions
Top-level NOT(...) conjuncts: predicates this rule actively suppresses.
| Field | Kind | Excluded values |
|---|---|---|
process | regex_match | "(?i)\/\S+" |
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>4104<" |
| 1 | TERM |
| 1 | net |
| 1 | TERM |
| 1 | net1 |
| 1 | "net.exe" |
| 1 | "net1.exe" |
| 1 | TERM |
| 1 | user |