This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import ConfigParser | |
import optparse | |
import binascii | |
import hashlib | |
import pefile | |
import sys | |
def dumpPEResource(f,r): | |
try: | |
pe = pefile.PE(f) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import ssl | |
import sys | |
import optparse | |
import ConfigParser | |
import OpenSSL | |
def getCertificate(s): | |
cert_pem = ssl.get_server_certificate((s, 443)) | |
cert_der = ssl.PEM_cert_to_DER_cert(cert_pem) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import OpenSSL | |
import sys | |
def parseCert(certFile): | |
cert = open(certFile, 'rb') | |
x509 = OpenSSL.crypto.load_certificate(OpenSSL.crypto.FILETYPE_PEM, cert.read()) | |
subject = x509.get_subject() | |
issuer = x509.get_issuer() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
__author__ = 'moranned' | |
import argparse | |
import binascii | |
def printArray(s, key): | |
b = bytearray(s) | |
for i in range(len(b)): | |
b[i] ^= key | |
enc = binascii.hexlify(b) |