mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2024-11-22 17:46:37 +03:00
fixed serious issue with adding file paths into kb.absFilePaths (dirname was wrongly added, and afterwards getDirs used dirname of dirname)
also, fixed some issues with Windows paths
This commit is contained in:
parent
7c88e32f9d
commit
ea045eaa2f
|
@ -246,7 +246,7 @@ def getDocRoot():
|
|||
if absFilePathWin:
|
||||
docRoot = "C:/%s" % docRoot.replace("\\", "/")
|
||||
|
||||
docRoot = docRoot.replace("//", "/")
|
||||
docRoot = normalizePath(docRoot)
|
||||
break
|
||||
|
||||
if docRoot:
|
||||
|
|
|
@ -84,8 +84,7 @@ def parseResponse(page, headers):
|
|||
if re.search("\A[A-Za-z]:", absFilePath):
|
||||
absFilePath = absFilePath.replace("/", "\\")
|
||||
if absFilePath not in kb.absFilePaths:
|
||||
dirname = directoryPath(absFilePath)
|
||||
kb.absFilePaths.add(dirname)
|
||||
kb.absFilePaths.add(absFilePath)
|
||||
|
||||
|
||||
def decodePage(page, encoding):
|
||||
|
|
|
@ -175,9 +175,10 @@ class Web:
|
|||
payload = agent.payload(newValue=query)
|
||||
page = Request.queryPage(payload)
|
||||
|
||||
requestDir = normalizePath(directory.replace(kb.docRoot, "/").replace("\\", "/"))
|
||||
requestDir = directory.replace('\\', '/').replace(kb.docRoot.replace('\\', '/'), "/").replace("//", "/")
|
||||
if re.search("\A[A-Za-z]:", requestDir):
|
||||
requestDir = requestDir[2:]
|
||||
requestDir = normalizePath(requestDir)
|
||||
self.webBaseUrl = "%s://%s:%d%s" % (conf.scheme, conf.hostname, conf.port, requestDir)
|
||||
self.webUploaderUrl = "%s/%s" % (self.webBaseUrl, uploaderName)
|
||||
self.webUploaderUrl = self.webUploaderUrl.replace("./", "/").replace("\\", "/")
|
||||
|
|
Loading…
Reference in New Issue
Block a user