MITRE ATT&CKsub-technique

T1552.003 Shell History

Published 2020-02-04 Modified 2025-10-24 Official page ↗
Domain
enterprise
Tactics
Credential Access
Platforms
Linux, macOS, Windows
Version
2.0
Created
2020-02-04

Description

Adversaries may search the command history on compromised systems for insecurely stored credentials. On Linux and macOS systems, shells such as Bash and Zsh keep track of the commands users type on the command-line with the "history" utility. Once a user logs out, the history is flushed to the user's history file. For each user, this file resides at the same location: for example, `~/.bash_history` or `~/.zsh_history`. Typically, these files keeps track of the user's last 1000 commands. On Windows, PowerShell has both a command history that is wiped after the session ends, and one that contains commands used in all sessions and is persistent. The default location for persistent history can be found in `%userprofile%\AppData\Roaming\Microsoft\Windows\PowerShell\PSReadline\ConsoleHost_history.txt`, but command history can also be accessed with `Get-History`. Command Prompt (CMD) on Windows does not have persistent history. Users often type usernames and passwords on the command-line as parameters to programs, which then get saved to this file when they log out. Adversaries can abuse this by looking through the file for potential credentials.

Related

Subtechnique of · MITRE ATT&CK (1)

  • T1552 Unsecured Credentials technique

Tactic · MITRE ATT&CK (1)

  • TA0006 Credential Access tactic

Referenced by MITRE ATT&CK · mitigates (1)

  • M1028 Operating System Configuration mitigation

Referenced by MITRE ATT&CK · uses (5)

  • C0064 AI-Assisted Breach of Mexico's Government Infrastructure campaign
  • S9045 BACKUPOSINT v9.0 APEX PREDATOR software (malware)
  • S9041 TeamPCP Cloud Stealer software (malware)
  • S0599 Kinsing software (malware)
  • G0082 APT38 group

Referenced by CAPEC · att&ck technique (1)

  • CAPEC-639 Probe System Files attack pattern

Referenced by Compliance · mitigates (5)

  • CIS-4.11 Enforce Remote Wipe Capability on Portable End-User Devices CIS Safeguard v8.1
  • NIST-CM-6 Configuration Settings NIST 800-53 control
  • NIST-CM-7 Least Functionality NIST 800-53 control
  • NIST-SC-28 Protection of Information at Rest NIST 800-53 control
  • NIST-SI-4 System Monitoring NIST 800-53 control

References