mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2025-02-02 20:54:13 +03:00
Bug fix for uploading files in case of web subdirectories
This commit is contained in:
parent
b3b49b3492
commit
102d4b4119
|
@ -813,11 +813,6 @@ def getAutoDirectories():
|
||||||
warnMsg = "unable to automatically parse any web server path"
|
warnMsg = "unable to automatically parse any web server path"
|
||||||
logger.warn(warnMsg)
|
logger.warn(warnMsg)
|
||||||
|
|
||||||
_ = extractRegexResult(r"//[^/]+?(?P<result>/.*)/", conf.url) # web directory
|
|
||||||
|
|
||||||
if _:
|
|
||||||
retVal.add(_)
|
|
||||||
|
|
||||||
return list(retVal)
|
return list(retVal)
|
||||||
|
|
||||||
def filePathToSafeString(filePath):
|
def filePathToSafeString(filePath):
|
||||||
|
|
|
@ -200,6 +200,15 @@ class Web:
|
||||||
directories.extend(getAutoDirectories())
|
directories.extend(getAutoDirectories())
|
||||||
directories = list(oset(directories))
|
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)
|
backdoorName = "tmpb%s.%s" % (randomStr(lowercase=True), self.webApi)
|
||||||
backdoorContent = decloak(os.path.join(paths.SQLMAP_SHELL_PATH, "backdoor.%s_" % self.webApi))
|
backdoorContent = decloak(os.path.join(paths.SQLMAP_SHELL_PATH, "backdoor.%s_" % self.webApi))
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user