Detection rules › Splunk

Locate Credentials (Windows Event Log)

Group by
_time, command_line, host
Source
github.com/anvilogic-forge/armory

Adversaries may search local file systems and remote file shares for files containing passwords. These can be files created by users to store their own credentials, shared credential stores for a group of individuals, configuration files containing passwords for a system or service, or source code/binary files containing embedded passwords

MITRE ATT&CK coverage

References

Event coverage

Rule body yaml

id: '1081.1130'
title: Locate Credentials
description: 'Adversaries may search local file systems and remote file shares for
  files containing passwords. These can be files created by users to store their own
  credentials, shared credential stores for a group of individuals, configuration
  files containing passwords for a system or service, or source code/binary files
  containing embedded passwords. -- Threat Actor Association: Alloy Taurus/Gallium,
  Antlion, APT15, APT29/Nobelium/Cozy Bear, DarkSide, BlackMatter, Lancyfly, Lapsus$,
  TeamTNT, Wizard Spider - Software Association: ALPHV/BlackCat, Conti, Ransom Cartel,
  Snake, TeamTNT -- Atomics 1003.002 Test #5 NOTE *Only for the Powershell version
  Atomics T1552.001 Test#1 Atomics T1552.001 Test#3 Atomics T1552.006 Test#1 Atomics
  T1552.004 Test#2'
logic_format: Splunk
logic: '`get_endpoint_data` `get_endpoint_data_winevent` (TERM(EventCode=4688) OR
  "<EventID>4688<") AND (TERM(findstr) AND (TERM(password) OR TERM(txt) OR TERM(ini)
  OR TERM(xml) OR TERM(pass) OR TERM(cred) OR TERM(vnc) OR TERM(config) OR TERM(spin)
  )) OR (TERM(type) AND (TERM(sysprep) OR TERM(unattend) OR TERM(Unattended)) AND
  (TERM(inf) OR TERM(ini) OR TERM(xml))) OR (TERM(dir) AND (TERM(vnc) OR TERM(ultravnc))
  AND (TERM(inf) OR TERM(ini) OR TERM(xml))) OR ((TERM(cmd) AND TERM(/c) AND TERM(copy))
  AND ("ntds.dit" OR TERM(SAM) OR TERM(System) )) OR (TERM(vssadmin) AND TERM(create)
  AND TERM(SHADOW)) OR (TERM(ntdsutil)) OR ("Wmic" TERM(shadowcopy)) | table _time,
  host, user, process, process_*, parent_*, signature_id | bin span=300s | stats values(*)
  as * by _time, host | stats values(*) as * by _time, host| eventstats dc(host) as
  dc_host by process| eventstats count as c_process by process| where dc_host=1 and
  c_process<3 '
techniques:
- credential-access:unsecured credentials:credentials in files
technique_id:
- T1552.001
data_category:
- Windows event logs
references:
- https://attack.mitre.org/techniques/T1552/001/

Stages and Predicates

Stage 1: search

`get_endpoint_data` `get_endpoint_data_winevent` (TERM(EventCode=4688) OR "<EventID>4688<") AND (TERM(findstr) AND (TERM(password) OR TERM(txt) OR TERM(ini) OR TERM(xml) OR TERM(pass) OR TERM(cred) OR TERM(vnc) OR TERM(config) OR TERM(spin) )) OR (TERM(type) AND (TERM(sysprep) OR TERM(unattend) OR TERM(Unattended)) AND (TERM(inf) OR TERM(ini) OR TERM(xml))) OR (TERM(dir) AND (TERM(vnc) OR TERM(ultravnc)) AND (TERM(inf) OR TERM(ini) OR TERM(xml))) OR ((TERM(cmd) AND TERM(/c) AND TERM(copy)) AND ("ntds.dit" OR TERM(SAM) OR TERM(System) )) OR (TERM(vssadmin) AND TERM(create) AND TERM(SHADOW)) OR (TERM(ntdsutil)) OR ("Wmic" TERM(shadowcopy))

Stage 2: table

| table _time, host, user, process, process_*, parent_*, signature_id

Stage 3: bucket

| bin span=300s

Stage 4: stats

| stats values(*) as * by _time, host

Stage 5: stats

| stats values(*) as * by _time, host

Stage 6: eventstats

| eventstats dc(host) as dc_host by process

Stage 7: eventstats

| eventstats count as c_process by process

Stage 8: where

| where dc_host=1 and c_process<3

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.

FieldKindValues
EventCodeeq
  • 4688 corpus 313 (splunk 283, kusto 30)
c_processlt
  • 3 corpus 5 (splunk 5)
dc_hosteq
  • 1 corpus 6 (splunk 6)

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.

StageTerm
1TERM
1"<EventID>4688<"
1TERM
1findstr
1TERM
1password
1TERM
1txt
1TERM
1ini
1TERM
1xml
1TERM
1pass
1TERM
1cred
1TERM
1vnc
1TERM
1config
1TERM
1spin
1TERM
1type
1TERM
1sysprep
1TERM
1unattend
1TERM
1Unattended
1TERM
1inf
1TERM
1ini
1TERM
1xml
1TERM
1dir
1TERM
1vnc
1TERM
1ultravnc
1TERM
1inf
1TERM
1ini
1TERM
1xml
1TERM
1cmd
1"/c"
1TERM
1copy
1"ntds.dit"
1TERM
1SAM
1TERM
1System
1TERM
1vssadmin
1TERM
1create
1TERM
1SHADOW
1TERM
1ntdsutil
1"Wmic"
1TERM
1shadowcopy