示例#1
0
def run():
    if not FLAGS.output:
        raise Exception("Certificates output directory must be specified.")

    res = scanner.scan_log(match, "https://ct.googleapis.com/pilot",
                           FLAGS.multi, write_matched_certificate)
    print "Scanned %d, %d matched and %d failed strict or partial parsing" % (
        res.total, res.matches, res.errors)
def run():
    if not os.path.exists(FLAGS.output_directory):
        os.mkdir(FLAGS.output_directory)
    res = scanner.scan_log(
        ev_match,
        "https://ct.googleapis.com/pilot", FLAGS.multi)
    print "Scanned %d, %d matched and %d failed strict or partial parsing" % (
        res.total, res.matches, res.errors)
def run():
    if not FLAGS.output:
        raise Exception("Certificates output directory must be specified.")

    res = scanner.scan_log(
        match, "https://ct.googleapis.com/pilot", FLAGS.multi,
        write_matched_certificate)
    print "Scanned %d, %d matched and %d failed strict or partial parsing" % (
        res.total, res.matches, res.errors)
def generate_ev_cert_hashes_from_log(log_url):
    """Scans the given log and generates a list of hashes for all EV
    certificates in it.

    Returns a tuple of (scan_results, hashes_list)"""
    ev_hashes = set()
    def add_hash(cert_hash):
        """Store the hash. Always called from the main process, so safe."""
        ev_hashes.add(cert_hash)
    res = scanner.scan_log(_ev_match, log_url, FLAGS.multi, add_hash)
    return (res, ev_hashes)
示例#5
0
def run():
    """
    Kick off the multi-threaded certificate search
    """
    if not FLAGS.output:
        raise Exception("Certificates output directory must be specified.")

    res = scanner.scan_log(
        match, "https://ct1.digicert-ct.com/log", FLAGS.multi,
        write_matched_certificate)
    print "Scanned %d, %d matched and %d failed strict or partial parsing" % (
        res.total, res.matches, res.errors)
def generate_ev_cert_hashes_from_log(
        log_url, num_processes, output_directory):
    """Scans the given log and generates a list of hashes for all EV
    certificates in it.

    Returns a tuple of (scan_results, hashes_list)"""
    if output_directory and not os.path.exists(output_directory):
        os.makedirs(output_directory)

    ev_hashes = set()
    def add_hash(cert_hash):
        """Store the hash. Always called from the main process, so safe."""
        ev_hashes.add(cert_hash)
    bound_ev_match = functools.partial(_ev_match, output_directory)
    res = scanner.scan_log(bound_ev_match, log_url, num_processes, add_hash)
    return (res, ev_hashes)
def generate_ev_cert_hashes_from_log(log_url, num_processes, output_directory):
    """Scans the given log and generates a list of hashes for all EV
    certificates in it.

    Returns a tuple of (scan_results, hashes_list)"""
    if output_directory and not os.path.exists(output_directory):
        os.makedirs(output_directory)

    ev_hashes = set()

    def add_hash(cert_hash):
        """Store the hash. Always called from the main process, so safe."""
        ev_hashes.add(cert_hash)

    bound_ev_match = functools.partial(_ev_match, output_directory)
    res = scanner.scan_log(bound_ev_match, log_url, num_processes, add_hash)
    return (res, ev_hashes)
示例#8
0
def run():
    if not FLAGS.output:
        raise Exception("Certificates output directory must be specified.")
    if not os.path.exists(FLAGS.output):
        # Create output folder is is does not exist
        os.makedirs(FLAGS.output)

    if not FLAGS.log:
        raise Exception("Log to scan must be specified.")

    res = scanner.scan_log(
        match_callback=match,
        log_url=FLAGS.log,
        total_processes=FLAGS.multi,
        matcher_output_handler=write_matched_certificate,
        start_entry=FLAGS.startat,
    )

    print "Scanned %d, %d matched and %d failed strict or partial parsing" % (
        res.total, res.matches, res.errors)