def __init__(self, output_dir, ip_file_to_scan, nmap_optimize, scan_type): self._ip_file_to_scan = ip_file_to_scan output_file = "{0}{1}-{2}".format(output_dir, scan_type, datetime.datetime.now().strftime("%Y%m%d%H%M")) CoreScanner.__init__(self, self._ip_file_to_scan.name, output_file, nmap_optimize, scan_type)
def __init__(self, destination, output_dir, nmap_optimize, scan_type): self.__host_up = "Host:\s([0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3})\s+\(\)\s+Status:\sUp" self.__ip_file_to_scan = tempfile.NamedTemporaryFile(mode='w+t') self.__ip_file_to_scan.write("\n".join([ip_domain.strip() for ip_domain in destination.split(",")])) self.__output_file = "{0}{1}-{2}".format(output_dir, scan_type, datetime.datetime.now().strftime("%Y%m%d%H%M")) CoreScanner.__init__(self, self.__ip_file_to_scan.name, self.__output_file, nmap_optimize, scan_type)
def __init__(self, output_dir, ip_file_to_scan, nmap_optimize, scan_type): self._ip_file_to_scan = ip_file_to_scan output_file = "{0}{1}-{2}".format( output_dir, scan_type, datetime.datetime.now().strftime("%Y%m%d%H%M")) CoreScanner.__init__(self, self._ip_file_to_scan.name, output_file, nmap_optimize, scan_type)
class ScriptScan(CoreScanner): def __init__(self, config_file, output_dir, ip_file_to_scan, nmap_optimize, scan_type): self._ip_file_to_scan = ip_file_to_scan try: self._scan_options = ConfigParser.get_scripts_options(config_file) except Exception, err: raise FlashLightExceptions(str(err)) output_file = "{0}{1}-{2}".format(output_dir, scan_type, datetime.datetime.now().strftime("%Y%m%d%H%M")) CoreScanner.__init__(self, self._ip_file_to_scan.name, output_file, nmap_optimize, scan_type)