Skip to content

Instantly share code, notes, and snippets.

@brohee
Last active November 5, 2020 13:35
Show Gist options
  • Save brohee/8948f19699f859d0c66bb671f97a92ce to your computer and use it in GitHub Desktop.
Save brohee/8948f19699f859d0c66bb671f97a92ce to your computer and use it in GitHub Desktop.
PKCS#12 tips and tricks

Listing the content of a PKCS#12 container

openssl pkcs12 -info -noout -in file.p12

or

keytool -list -storetype pkcs12 -v --keystore file.p12

Change the password of a PKCS#12 container

More context at https://stackoverflow.com/a/50900084/298043, but in substance

keytool -storetype pkcs12 -storepasswd -keystore file.p12 

Crack a PKCS#12 container password

Sadly no hashcat support, limited to CPU using options...

Using crackpkcs12

Program found at https://github.com/crackpkcs12/crackpkcs12

crackpkcs12-0.2.11/src/crackpkcs12 -t 2 -m 6 -c A -v -p AB file.pfx

Using John the Ripper

Need the full community edition for pfx2john be there, OS package is crippled, see https://geekeries.org/2016/08/casser-un-p12-avec-johntheripper/?cn-reloaded=1.

Then

pfx2john file.p12  |john /dev/stdin
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment