Indicator Removal: Clear Command History T1070.003

Tactic: Stealth

In addition to clearing system logs, an adversary may clear the command history of a compromised account to conceal the actions undertaken during an intrusion. Various command interpreters keep track of the commands users type in their terminal so that users can retrace what they've done.

Events covered

8 catalog events are tagged with this technique by at least one rule.

Authoring guide

Patterns shared across the 15 rules above: which fields they filter on, what specific values they look for, and what they exclude. The catalog normalizes field names across vendors so Sigma's Image, Elastic's process.name, and Splunk's process_name collapse into one row. Each rule contributes at most once per row.

Fields filtered most (18 distinct)

The fields most rules look at when detecting this technique. The How column shows the operators authors use (eq, wildcard, regex_match, match) and how often each appears. Sample values are concrete examples to start from, not an exhaustive list.

FieldRulesHowSample values
ScriptBlockText5contains 5, ends_with 1(get-psreadlineoption).historysavepath, -historysavestyle, .historysavepath, \\\\.\\, clear-history
event.type4eq 4start, deletion
EventType3eq 2, in 1exec, exec_event, executed
CommandLine2contains 2 del, rm , (get-psreadlineoption).historysavepath, \software\microsoft\windows\currentversion\explorer\runmru, clear-history
EventID2eq 1, in 123, 26, 4104
OriginalFileName2eq 1, in 1powershell.exe, powershell_ise.exe, pwsh.dll, reg.exe
host.os.type2eq 2
process.args2eq 2, contains 1, in 1, wildcard 1+o, -c, -s0, .bash_history
process_name2eq 2history, powershell.exe, powershell_ise.exe, pwsh.exe
Image1ends_with 1\reg.exe
Payload1contains 1(get-psreadlineoption).historysavepath, -historysavestyle, del
TargetFilename1ends_with 1\\microsoft\\windows\\powershell\\psreadline\\consolehost...
TargetObject1ends_with 1\software\microsoft\windows\currentversion\explorer\runmru
container.id1starts_with 1?
event.category1eq 1, in 1file, process

Top indicator values (104 distinct)

Specific (field, operator, value) combinations the rules check for, ranked by how many rules under this technique use each one. The Corpus reach column counts how many rules across the entire catalog (any technique) check the same combination. High numbers point to widely-used indicators that are likely noisy on their own; combine them with another condition for useful signal. Blank means the combination is specific to rules under this technique. Click a value to expand the rules under this technique that use it.

FieldKindValueRules (here)Corpus reach
event.typeeq
start
4606
ScriptBlockTextcontains
remove-item
33
ScriptBlockTextcontains
(get-psreadlineoption).historysavepath
22
ScriptBlockTextcontains
rm
22
EventTypeeq
exec
2171
process.argseq
+o
22
process.argseq
-c
230
process.argseq
HISTFILE
22
process.argseq
history
22
process.argseq
set
26
process.argseq
unset
22
CommandLinecontains
del
13
CommandLinecontains
rm
1
CommandLinecontains
(get-psreadlineoption).historysavepath
12
CommandLinecontains
\software\microsoft\windows\currentversion\explorer\runmru
1
CommandLinecontains
clear-history
1
CommandLinecontains
consolehost_history.txt
12
CommandLinecontains
remove-item
12
CommandLinecontains
savenothing
1
CommandLinecontains
set-psreadlineoption
1
EventIDeq
4104
1268
EventIDin
23
16
EventIDin
26
16
EventTypein
exec
1171
EventTypein
exec_event
1139
EventTypein
executed
188
EventTypein
process_started
174
Imageends_with
\reg.exe
158
OriginalFileNameeq
reg.exe
142
OriginalFileNamein
powershell.exe
117

Exclusions (9 distinct)

Field/operator/value combinations excluded by rules under this technique (top-level not() clauses), sorted by how many rules exclude each. These are the false-positive paths the community has learned to filter out. A new rule that ignores the high-count entries here will likely fire on the same noisy paths. Click a value to expand the rules under this technique that exclude it.

FieldKindValueRules excluding
CommandLineeq
stat -c %s history
1
Imagewildcard
/bin/grep
1
Imagewildcard
/usr/bin/bazel
1
Imagewildcard
/usr/bin/git
1
Imagewildcard
/usr/bin/jq
1
Imagewildcard
/usr/bin/kubectl
1
Imagewildcard
/usr/bin/psql
1
Imagewildcard
/usr/bin/timeout
1
Imagewildcard
/usr/lib/postgresql/*/bin/psql
1

Rules under this technique

Every rule in the catalog tagged with this technique, grouped by vendor. Click a rule title for its full predicates, exclusions, and indicators.

Platform (all)
Domain (all)

Sigma 9 rules

Elastic 4 rules

Splunk 2 rules