Detection rules › Splunk
pypykatz commands (Windows Event Log)
pypykatz is a Mimikatz implementation in Python. This use case looks for command parameters associated with pypykatz
MITRE ATT&CK coverage
| Tactic | Techniques |
|---|---|
| Credential Access | T1003.001 OS Credential Dumping: LSASS Memory |
References
Event coverage
| Provider | Event | Title |
|---|---|---|
| Security-Auditing | Event ID 4688 | A new process has been created. |
Rule body yaml
id: '8301.10294'
title: pypykatz commands
description: 'pypykatz is a Mimikatz implementation in Python. This use case looks
for command parameters associated with pypykatz. -- Threat Actor Association: APT15,
Muddled Libra, Mustang Panda (aka. Stately Taurus//Earth Preta/BRONZE PRESIDENT/TA416/RedDelta)
-- Software Association: BianLian, Vice Society, Yanluowang -- Atomics T1003.001
Test #7 Atomics T1003.002 Test #2'
logic_format: Splunk
logic: '`get_endpoint_data` `get_endpoint_data_winevent` (TERM(EventCode=4688) OR
"<EventID>4688<") (TERM(live) (TERM(lsa) OR TERM(kerberos) OR TERM(smbapi) OR TERM(users)
OR TERM(token) OR TERM(process) OR TERM(dpapi) OR TERM(smb) OR TERM(ldap) OR TERM(registry)))
OR (TERM(lsa) (TERM(minidump) OR TERM(rekall))) OR TERM(registry) OR (TERM(crypto)
(TERM(nt) OR TERM(lm) OR TERM(dcc) OR TERM(dcc2) OR TERM(gppass))) OR (TERM(kerberos)
(TERM(tgt) OR TERM(tgs) OR TERM(brute) OR TERM(asreproast) OR TERM(spnroast) OR
TERM(s4u) OR TERM(keytab) OR TERM(ccache) OR TERM(kirbi))) OR (TERM(dpapi) (TERM(prekey)
OR TERM(minidump) OR TERM(masterkey) OR TERM(credential) OR TERM(vcred) OR TERM(vpol)
OR TERM(securestring) OR TERM(blob))) OR (TERM(SMB) (TERM(client) OR TERM(lsassfile)
OR TERM(lsassdump) OR TERM(regfile) OR TERM(regdump) OR TERM(dcsync) OR TERM(secretsdump)
OR TERM(shareenum) OR TERM(printnightmare) OR TERM(parprintnightmare))) OR (TERM(ldap)
(client)) | table _time, host, user, signature_id, signature, process, process_*,
parent_* | bin span=1s | stats values(*) as * by _time, host | where match(process,
"(?i)\s+live\s+(lsa|registry|smb|kerberos|users|token|dpapi|process|ldap)") OR match(process,
"(?i)\s+((lsa\s+(minidump|rekall|\-\-?\w))|(registry\s+(\-\-?\w|hk|\x5c).+)|(crypto\s+(nt|lm|dcc|gppass|\-\-?\w))|(kerberos\s+(tgt|tgs|brute|asreproast|spnroast|s4u|keytab|ccache|kirbi|\-\-?\w))|(dpapi\s+(prekey|minidump|masterkey|credential|vcred|vpol|securestring|blob|\-\-?\w))|(smb\s+(client|lsassfile|lsassdump|regfile|regdump|dcsync|secretsdump|shareenum|printnightmare|parprintnightmare|\-\-?\w))|(ldap\s+(client|\-\-?\w)))") '
techniques:
- credential-access:os credential dumping
- credential-access:os credential dumping:lsass memory
technique_id:
- T1003
- T1003.001
data_category:
- Windows event logs
- Process command-line parameters
references:
- https://blog.talosintelligence.com/2020/04/poetrat-covid-19-lures.html
- https://github.com/skelsec/pypykatz/wiki
- https://github.com/redcanaryco/atomic-red-team/blob/717757d539c1e7d5b8a2ab05b029f4697fbcc978/atomics/T1003.002/T1003.002.md#atomic-test-2---registry-parse-with-pypykatz
Stages and Predicates
Stage 1: search
`get_endpoint_data` `get_endpoint_data_winevent` (TERM(EventCode=4688) OR "<EventID>4688<") (TERM(live) (TERM(lsa) OR TERM(kerberos) OR TERM(smbapi) OR TERM(users) OR TERM(token) OR TERM(process) OR TERM(dpapi) OR TERM(smb) OR TERM(ldap) OR TERM(registry))) OR (TERM(lsa) (TERM(minidump) OR TERM(rekall))) OR TERM(registry) OR (TERM(crypto) (TERM(nt) OR TERM(lm) OR TERM(dcc) OR TERM(dcc2) OR TERM(gppass))) OR (TERM(kerberos) (TERM(tgt) OR TERM(tgs) OR TERM(brute) OR TERM(asreproast) OR TERM(spnroast) OR TERM(s4u) OR TERM(keytab) OR TERM(ccache) OR TERM(kirbi))) OR (TERM(dpapi) (TERM(prekey) OR TERM(minidump) OR TERM(masterkey) OR TERM(credential) OR TERM(vcred) OR TERM(vpol) OR TERM(securestring) OR TERM(blob))) OR (TERM(SMB) (TERM(client) OR TERM(lsassfile) OR TERM(lsassdump) OR TERM(regfile) OR TERM(regdump) OR TERM(dcsync) OR TERM(secretsdump) OR TERM(shareenum) OR TERM(printnightmare) OR TERM(parprintnightmare))) OR (TERM(ldap) (client))
Stage 2: table
| table _time, host, user, signature_id, signature, process, process_*, parent_*
Stage 3: bucket
| bin span=1s
Stage 4: stats
| stats values(*) as * by _time, host
Stage 5: where
| where match(process, "(?i)\s+live\s+(lsa|registry|smb|kerberos|users|token|dpapi|process|ldap)") OR match(process, "(?i)\s+((lsa\s+(minidump|rekall|\-\-?\w))|(registry\s+(\-\-?\w|hk|\x5c).+)|(crypto\s+(nt|lm|dcc|gppass|\-\-?\w))|(kerberos\s+(tgt|tgs|brute|asreproast|spnroast|s4u|keytab|ccache|kirbi|\-\-?\w))|(dpapi\s+(prekey|minidump|masterkey|credential|vcred|vpol|securestring|blob|\-\-?\w))|(smb\s+(client|lsassfile|lsassdump|regfile|regdump|dcsync|secretsdump|shareenum|printnightmare|parprintnightmare|\-\-?\w))|(ldap\s+(client|\-\-?\w)))")
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 |
|
process | match |
|
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>4688<" |
| 1 | TERM |
| 1 | live |
| 1 | TERM |
| 1 | lsa |
| 1 | TERM |
| 1 | kerberos |
| 1 | TERM |
| 1 | smbapi |
| 1 | TERM |
| 1 | users |
| 1 | TERM |
| 1 | token |
| 1 | TERM |
| 1 | process |
| 1 | TERM |
| 1 | dpapi |
| 1 | TERM |
| 1 | smb |
| 1 | TERM |
| 1 | ldap |
| 1 | TERM |
| 1 | registry |
| 1 | TERM |
| 1 | lsa |
| 1 | TERM |
| 1 | minidump |
| 1 | TERM |
| 1 | rekall |
| 1 | TERM |
| 1 | registry |
| 1 | TERM |
| 1 | crypto |
| 1 | TERM |
| 1 | nt |
| 1 | TERM |
| 1 | lm |
| 1 | TERM |
| 1 | dcc |
| 1 | TERM |
| 1 | dcc2 |
| 1 | TERM |
| 1 | gppass |
| 1 | TERM |
| 1 | kerberos |
| 1 | TERM |
| 1 | tgt |
| 1 | TERM |
| 1 | tgs |
| 1 | TERM |
| 1 | brute |
| 1 | TERM |
| 1 | asreproast |
| 1 | TERM |
| 1 | spnroast |
| 1 | TERM |
| 1 | s4u |
| 1 | TERM |
| 1 | keytab |
| 1 | TERM |
| 1 | ccache |
| 1 | TERM |
| 1 | kirbi |
| 1 | TERM |
| 1 | dpapi |
| 1 | TERM |
| 1 | prekey |
| 1 | TERM |
| 1 | minidump |
| 1 | TERM |
| 1 | masterkey |
| 1 | TERM |
| 1 | credential |
| 1 | TERM |
| 1 | vcred |
| 1 | TERM |
| 1 | vpol |
| 1 | TERM |
| 1 | securestring |
| 1 | TERM |
| 1 | blob |
| 1 | TERM |
| 1 | SMB |
| 1 | TERM |
| 1 | client |
| 1 | TERM |
| 1 | lsassfile |
| 1 | TERM |
| 1 | lsassdump |
| 1 | TERM |
| 1 | regfile |
| 1 | TERM |
| 1 | regdump |
| 1 | TERM |
| 1 | dcsync |
| 1 | TERM |
| 1 | secretsdump |
| 1 | TERM |
| 1 | shareenum |
| 1 | TERM |
| 1 | printnightmare |
| 1 | TERM |
| 1 | parprintnightmare |
| 1 | TERM |
| 1 | ldap |
| 1 | client |