diff --git a/lib/core/common.py b/lib/core/common.py index 743270bd4..84d0db508 100644 --- a/lib/core/common.py +++ b/lib/core/common.py @@ -813,11 +813,6 @@ def getAutoDirectories(): warnMsg = "unable to automatically parse any web server path" logger.warn(warnMsg) - _ = extractRegexResult(r"//[^/]+?(?P/.*)/", conf.url) # web directory - - if _: - retVal.add(_) - return list(retVal) def filePathToSafeString(filePath): diff --git a/lib/takeover/web.py b/lib/takeover/web.py index 893999a26..61bc223bf 100644 --- a/lib/takeover/web.py +++ b/lib/takeover/web.py @@ -200,6 +200,15 @@ class Web: directories.extend(getAutoDirectories()) directories = list(oset(directories)) + path = urlparse.urlparse(conf.url).path or '/' + if path != '/': + _ = [] + for directory in directories: + _.append(directory) + if not directory.endswith(path): + _.append("%s/%s" % (directory.rstrip('/'), path.strip('/'))) + directories = _ + backdoorName = "tmpb%s.%s" % (randomStr(lowercase=True), self.webApi) backdoorContent = decloak(os.path.join(paths.SQLMAP_SHELL_PATH, "backdoor.%s_" % self.webApi))