Tool for extract the informations from a signed PE, certificate (cer or base 64) and parse it to a json.
Useful for hunt samples using the same certificate (campaign) , get serial informations for having to revocation list or combine hash and signature for a goodware software used illegitimate ...
-f give the path to certificate file
-fexe give the path to signed PE file
-o path to write the json file (by default "result.json" in the same directory of the script)
> .\SoulCube.ps1 -f "ca-bundle.cer" -o MyResult.json
> .\SoulCube.ps1 -f "Cert.txt" -o MyResult.json
> .\SoulCube.ps1 -fexe "C:\Windows\explorer.exe" -o MyResult.json
> $Data =(gc MyResult.json)|convertfrom-json
> $Data.header
Filename : explorer.exe
FileHash : 4cf1661ef7b8d767656fe0830f54ce4c02a13ba2ec8688fbbcb3eecb96175bb5
IssuerName : CN=Microsoft Windows Production PCA 2011, O=Microsoft Corporation, L=Redmond, S=Washington, C=US
CertHash : ff82bc38e1da5e596df374c53e3617f7eda36b06
ValidFrom : 2019-05-02 23:24:36
ValidTo : 2020-05-02 23:24:36
Version : 3
SerialNumber : 330000023241fb59996dcc4dff000000000232
> $Data.Meta
PrivateKey PublicKey
---------- ---------
@{ProviderType=PROV_RSA_AES; KeyNumber=1; CryptoKeySecurity=; RandomlyGenerated=True; KeyExchangeAlgorithm=RSA-PKCS1-KeyEx; KeySize=2048; PersistKeyInCsp=False; Algorithm=RSA; Key=48 130 1 10 2 130 1 1 0 146 99 ...
> $Data.Meta.PublicKey
ProviderType : PROV_RSA_AES
KeyNumber : 1
CryptoKeySecurity :
RandomlyGenerated : True
KeyExchangeAlgorithm : RSA-PKCS1-KeyEx
KeySize : 2048
PersistKeyInCsp : False
Algorithm : RSA
Key : 48 130 1 10 2 130 1 1 0 146 99 19 91 ...