Has removed PowerShell command history through the use of the PSReadLine module by running the PowerShell command Remove-Item (Get-PSReadlineOption).HistorySavePath.1
Prevent Command History Logging T1690
- Tactic
- Defense Impairment
- Platforms
- ESXi, Linux, macOS, Network Devices, Windows
- Version
- 1.0
- Created
- 14 April 2026
- Last modified
- 12 May 2026
- Contributors
- Austin Clark, @c2defense; Emile Kenning, Sophos; Vikas Singh, Sophos
Adversaries may impair command history logging to hide commands they run on a compromised system. Various command interpreters keep track of the commands users type in their terminal so that users can retrace what they have done.
Prevent Command History Logging MITRE reference T1690
4 groups have been recorded using this technique. Newest first; each entry carries MITRE’s procedure text and a link to the group’s full record. Click a name to filter the rules below.
Has tampered with and disabled logging services on targeted systems.1
Unset the Bash and MySQL history files on victim systems.1
Has prepended a space to all of their terminal commands to operate without leaving traces in the HISTCONTROL environment.1
All 4 groups for this technique
2 campaigns have been recorded using this technique. Listed newest first; dates are year-granularity and attribution is MITRE’s.
During RedPenguin, UNC3886 used malware to clear the HISTFILE environmental variable and to inject into Junos OS processes to inhibit logging.12
Included disabling logging on targeted Cisco ASA appliances.12
All 2 campaigns for this technique
6 software entries are documented implementing this technique. MITRE files each as a tool or as malware; newest first, then by how many groups carry them.
Has disabled logging and log forwarding on Ivanti devices targeting the dslogserver process.1234
Has impaired command logging through the use of dev/null which prevents generating output from the command and does not wait for input.1
Can impair logging by setting the HISTFILE environmental variable to 0 and stopping the vmsyslogd service.1
Can disable syslog on compromised devices.1
Sets the MYSQL_HISTFILE and HISTFILE to /dev/null preventing the shell and MySQL from logging history in /proc/<PID>/environ.1
Can bypass ScriptBlock logging to execute unmanaged PowerShell code from memory.1
All 6 software entries for this technique
Offense vs defense T1690
Is defensive coverage keeping up with adversary use? Eight counts, each ranked against all 697 ATT&CK techniques. Attack sits left, defense right, so a shape leaning left means adversaries are better documented here than defenders are equipped. Hover any spoke for its percentile and the share of techniques that have more. The timeline below shows when each side arrived.
How it got here
Adversary activity (campaign spans) over cumulative rule output. Each source is plotted independently from zero, so neither line includes the other. Campaign dates are year-granularity.
Prevent Command History Logging detection strategy DET0563
MITRE names one behaviour worth catching for this technique and breaks it into 5 analytics, one per platform. Each carries the log sources it needs and the fields you tune per environment.
Detection Strategy for Defense Impairment via Prevent Command History Logging across OS platforms.
AN1555 · Linux
Detection of environment variable tampering (HISTFILE, HISTCONTROL, HISTFILESIZE) and absence of expected bash history writes. Correlation of unset or zeroed history variables with active shell sessions is indicative of adversarial evasion.
Log sources
The data this analytic draws on. You do not need every component — each one you already collect covers part of it. Each links to its ATT&CK record.
| Data component | Name | Channel |
|---|---|---|
| Process CreationDC0032 | linux:osquery | processes modifying environment variables related to history logging |
| Command ExecutionDC0064 | auditd:SYSCALL | execve calls modifying HISTFILE or HISTCONTROL via unset/export |
Tunable fields
MITRE calls these the analytic’s mutable elements: the thresholds and filters you set for your own environment.
| Field | What you tune |
|---|---|
| MonitoredUsers | Specific accounts or groups where history logging must always be enforced. |
| TimeWindow | Correlation period to detect unset/export of history variables during active shells. |
AN1556 · macOS
Detection of bash/zsh history suppression via HISTFILE/HISTCONTROL manipulation and absence of ~/.bash_history updates. Observing environment variable changes tied to terminal processes is a strong indicator.
Log sources
The data this analytic draws on. You do not need every component — each one you already collect covers part of it. Each links to its ATT&CK record.
| Data component | Name | Channel |
|---|---|---|
| Command ExecutionDC0064 | macos:unifiedlog | Set or unset HIST* variables in shell environment |
Tunable fields
MITRE calls these the analytic’s mutable elements: the thresholds and filters you set for your own environment.
| Field | What you tune |
|---|---|
| ShellProfiles | Different shells (bash, zsh, fish) may require customized monitoring for history tampering. |
AN1557 · Windows
Detection of PowerShell history suppression using Set-PSReadLineOption with SaveNothing or altered HistorySavePath. Correlating these options with PowerShell usage highlights adversarial evasion attempts.
Log sources
The data this analytic draws on. You do not need every component — each one you already collect covers part of it. Each links to its ATT&CK record.
| Data component | Name | Channel |
|---|---|---|
| Process CreationDC0032 | WinEventLog:Sysmon | EventCode=1 |
| Command ExecutionDC0064 | WinEventLog:PowerShell | EventCode=4103, 4104, 4105, 4106 |
Tunable fields
MITRE calls these the analytic’s mutable elements: the thresholds and filters you set for your own environment.
| Field | What you tune |
|---|---|
| AllowedPaths | List of acceptable PowerShell history save paths for baseline comparison. |
AN1558 · ESXi
Detection of unset HISTFILE or modified history variables in ESXi shell sessions. Correlation of suspicious shell sessions with no recorded commands despite active usage.
Log sources
The data this analytic draws on. You do not need every component — each one you already collect covers part of it. Each links to its ATT&CK record.
| Data component | Name | Channel |
|---|---|---|
| Command ExecutionDC0064 | esxi:shell | unset HISTFILE or HISTFILESIZE modifications |
Tunable fields
MITRE calls these the analytic’s mutable elements: the thresholds and filters you set for your own environment.
| Field | What you tune |
|---|---|
| AdminSessions | Differentiate root/admin shell sessions from adversarial misuse of ESXi shell. |
AN1559 · Network Devices
Detection of CLI commands that disable history logging such as 'no logging'. Anomalous lack of new commands in session logs while activity persists is a strong signal.
Log sources
The data this analytic draws on. You do not need every component — each one you already collect covers part of it. Each links to its ATT&CK record.
| Data component | Name | Channel |
|---|---|---|
| Command ExecutionDC0064 | networkdevice:cli | Commands like 'no logging' or equivalents that disable session history |
Tunable fields
MITRE calls these the analytic’s mutable elements: the thresholds and filters you set for your own environment.
| Field | What you tune |
|---|---|
| DeviceVendors | Command syntax differs across Cisco, Juniper, Fortinet, etc., requiring vendor-aware tuning. |
Prevent users from changing the HISTCONTROL, HISTFILE, and HISTFILESIZE environment variables.
Make sure that the HISTCONTROL environment variable is set to “ignoredups” instead of “ignoreboth” or “ignorespace”.
Tests from Atomic Red Team (MIT licence) · technique definition