Synacktiv DPAPI Sthack
Synacktiv DPAPI Sthack
Synacktiv DPAPI Sthack
Présenté 07/04/2017
Pour STHACK 2017 – rump session
Par Jean-Christophe Delaunay
whoami /groups
Jean-Christophe Delaunay – @Fist0urs
Jiss/Fist0urs on IRC
Synacktiv – www.synacktiv.ninja
2 / 17
What is DPAPI – a bit of history
3 / 17
What is DPAPI – wtfbbq?
Cryptography based on user’s password (not exactly in fact)
Easy to implement for developpers:
CryptProtectData
CryptUnprotectData
Widely used:
Credential Manager, Windows Vault, IE, Wifi, Certificates,
VPN, etc.
Google Chrome, GTalk, Skype, Dropbox, iCloud, Safari,
etc.
4 / 17
DPAPI Internals – developpers view
5 / 17
DPAPI Internals – crypto
Secret based on user’s password…
… but this is not secure enough, let’s use master
keys, stored in undocumented blobs structures
6 / 17
DPAPI Internals – crypto
7 / 17
DPAPI Internals – overview
8 / 17
DPAPI Internals – masterkeys
stored… ?
GUID2
…
Preferred
9 / 17
DPAPI – pentests
2 possibilities:
I can execute some code on the remote host
I can’t...
10 / 17
DPAPI – existing tools
11 / 17
DPAPI – pentests
12 / 17
DPAPI – pentests
$DPAPImk$*2*local*S-1-5-21-XXXXXXXXX-XXXXXXXXXX-XXXXXXXXXX-
1001*aes256*sha512*8000*1d52563XXXXXXXXXXXXXXXXXa0665d79*28
8*0049e65595bbXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXX7e3b70539567d80afea5168d31c6ccd48b07b8328eb969295611c
850f8cf25f06e7f9aede0f5fb4e
13 / 17
DPAPI – useful?
14 / 17
DPAPI – roadmap
15 / 17
ANY QUESTIONS?
[1] https://www.passcape.com/
[2] https://github.com/CoreSecurity/impacket
[3] http://blog.gentilkiwi.com/mimikatz
[4] http://dpapick.com/
[5] https://github.com/dfirfpi/dpapilab
17 / 17