def run(self): try: fp = attempt_observation_for_service(self.sid, self.timeout_sec) notary_common.report_observation(self.server_obj.db_file, self.sid, fp) except Exception, e: pass
def get_sni_client_hello(hostname): hn_extension = get_hostname_extension(hostname) all_extensions = hn_extension the_rest = "03014d786109055e4736b93b63c371507f824c2d0f05a25b2d54b6b52a1e43c2a52c00002800390038003500160013000a00330032002f000500040015001200090014001100080006000300ff020100" + get_twobyte_hexstr(len(all_extensions)/2) + all_extensions proto_len = (len(the_rest) / 2) rec_len = proto_len + 4 return "160301" + get_twobyte_hexstr(rec_len) + "01" + get_threebyte_hexstr(proto_len) + the_rest if __name__ == "__main__": if len(sys.argv) != 3 and len(sys.argv) != 2: print >> sys.stderr, "ERROR: usage: <service-id> [notary-db-file>]" exit(1) service_id = sys.argv[1] try: fp = attempt_observation_for_service(service_id, 10) if len(sys.argv) == 3: notary_common.report_observation(sys.argv[2], service_id, fp) else: print "INFO: no database specified, not saving observation" print "Successful scan complete: '%s' has key '%s' " % (service_id,fp) except: print "Error scanning for %s" % service_id traceback.print_exc(file=sys.stdout)
hn_extension = get_hostname_extension(hostname) all_extensions = hn_extension the_rest = "03014d786109055e4736b93b63c371507f824c2d0f05a25b2d54b6b52a1e43c2a52c00002800390038003500160013000a00330032002f000500040015001200090014001100080006000300ff020100" + get_twobyte_hexstr( len(all_extensions) / 2) + all_extensions proto_len = (len(the_rest) / 2) rec_len = proto_len + 4 return "160301" + get_twobyte_hexstr( rec_len) + "01" + get_threebyte_hexstr(proto_len) + the_rest if __name__ == "__main__": if len(sys.argv) != 3 and len(sys.argv) != 2: print >> sys.stderr, "ERROR: usage: <service-id> [notary-db-file>]" exit(1) service_id = sys.argv[1] try: fp = attempt_observation_for_service(service_id, 10) if len(sys.argv) == 3: notary_common.report_observation(sys.argv[2], service_id, fp) else: print "INFO: no database specified, not saving observation" print "Successful scan complete: '%s' has key '%s' " % (service_id, fp) except: print "Error scanning for %s" % service_id traceback.print_exc(file=sys.stdout)
def run(self): try: fp = attempt_observation_for_service(self.sid, self.timeout_sec) notary_common.report_observation(self.server_obj.db_file, self.sid, fp) except Exception, e: traceback.print_exc(file=sys.stdout)
"""TLSv1 client hello with SNI extension""" hn_extension = get_hostname_extension(hostname) all_extensions = hn_extension the_rest = "03014d786109055e4736b93b63c371507f824c2d0f05a25b2d54b6b52a1e43c2a52c00002800390038003500160013000a00330032002f000500040015001200090014001100080006000300ff020100" + get_twobyte_hexstr(len(all_extensions)/2) + all_extensions proto_len = (len(the_rest) / 2) rec_len = proto_len + 4 return "160301" + get_twobyte_hexstr(rec_len) + "01" + get_threebyte_hexstr(proto_len) + the_rest if __name__ == "__main__": if len(sys.argv) != 3: print >> sys.stderr, "ERROR: usage: <service-id> <config_file>" exit(1) config.config_initialize(sys.argv[2]) db.db_initialize(config.Config) service_id = notary_common.ObservedServer(sys.argv[1]) try: fp = attempt_observation_for_service(service_id, 10) print "Successful scan complete: '%s' has key '%s' " % (service_id,fp) notary_common.report_observation(service_id, fp) except: print "Error scanning for %s" % service_id traceback.print_exc(file=sys.stdout)