This function calls a class that parses the input HTTP headers to fingerprint the back-end database management system operating system and the web application technology
(headers)
| 13 | from lib.parse.handler import FingerprintHandler |
| 14 | |
| 15 | def headersParser(headers): |
| 16 | """ |
| 17 | This function calls a class that parses the input HTTP headers to |
| 18 | fingerprint the back-end database management system operating system |
| 19 | and the web application technology |
| 20 | """ |
| 21 | |
| 22 | if not kb.headerPaths: |
| 23 | kb.headerPaths = { |
| 24 | "microsoftsharepointteamservices": os.path.join(paths.SQLMAP_XML_BANNER_PATH, "sharepoint.xml"), |
| 25 | "server": os.path.join(paths.SQLMAP_XML_BANNER_PATH, "server.xml"), |
| 26 | "servlet-engine": os.path.join(paths.SQLMAP_XML_BANNER_PATH, "servlet-engine.xml"), |
| 27 | "set-cookie": os.path.join(paths.SQLMAP_XML_BANNER_PATH, "set-cookie.xml"), |
| 28 | "x-aspnet-version": os.path.join(paths.SQLMAP_XML_BANNER_PATH, "x-aspnet-version.xml"), |
| 29 | "x-powered-by": os.path.join(paths.SQLMAP_XML_BANNER_PATH, "x-powered-by.xml"), |
| 30 | } |
| 31 | |
| 32 | for header in (_.lower() for _ in headers if _.lower() in kb.headerPaths): |
| 33 | value = headers[header] |
| 34 | xmlfile = kb.headerPaths[header] |
| 35 | handler = FingerprintHandler(value, kb.headersFp) |
| 36 | parseXmlFile(xmlfile, handler) |
| 37 | parseXmlFile(paths.GENERIC_XML, handler) |
no test coverage detected
searching dependent graphs…