-
Notifications
You must be signed in to change notification settings - Fork 379
dpapi prekey command
skelsec edited this page Apr 13, 2021
·
3 revisions
Generates pre-keys which in turn will allow decryption of a masterkey file.
This command can perform the key generation using either *password* + SID
or *NT* hash + SID
or via parsing the *registry* hive files
, hence the three subcommand options
There are three possible pre-keys generated for a given credential. Two out of the three keys can be generated without knowing the password only using the NT hash but it's not guaranteed that those two will always yield a successful decryption of a given masterkey.
User's SID and either plaintext password or NT hash. If using the registry then you only need the registry hive files.
-
password
: This will take the user'sSID
(S-1-5-...) andpassword
to generate all three prekey candidates -
nt
: This will take the user'sNT hash
andSID
to generate two out of the possible three prekeys -
registry
: This will takeregistry hive files
to yield the prekeys for the machine account (NT/SYSTEM user)
-
-o
: Writes the prekeys in a text file
-
pypykatz dpapi prekey password 'S-1-5-21-3448413973-1765323015-1500960949-1105' 'Passw0rd!1'
: Generates three prekeys from the user's SID and password. -
pypykatz dpapi prekey nt 'S-1-5-21-3448413973-1765323015-1500960949-1105' f8963568a1ec62a3161d9d6449baba93
: Generates two out of the three possible prekeys using the user's SID and NT hash -
pypykatz dpapi prekey registry SYSTEM.reg SAM.reg SECURITY.reg
: Parses registry hives an extracts prekeys stored there.