CyberKit

ATT&CK map

T1690: Prevent Command History Logging

Tactics: Defense Impairment. Platforms: ESXi, Linux, macOS, Network Devices, Windows.

Adversaries may impair command history logging to hide commands they run on a compromised system.

MITRE's description

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. On Linux and macOS, command history is tracked in a file pointed to by the environment variable HISTFILE. When a user logs off a system, this information is flushed to a file in the user's home directory called ~/.bash_history.

Telemetry that detects it

  • Command Execution
  • Process Creation

Mitigations

Operating System Configuration
Make sure that the HISTCONTROL environment variable is set to “ignoredups” instead of “ignoreboth” or “ignorespace”.
Environment Variable Permissions
Prevent users from changing the HISTCONTROL, HISTFILE, and HISTFILESIZE environment variables.

Procedure examples

  • APT38 has prepended a space to all of their terminal commands to operate without leaving traces in the HISTCONTROL environment.
  • ArcaneDoor included disabling logging on targeted Cisco ASA appliances.
  • BPFDoor sets the MYSQL_HISTFILE and HISTFILE to /dev/null preventing the shell and MySQL from logging history in /proc/<PID>/environ.
  • BRICKSTORM has impaired command logging through the use of dev/null which prevents generating output from the command and does not wait for input.

12 documented uses in all. These are a sample.

T1690 on attack.mitre.org

MITRE ATT&CK Enterprise 19.2. © 2026 The MITRE Corporation. This work is reproduced and distributed with the permission of The MITRE Corporation.