else: test_url = protocol_list[idx] + '://' + fqdn_list[ 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(
continue except Exception as e: utility.print_exception(e, 'Parsed error : {}'.format(invent_url)) utility.write_log(30, 'Parsed error : {}'.format(invent_url)) continue # Check target URL. if utility.check_arg_value(parsed.scheme, parsed.hostname, port_num, parsed.path) is False: continue # Gather relevant FQDN. fqdn_list = inventory.fqdn_explore(spider, google_hack, invent_url, keyword) # Create report. 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')) report = CreateReport(utility) report.create_inventory_report(fqdn_list, keyword, parsed.hostname, print_date) # Create merged report. report.create_all_inventory_report() else: utility.print_message(FAIL, '"inventory_list.txt" is not found : {}'.format(inventory_list_path)) exit(0) # Create instances. cloud_checker = CloudChecker(utility) version_checker = VersionChecker(utility) version_checker_ml = VersionCheckerML(utility) comment_checker = CommentChecker(utility) error_checker = ErrorChecker(utility)