mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2025-12-10 09:49:06 +00:00
Finally fixed and adapted all code around to the new isWindowsDriveLetterPath() function
This commit is contained in:
@@ -249,13 +249,14 @@ def getDocRoot(webApi=None):
|
||||
for absFilePath in kb.absFilePaths:
|
||||
if directoryPath(absFilePath) == '/':
|
||||
continue
|
||||
|
||||
absFilePath = normalizePath(absFilePath)
|
||||
absFilePathWin = None
|
||||
|
||||
if isWindowsPath(absFilePath):
|
||||
absFilePathWin = posixToNtSlashes(absFilePath)
|
||||
absFilePath = ntToPosixSlashes(absFilePath[2:])
|
||||
elif isWindowsDriveLetterPath(absFilePath): #e.g. C:/xampp/htdocs
|
||||
elif isWindowsDriveLetterPath(absFilePath): # E.g. C:/xampp/htdocs
|
||||
absFilePath = absFilePath[2:]
|
||||
|
||||
if pagePath in absFilePath:
|
||||
@@ -309,10 +310,13 @@ def getDirs(webApi=None):
|
||||
for absFilePath in kb.absFilePaths:
|
||||
if absFilePath:
|
||||
directory = directoryPath(absFilePath)
|
||||
|
||||
if isWindowsPath(directory):
|
||||
directory = ntToPosixSlashes(directory)
|
||||
|
||||
if directory == '/':
|
||||
continue
|
||||
|
||||
directories.add(directory)
|
||||
else:
|
||||
warnMsg = "unable to retrieve any web server path"
|
||||
@@ -981,7 +985,7 @@ def urlEncodeCookieValues(cookieStr):
|
||||
def directoryPath(path):
|
||||
retVal = None
|
||||
|
||||
if isWindowsPath(path):
|
||||
if isWindowsDriveLetterPath(path):
|
||||
retVal = ntpath.dirname(path)
|
||||
else:
|
||||
retVal = posixpath.dirname(path)
|
||||
@@ -989,13 +993,9 @@ def directoryPath(path):
|
||||
return retVal
|
||||
|
||||
def normalizePath(path):
|
||||
"""
|
||||
This function must be called only after posixToNtSlashes()
|
||||
and ntToPosixSlashes()
|
||||
"""
|
||||
retVal = None
|
||||
|
||||
if isWindowsPath(path):
|
||||
if isWindowsDriveLetterPath(path):
|
||||
retVal = ntpath.normpath(path)
|
||||
else:
|
||||
retVal = posixpath.normpath(path)
|
||||
|
||||
@@ -852,19 +852,19 @@ def __cleanupOptions():
|
||||
conf.delay = float(conf.delay)
|
||||
|
||||
if conf.rFile:
|
||||
conf.rFile = normalizePath(ntToPosixSlashes(conf.rFile))
|
||||
conf.rFile = ntToPosixSlashes(normalizePath(conf.rFile))
|
||||
|
||||
if conf.wFile:
|
||||
conf.wFile = normalizePath(ntToPosixSlashes(conf.wFile))
|
||||
conf.wFile = ntToPosixSlashes(normalizePath(conf.wFile))
|
||||
|
||||
if conf.dFile:
|
||||
conf.dFile = normalizePath(ntToPosixSlashes(conf.dFile))
|
||||
conf.dFile = ntToPosixSlashes(normalizePath(conf.dFile))
|
||||
|
||||
if conf.msfPath:
|
||||
conf.msfPath = normalizePath(ntToPosixSlashes(conf.msfPath))
|
||||
conf.msfPath = ntToPosixSlashes(normalizePath(conf.msfPath))
|
||||
|
||||
if conf.tmpPath:
|
||||
conf.tmpPath = normalizePath(ntToPosixSlashes(conf.tmpPath))
|
||||
conf.tmpPath = ntToPosixSlashes(normalizePath(conf.tmpPath))
|
||||
|
||||
if conf.googleDork or conf.list:
|
||||
conf.multipleTargets = True
|
||||
|
||||
@@ -113,7 +113,7 @@ SQL_STATEMENTS = {
|
||||
"grant ", ),
|
||||
|
||||
"SQL data execution": (
|
||||
"exec ",
|
||||
" exec ",
|
||||
"execute ", ),
|
||||
|
||||
"SQL transaction": (
|
||||
|
||||
Reference in New Issue
Block a user