T1552.003: Shell 历史
摘要
攻击者可能在受感染的系统上搜索命令历史以查找不安全存储的凭据。 在 Linux 和 macOS 系统上,Bash 和 Zsh 等 shell 使用 "history" 实用工具跟踪用户在命令行上键入的命令。一旦用户注销,历史记录会被刷写到用户的历史文件中。对于每个用户,此文件位于相同位置:例如 `~/.bash_history` 或 `~/.zsh_history`。通常,这些文件跟踪用户最近的 1000 条命令。 在 Windows 上,PowerShell 既有在会话结束后被清除的命令历史,也有包含所有会话中使用命令并持久性的历史。持久性历史的默认位置可以在 `%userprofile%\AppData\Roaming\Microsoft\Windows\PowerShell\PSReadline\ConsoleHost_history.txt` 中找到,但命令历史也可以使用 `Get-History` 访问。Windows 上的命令提示符(CMD)没有持久性历史。(Citation: Microsoft about_History)(Citation: Medium) 用户经常在命令行上键入用户名和密码作为程序的参数,这些在注销时会被保存到此文件。攻击者可以通过浏览该文件查找潜在凭据来滥用这一点。(Citation: External to DA, the OS X Way)
来源归属
来源:MITRE ATT&CK · 置信度:high
平台
- Linux
- macOS
- Windows
战术
凭据访问
参考来源
- https://attack.mitre.org/techniques/T1552/003
- https://www.slideshare.net/slideshow/external-to-da-the-os-x-way/62021418
- https://michaelkoczwara.medium.com/windows-privilege-escalation-dbb908cce8d4
- https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_history?view=powershell-7.5