found and fixed few bugs regarding my "fix" of Bug #110

This commit is contained in:
Miroslav Stampar 2010-01-03 15:56:29 +00:00
parent d5b1863dec
commit 96a033b51d

View File

@ -68,13 +68,13 @@ def parseResponse(page, headers):
# Detect injectable page absolute system path # Detect injectable page absolute system path
# NOTE: this regular expression works if the remote web application # NOTE: this regular expression works if the remote web application
# is written in PHP and debug/error messages are enabled. # is written in PHP and debug/error messages are enabled.
absFilePathsRegExp = ( r" in <b>(.*?)</b> on line", r"\b[A-Za-z]:(\\[\w.\\]*)?", r"/[/\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: for absFilePathRegExp in absFilePathsRegExp:
reobj = re.compile(absFilePathRegExp) reobj = re.compile(absFilePathRegExp)
for match in reobj.finditer(page): for match in reobj.finditer(page):
absFilePath = match.group() absFilePath = match.group("result")
if absFilePath not in kb.absFilePaths: if absFilePath not in kb.absFilePaths:
kb.absFilePaths.add(os.path.dirname(absFilePath)) kb.absFilePaths.add(os.path.dirname(absFilePath))