| name | T1552.003_shell-history |
| description | Adversaries may search the command history on compromised systems for insecurely stored credentials. |
| category | authentication |
| version | 18.1 |
| author | cyberstrike-official |
| tags | ["mitre-attack","enterprise","t1552.003","credential-access","linux","macos","windows","sub-technique"] |
| technique_id | T1552.003 |
| tactic | credential-access |
| all_tactics | ["credential-access"] |
| platforms | ["Linux","macOS","Windows"] |
| mitre_url | https://attack.mitre.org/techniques/T1552/003 |
| tech_stack | ["linux","macos","windows"] |
| cwe_ids | ["CWE-522"] |
| chains_with | ["T1552","T1552.001","T1552.002","T1552.004","T1552.005","T1552.006","T1552.007","T1552.008"] |
| prerequisites | ["T1552"] |
| severity_boost | {"T1552":"Chain with T1552 for deeper attack path","T1552.001":"Chain with T1552.001 for deeper attack path","T1552.002":"Chain with T1552.002 for deeper attack path"} |
T1552.003 Shell History
Sub-technique of: T1552
High-Level 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.
Kill Chain Phase
- Credential Access (TA0006)
Platforms: Linux, macOS, Windows
What to Check
How to Test
Atomic Red Team Tests
The following tests are from Atomic Red Team and provide actionable ways to test this technique:
Atomic Test 1: Search Through Bash History
Search through bash history for specifice commands we want to capture
Supported Platforms: linux, macos