2929from lib .core .data import conf
3030from lib .core .data import kb
3131from lib .core .data import paths
32+ from lib .parse .headers import headersParser
3233from lib .parse .html import htmlParser
3334
3435
@@ -51,7 +52,7 @@ def forgeHeaders(cookie, ua):
5152 return headers
5253
5354
54- def parsePage (page ):
55+ def parseResponse (page , headers ):
5556 """
5657 @param page: the page to parse to feed the knowledge base htmlFp
5758 (back-end DBMS fingerprint based upon DBMS error messages return
@@ -63,19 +64,17 @@ def parsePage(page):
6364 like for DBMS error messages (ERRORS_XML), see above.
6465 """
6566
66- if not page :
67- return
67+ if headers :
68+ headersParser ( headers )
6869
69- htmlParsed = htmlParser (page , paths .ERRORS_XML )
70+ if page :
71+ htmlParser (page )
7072
71- if htmlParsed and htmlParsed not in kb .htmlFp :
72- kb .htmlFp .append (htmlParsed )
73+ # Detect injectable page absolute system path
74+ # NOTE: this regular expression works if the remote web application
75+ # is written in PHP and debug/error messages are enabled.
76+ absFilePaths = re .findall (" in <b>(.*?)</b> on line" , page , re .I )
7377
74- # Detect injectable page absolute system path
75- # NOTE: this regular expression works if the remote web application
76- # is written in PHP and debug/error messages are enabled.
77- absFilePaths = re .findall (" in <b>(.*?)</b> on line" , page , re .I )
78-
79- for absFilePath in absFilePaths :
80- if absFilePath not in kb .absFilePaths :
81- kb .absFilePaths .add (absFilePath )
78+ for absFilePath in absFilePaths :
79+ if absFilePath not in kb .absFilePaths :
80+ kb .absFilePaths .add (absFilePath )
0 commit comments