Skip to content

Instantly share code, notes, and snippets.

@pmoranga
Created September 16, 2016 09:54
Show Gist options
  • Save pmoranga/f09b6a567fa82e861e95d680351b9ed4 to your computer and use it in GitHub Desktop.
Save pmoranga/f09b6a567fa82e861e95d680351b9ed4 to your computer and use it in GitHub Desktop.
Get the (readable) certificate from a windows executable (PE)

Get the (readable) certificate from a windows executable (PE)

From: http://web.fournier.nl/2013/10/get-readable-certificate-from-windows.html

I searched high and low for a simple (linux) solution on how to extract the certificate of an authenticode signed windows binary. I don't want to use wine, nor mono. This is what I came up with:

  • Extract the certificate with 7zip: 7z e setup.exe CERTIFICATE
  • remove the first 8 bytes: dd if=CERTIFICATE bs=1 skip=8 of=setup.exe.pkcs7
  • Read it: openssl pkcs7 -in setup.exe.pkcs7 -inform DER -print_certs -text
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment