#!/usr/bin/python # -*- coding: utf-8 -*- import sys from certtools import * import argparse parser = argparse.ArgumentParser(description="") parser.add_argument('--domain', default=None, help="RTFM") parser.add_argument('--exclude-expired', action='store_true', help="RTFM") args = parser.parse_args() monitored_domains = [ "google.com", "preishelden.de", "liu.se", "nordu.net", "symantec.com", ] # data = [] f = open("plausible_cert_data.json") for line in f: tmp = json.loads(line) try: success = True if args.domain: if args.domain in tmp["subject"].split("CN=")[1] or \ args.domain in tmp["SAN"]: pass else: success = False if args.exclude_expired: print "EXCLUDE EXPIRED NOT IMPLEMENTED YET" if success: print tmp["subject"].split("CN=")[1] + " certified by " + tmp["issuer"].split("CN=")[1] except: pass f.close() # for item in data[10000:]: # try: # s = item["subject"].split("CN=")[1] # print "\n" + s # print item["SAN"] # except: # pass # print "\nTotal entries: " + str(len(data))