示例#1
0
                idx] + ':' + port_list[idx] + path_list[idx]
        _, server_header, res_header, res_body, encoding = utility.send_request(
            'GET', test_url)

        # Check cloud service.
        cloud_type = 'Unknown'
        if opt_cloud:
            cloud_type = cloud_checker.get_cloud_service(fqdn_list[idx])

        # Search Censys.
        if opt_censys:
            date = utility.get_current_date('%Y%m%d%H%M%S%f')[:-3]
            print_date = utility.transform_date_string(
                utility.transform_date_object(date[:-3], '%Y%m%d%H%M%S'))
            server_info, cert_info = censys.search_censys(
                utility.forward_lookup(fqdn_list[idx]), fqdn_list[idx])
            report.create_censys_report(fqdn_list[idx], port_list[idx],
                                        server_info, cert_info, print_date)

        # Analysis HTTP responses.
        product_list = []
        if opt_log:
            # Check stored logs.
            if os.path.exists(opt_log_path) is False:
                utility.print_message(
                    FAIL, 'Path not found: {}'.format(opt_log_path))
                utility.write_log(30,
                                  'Path not found : {}'.format(opt_log_path))
                utility.write_log(
                    20, '[Out] Analyze log [{}].'.format(
                        os.path.basename(__file__)))
示例#2
0
            utility.write_log(30, msg)
            continue

        # Create report header.
        report.create_report_header(fqdn_list[idx], port_list[idx])

        # Check cloud service.
        cloud_type = 'Unknown'
        if opt_cloud:
            cloud_type = cloud_checker.get_cloud_service(fqdn_list[idx])

        # Search Censys.
        if opt_censys:
            date = utility.get_current_date('%Y%m%d%H%M%S%f')[:-3]
            print_date = utility.transform_date_string(utility.transform_date_object(date[:-3], '%Y%m%d%H%M%S'))
            server_info,  cert_info = censys.search_censys(utility.forward_lookup(fqdn_list[idx]), fqdn_list[idx])
            report.create_censys_report(fqdn_list[idx],
                                        port_list[idx],
                                        server_info,
                                        cert_info,
                                        print_date)

        # Analysis HTTP responses.
        product_list = []
        if opt_log:
            # Check stored logs.
            if os.path.exists(opt_log_path) is False:
                utility.print_message(FAIL, 'Path not found: {}'.format(opt_log_path))
                utility.write_log(30, 'Path not found : {}'.format(opt_log_path))
                utility.write_log(20, '[Out] Analyze log [{}].'.format(os.path.basename(__file__)))
            else: