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

Telemetry coverage

Rule body

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

These rows show field, operator, and value matches.

FieldKindValuesSearch
EventCodeeq
  • 4688 corpus 317 (splunk 283, kusto 33, elastic 1)
field:"EventID" kind:eq value:"4688"
c_processlt
  • 3 corpus 6 (splunk 6)
field:"c_process" kind:lt value:"3"
dc_hosteq
  • 1 corpus 8 (splunk 8)
field:"dc_host" kind:eq value:"1"

Search terms

These SPL tokens match against raw event text.

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