Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 25f1a9c

Browse files
committed
upgrade of web directory parsing for things like C:/xampp/htdocs/sqlmap/mysql/get_int.php (XAMPP uses this)
1 parent 87c8bdb commit 25f1a9c

2 files changed

Lines changed: 4 additions & 3 deletions

File tree

lib/core/common.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ def getDocRoot():
235235
absFilePath = normalizePath(absFilePath)
236236
absFilePathWin = None
237237

238-
if re.match("[A-Za-z]:(\\[\w.\\]*)?", absFilePath):
238+
if re.match("[A-Za-z]:([\\/][\w.\\/]*)?", absFilePath):
239239
absFilePathWin = absFilePath
240240
absFilePath = absFilePath[2:].replace("\\", "/")
241241

lib/request/basic.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,17 +73,18 @@ def parseResponse(page, headers):
7373
# Detect injectable page absolute system path
7474
# NOTE: this regular expression works if the remote web application
7575
# is written in PHP and debug/error messages are enabled.
76-
absFilePathsRegExp = ( r" in <b>(?P<result>.*?)</b> on line", r"\b(?P<result>[A-Za-z]:(\\[\w.\\]*)?)", r"(\A|[^<])(?P<result>/[/\w.]+)" )
76+
absFilePathsRegExp = ( r" in <b>(?P<result>.*?)</b> on line", r"\b(?P<result>[A-Za-z]:([\\/][\w.\\/]*)?)", r"(\A|[^<])(?P<result>/[/\w.]+)" )
7777

7878
for absFilePathRegExp in absFilePathsRegExp:
7979
reobj = re.compile(absFilePathRegExp)
8080

8181
for match in reobj.finditer(page):
8282
absFilePath = match.group("result").strip()
83-
83+
page = page.replace(absFilePath, "")
8484
if absFilePath not in kb.absFilePaths:
8585
dirname = directoryPath(absFilePath)
8686
kb.absFilePaths.add(dirname)
87+
8788

8889
def decodePage(page, encoding):
8990
"""

0 commit comments

Comments
 (0)