File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 3636from lib .parse .headers import headersParser
3737from lib .parse .html import htmlParser
3838
39+ __absFilePathsRegExp = ( r" in <b>(?P<result>.*?)</b> on line" , r"(?:>|\s)(?P<result>[A-Za-z]:[\\/][\w.\\/]*)" , r"(?:>|\s)(?P<result>/\w[/\w.]+)" )
40+ __absFilePathsRegObj = [re .compile (absFilePathRegExp ) for absFilePathRegExp in __absFilePathsRegExp ]
41+
3942def forgeHeaders (cookie , ua ):
4043 """
4144 Prepare HTTP Cookie and HTTP User-Agent headers to use when performing
@@ -74,10 +77,9 @@ def parseResponse(page, headers):
7477 # Detect injectable page absolute system path
7578 # NOTE: this regular expression works if the remote web application
7679 # is written in PHP and debug/error messages are enabled.
77- absFilePathsRegExp = ( r" in <b>(?P<result>.*?)</b> on line" , r"(?:>|\s)(?P<result>[A-Za-z]:[\\/][\w.\\/]*)" , r"(?:>|\s)(?P<result>/\w[/\w.]+)" )
7880
79- for absFilePathRegExp in absFilePathsRegExp :
80- for match in re .finditer (absFilePathRegExp , page ):
81+ for reobj in __absFilePathsRegObj :
82+ for match in reobj .finditer (page ):
8183 absFilePath = match .group ("result" ).strip ()
8284 page = page .replace (absFilePath , "" )
8385
You can’t perform that action at this time.
0 commit comments