diff options
Diffstat (limited to 'monitor/josef_reader.py')
| -rwxr-xr-x | monitor/josef_reader.py | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/monitor/josef_reader.py b/monitor/josef_reader.py new file mode 100755 index 0000000..bf415f7 --- /dev/null +++ b/monitor/josef_reader.py @@ -0,0 +1,60 @@ +#!/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)) + |
