def parseConfig(self): config = DefaultConfigParser() configPath = FileUtils.buildPath(self.script_path, "default.conf") config.read(configPath) # General self.threadsCount = config.safe_getint("general", "threads", 10, list(range(1, 50))) self.excludeStatusCodes = config.safe_get("general", "exclude-status", None) self.redirect = config.safe_getboolean("general", "follow-redirects", False) self.recursive = config.safe_getboolean("general", "recursive", False) self.testFailPath = config.safe_get("general", "test-fail-path", "youCannotBeHere7331").strip() # Reports self.autoSave = config.safe_getboolean("reports", "autosave-report", False) self.autoSaveFormat = config.safe_get("reports", "autosave-report-format", "plain", ["plain", "json", "simple"]) # Dictionary self.wordlist = config.safe_get( "dictionary", "wordlist", FileUtils.buildPath(self.script_path, "db", "dicc.txt")) self.lowercase = config.safe_getboolean("dictionary", "lowercase", False) # Connection self.useragent = config.safe_get("connection", "user-agent", None) self.timeout = config.safe_getint("connection", "timeout", 30) self.maxRetries = config.safe_getint("connection", "max-retries", 5) self.proxy = config.safe_get("connection", "http-proxy", None)
def parseConfig(self): config = DefaultConfigParser() configPath = FileUtils.buildPath(self.script_path, "default.conf") config.read(configPath) # General self.threadsCount = config.safe_getint("general", "threads", 10, list(range(1, 50))) self.excludeStatusCodes = config.safe_get("general", "exclude-status", None) self.redirect = config.safe_getboolean("general", "follow-redirects", False) self.recursive = config.safe_getboolean("general", "recursive", False) self.testFailPath = config.safe_get("general", "scanner-fail-path", "").strip() self.saveHome = config.safe_getboolean("general", "save-logs-home", False) # Reports self.autoSave = config.safe_getboolean("reports", "autosave-report", False) self.autoSaveFormat = config.safe_get("reports", "autosave-report-format", "plain", ["plain", "json", "simple"]) # Dictionary self.wordlist = config.safe_get("dictionary", "wordlist", FileUtils.buildPath(self.script_path, "db", "dicc.txt")) self.lowercase = config.safe_getboolean("dictionary", "lowercase", False) self.forceExtensions = config.safe_get("dictionary", "force-extensions", False) # Connection self.useRandomAgents = config.safe_get("connection", "random-user-agents", False) self.useragent = config.safe_get("connection", "user-agent", None) self.timeout = config.safe_getint("connection", "timeout", 30) self.maxRetries = config.safe_getint("connection", "max-retries", 5) self.proxy = config.safe_get("connection", "http-proxy", None)
def parseConfig(self): config = DefaultConfigParser() configPath = FileUtils.buildPath(self.script_path, "default.conf") config.read(configPath) # General self.threadsCount = config.safe_getint( "general", "threads", 20, list(range(1, 200)) ) self.includeStatusCodes = config.safe_get("general", "include-status", None) self.excludeStatusCodes = config.safe_get("general", "exclude-status", None) self.excludeTexts = config.safe_get("general", "exclude-texts", None) self.redirect = config.safe_getboolean("general", "follow-redirects", False) self.recursive = config.safe_getboolean("general", "recursive", False) self.recursive_level_max = config.safe_getint( "general", "recursive-level-max", 1 ) self.suppressEmpty = config.safe_getboolean("general", "suppress-empty", False) self.testFailPath = config.safe_get("general", "scanner-fail-path", "").strip() self.saveHome = config.safe_getboolean("general", "save-logs-home", False) self.defaultExtensions = config.safe_get("general", "default-extensions", "php,asp,aspx,jsp,jspx,html,htm,js") # Reports self.autoSave = config.safe_getboolean("reports", "autosave-report", False) self.autoSaveFormat = config.safe_get( "reports", "autosave-report-format", "plain", ["plain", "json", "simple"] ) # Dictionary self.wordlist = config.safe_get( "dictionary", "wordlist", FileUtils.buildPath(self.script_path, "db", "dicc.txt"), ) self.lowercase = config.safe_getboolean("dictionary", "lowercase", False) self.uppercase = config.safe_getboolean("dictionary", "uppercase", False) self.forceExtensions = config.safe_getboolean("dictionary", "force-extensions", False) self.noDotExtensions = config.safe_getboolean("dictionary", "no-dot-extensions", False) # Connection self.useRandomAgents = config.safe_get( "connection", "random-user-agents", False ) self.useragent = config.safe_get("connection", "user-agent", None) self.delay = config.safe_get("connection", "delay", 0) self.timeout = config.safe_getint("connection", "timeout", 10) self.maxRetries = config.safe_getint("connection", "max-retries", 3) self.proxy = config.safe_get("connection", "http-proxy", None) self.proxylist = config.safe_get("connection", "http-proxy-list", None) self.httpmethod = config.safe_get( "connection", "httpmethod", "get", ["get", "head", "post", "put", "patch", "delete", "trace", "options", "debug"] ) self.requestByHostname = config.safe_getboolean( "connection", "request-by-hostname", False )
def parse_config(self): config = DefaultConfigParser() config_path = FileUtils.build_path(self.script_path, "default.conf") config.read(config_path) # General self.threads_count = config.safe_getint("general", "threads", 10, list(range(1, 50))) self.redirect = config.safe_getboolean("general", "follow-redirects", False) # Credentials self.wordlist = config.safe_get( "credentials", "userpass-wordlist", FileUtils.build_path(self.script_path, "db", "default.txt")) # Connection self.use_random_agents = config.safe_get("connection", "random-user-agents", False) self.useragent = config.safe_get("connection", "user-agent", None) self.delay = config.safe_get("connection", "delay", 0) self.timeout = config.safe_getint("connection", "timeout", 30) self.max_retries = config.safe_getint("connection", "max-retries", 5) self.proxy = config.safe_get("connection", "http-proxy", None) self.dns_cache = config.safe_get("connection", "dns-cache", False)
def parseConfig(self): config = DefaultConfigParser() configPath = FileUtils.buildPath(self.script_path, "default.conf") config.read(configPath) # General self.threadsCount = config.safe_getint("general", "threads", 10, list(range(1, 50))) self.excludeStatusCodes = config.safe_get("general", "exclude-status", None) self.redirect = config.safe_getboolean("general", "follow-redirects", False) self.recursive = config.safe_getboolean("general", "recursive", False) self.suppressEmpty = config.safe_getboolean("general", "suppress-empty", False) self.testFailPath = config.safe_get("general", "scanner-fail-path", "").strip() self.saveHome = config.safe_getboolean("general", "save-logs-home", False) # Reports self.autoSave = config.safe_getboolean("reports", "autosave-report", False) self.autoSaveFormat = config.safe_get("reports", "autosave-report-format", "plain", ["plain", "json", "simple"]) # Dictionary self.wordlist = config.safe_get("dictionary", "wordlist", FileUtils.buildPath(self.script_path, "db", "dicc.bak")) self.lowercase = config.safe_getboolean("dictionary", "lowercase", False) self.forceExtensions = config.safe_get("dictionary", "force-extensions", False) # Connection self.useRandomAgents = config.safe_get("connection", "random-user-agents", False) self.useragent = config.safe_get("connection", "user-agent", None) self.delay = config.safe_get("connection", "delay", 0) self.timeout = config.safe_getint("connection", "timeout", 30) self.maxRetries = config.safe_getint("connection", "max-retries", 5) self.proxy = config.safe_get("connection", "http-proxy", None) self.requestByHostname = config.safe_get("connection", "request-by-hostname", False)
def parseConfig(self): config = DefaultConfigParser() configPath = FileUtils.buildPath(os.path.expanduser('~'), ".dirsearch", "dirsearch.conf") if not FileUtils.exists(configPath): FileUtils.createDirectory(os.path.dirname(configPath)) shutil.copyfile(FileUtils.buildPath(self.script_path, 'default.conf'), configPath) config.read(configPath) # General self.threadsCount = config.safe_getint("general", "threads", 10, list(range(1, 50))) self.excludeStatusCodes = config.safe_get("general", "exclude-status", None) self.redirect = config.safe_getboolean("general", "follow-redirects", False) self.recursive = config.safe_getboolean("general", "recursive", False) self.recursive_level_max = config.safe_getint("general", "recursive-level-max", 1) self.suppressEmpty = config.safe_getboolean("general", "suppress-empty", False) self.testFailPath = config.safe_get("general", "scanner-fail-path", "").strip() self.saveHome = config.safe_getboolean("general", "save-logs-home", False) # Reports self.autoSave = config.safe_getboolean("reports", "autosave-report", False) self.autoSaveFormat = config.safe_get("reports", "autosave-report-format", "plain", ["plain", "json", "simple"]) # Dictionary self.wordlist = config.safe_get("dictionary", "wordlist", FileUtils.buildPath(self.script_path, "db", "dicc.txt")) self.lowercase = config.safe_getboolean("dictionary", "lowercase", False) self.forceExtensions = config.safe_get("dictionary", "force-extensions", False) # Connection self.useRandomAgents = config.safe_get("connection", "random-user-agents", False) self.useragent = config.safe_get("connection", "user-agent", None) self.delay = config.safe_get("connection", "delay", 0) self.timeout = config.safe_getint("connection", "timeout", 30) self.maxRetries = config.safe_getint("connection", "max-retries", 5) self.proxy = config.safe_get("connection", "http-proxy", None) self.httpmethod = config.safe_get("connection", "httpmethod", "get", ["get", "head", "post"]) self.requestByHostname = config.safe_get("connection", "request-by-hostname", False)