mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2025-02-03 05:04:11 +03:00
upgrade of web directory parsing for things like C:/xampp/htdocs/sqlmap/mysql/get_int.php (XAMPP uses this)
This commit is contained in:
parent
87c8bdbc29
commit
25f1a9c7d0
|
@ -235,7 +235,7 @@ def getDocRoot():
|
|||
absFilePath = normalizePath(absFilePath)
|
||||
absFilePathWin = None
|
||||
|
||||
if re.match("[A-Za-z]:(\\[\w.\\]*)?", absFilePath):
|
||||
if re.match("[A-Za-z]:([\\/][\w.\\/]*)?", absFilePath):
|
||||
absFilePathWin = absFilePath
|
||||
absFilePath = absFilePath[2:].replace("\\", "/")
|
||||
|
||||
|
|
|
@ -73,17 +73,18 @@ def parseResponse(page, headers):
|
|||
# Detect injectable page absolute system path
|
||||
# NOTE: this regular expression works if the remote web application
|
||||
# is written in PHP and debug/error messages are enabled.
|
||||
absFilePathsRegExp = ( r" in <b>(?P<result>.*?)</b> on line", r"\b(?P<result>[A-Za-z]:(\\[\w.\\]*)?)", r"(\A|[^<])(?P<result>/[/\w.]+)" )
|
||||
absFilePathsRegExp = ( r" in <b>(?P<result>.*?)</b> on line", r"\b(?P<result>[A-Za-z]:([\\/][\w.\\/]*)?)", r"(\A|[^<])(?P<result>/[/\w.]+)" )
|
||||
|
||||
for absFilePathRegExp in absFilePathsRegExp:
|
||||
reobj = re.compile(absFilePathRegExp)
|
||||
|
||||
for match in reobj.finditer(page):
|
||||
absFilePath = match.group("result").strip()
|
||||
|
||||
page = page.replace(absFilePath, "")
|
||||
if absFilePath not in kb.absFilePaths:
|
||||
dirname = directoryPath(absFilePath)
|
||||
kb.absFilePaths.add(dirname)
|
||||
|
||||
|
||||
def decodePage(page, encoding):
|
||||
"""
|
||||
|
|
Loading…
Reference in New Issue
Block a user