def start(ip_address, service): pool = Pool(processes=2) service.enumeration_list = [] try: result = pool.apply_async(execute_nmap_ssh_enum, [ip_address, service.port]) output = result.get(timeout=15 * 60) enum = EnumerationDTO(nmap_tool_name) enum.results_output = output service.enumeration_list.append(enum) except TimeoutError: utils.print_red('[!]timeout for calling function: ' + nmap_tool_name) try: result = pool.apply_async(check_vulns, [service]) output = result.get(timeout=10 * 60) enum = EnumerationDTO('Check SSH Vulnerabilities') enum.results_output = output service.enumeration_list.append(enum) except TimeoutError: utils.print_red('[!]timeout for calling function: check_vulns()') try: result = pool.apply_async(brute_force, [ip_address]) output = result.get(timeout=15 * 60) enum = EnumerationDTO(hydra_brute) enum.results_output = output service.enumeration_list.append(enum) except TimeoutError: utils.print_red('[!]timeout for calling function: ' + hydra_brute)
def start(ip_address, service): pool = Pool(processes=8) service.enumeration_list = [] try: result_nmap = pool.apply_async(execute_nmap_http_enum, [ip_address, service.port]) output = result_nmap.get(timeout=45 * 60) enum = EnumerationDTO(nmap_tool_name) enum.results_output = output service.enumeration_list.append(enum) except TimeoutError: utils.print_red('[!]timeout for calling function: ' + nmap_tool_name) try: result_directories = pool.apply_async(execute_directories_http_enum, [ip_address, service.port]) output = result_directories.get(timeout=5 * 60) enum = EnumerationDTO(crawler_tool_name) enum.results_output = output service.enumeration_list.append(enum) except TimeoutError: utils.print_red('[!]timeout for calling function: ' + crawler_tool_name) try: result_nikto = pool.apply_async(execute_nikto_http_enum, [ip_address, service.port]) output = result_nikto.get(timeout=5 * 60) enum = EnumerationDTO(nikto_tool_name) enum.results_output = output service.enumeration_list.append(enum) except TimeoutError: utils.print_red('[!]timeout for calling function: ' + nikto_tool_name) try: result_metasploit = pool.apply_async(execute_metasploit_http_enum, [ip_address, service.port]) output = result_metasploit.get(timeout=10 * 60) enum = EnumerationDTO(metasploit_tool_name) enum.results_output = output service.enumeration_list.append(enum) except TimeoutError: utils.print_red('[!]timeout for calling function: ' + metasploit_tool_name) try: result_whatweb = pool.apply_async(execute_whatweb_http_enum, [ip_address, service.port]) output = result_whatweb.get(timeout=10 * 60) enum = EnumerationDTO(whatweb_tool_name) enum.results_output = output service.enumeration_list.append(enum) except TimeoutError: utils.print_red('[!]timeout for calling function: ' + whatweb_tool_name) try: result_screenshot = pool.apply_async(take_screenshot, [ip_address, service.port]) file_path = result_screenshot.get(timeout=10 * 60) enum = EnumerationDTO(screenshot_tool_name) enum.results_output = "<img src=../%s class='img-fluid' alt='Responsive image>" % file_path service.enumeration_list.append(enum) except TimeoutError: utils.print_red('[!]timeout for calling function: ' + screenshot_tool_name) try: result = pool.apply_async(check_vulns, [service]) output = result.get(timeout=10 * 60) enum = EnumerationDTO('Check HTTP Vulnerabilities') enum.results_output = output service.enumeration_list.append(enum) except TimeoutError: utils.print_red('[!]timeout for calling function: check_vulns()')
def start(ip_address, service): pool = Pool(processes=5) service.enumeration_list = [] try: result = pool.apply_async(execute_nmap_smb_enum, [ip_address, service.port]) output = result.get(timeout=30 * 60) enum = EnumerationDTO(nmap_tool_name) enum.results_output = output service.enumeration_list.append(enum) except TimeoutError: utils.print_red('[!]timeout for calling function: ' + nmap_tool_name) try: result = pool.apply_async(execute_enum4linux_smb_enum, [ip_address]) output = result.get(timeout=5 * 60) enum = EnumerationDTO(enum4linux_tool_name) enum.results_output = output service.enumeration_list.append(enum) except TimeoutError: utils.print_red('[!]timeout for calling function: ' + enum4linux_tool_name) try: result = pool.apply_async(execute_nmblookup_smb_enum, [ip_address]) output = result.get(timeout=5 * 60) enum = EnumerationDTO(nmblookup_tool_name) enum.results_output = output service.enumeration_list.append(enum) except TimeoutError: utils.print_red('[!]timeout for calling function: ' + nmblookup_tool_name) try: result = pool.apply_async(execute_samrdump_smb_enum, [ip_address, service.port]) output = result.get(timeout=5 * 60) enum = EnumerationDTO(samrdump_tool_name) enum.results_output = output service.enumeration_list.append(enum) except TimeoutError: utils.print_red('[!]timeout for calling function: ' + samrdump_tool_name) try: result = pool.apply_async(extract_password_policy, [ip_address]) output = result.get(timeout=5 * 60) enum = EnumerationDTO(extractpasswordplc_tool_name) enum.results_output = output service.enumeration_list.append(enum) except TimeoutError: utils.print_red('[!]timeout for calling function: ' + extractpasswordplc_tool_name) try: result = pool.apply_async(execute_nbtscan_smb_enum, [ip_address]) output = result.get(timeout=3 * 60) enum = EnumerationDTO(nbtscan_tool_name) enum.results_output = output service.enumeration_list.append(enum) except TimeoutError: utils.print_red('[!]timeout for calling function: ' + nbtscan_tool_name) '''try: result = pool.apply_async(show_nfs_share, [ip_address]) output = result.get(timeout=3 * 60) enum = EnumerationDTO(showmount_tool_name) enum.results_output = output service.enumeration_list.append(enum) except TimeoutError: utils.print_red('[!]timeout for calling function: ' + showmount_tool_name)''' result = check_vulns(service) enum = EnumerationDTO('Check SMB Vulnerabilities') enum.results_output = result service.enumeration_list.append(enum)