Minor code adjustments

This commit is contained in:
Bernardo Damele 2008-11-17 00:13:49 +00:00
parent 654aecedfe
commit 7d7170fc97
3 changed files with 8 additions and 13 deletions

View File

@ -26,23 +26,20 @@ Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
import re import re
from xml.sax import parse
from xml.sax.handler import ContentHandler
from lib.core.common import checkFile from lib.core.common import checkFile
from lib.core.common import sanitizeStr
from lib.core.data import kb from lib.core.data import kb
from lib.core.data import paths from lib.core.data import paths
from lib.parse.banner import BannerHandler from lib.parse.banner import BannerHandler
def headersParser(headers): def headersParser(headers):
""" """
This function calls a class that parses the input HTTP headers to This function calls a class that parses the input HTTP headers to
fingerprint the back-end database management system operating system fingerprint the back-end database management system operating system
and web application technology and the web application technology
""" """
topHeaders = { topHeaders = (
"cookie", "cookie",
"microsoftsharepointteamservices", "microsoftsharepointteamservices",
"server", "server",
@ -50,8 +47,9 @@ def headersParser(headers):
"www-authenticate", "www-authenticate",
"x-aspnet-version", "x-aspnet-version",
"x-powered-by", "x-powered-by",
} )
for header in headers: for header in headers:
if header in topHeaders: if header in topHeaders:
# TODO: fill me
pass pass

View File

@ -63,15 +63,13 @@ class htmlHandler(ContentHandler):
self.__match = None self.__match = None
def htmlParser(page, xmlfile=None): def htmlParser(page):
""" """
This function calls a class that parses the input HTML page to This function calls a class that parses the input HTML page to
fingerprint the back-end database management system fingerprint the back-end database management system
""" """
if not xmlfile:
xmlfile = paths.ERRORS_XML xmlfile = paths.ERRORS_XML
checkFile(xmlfile) checkFile(xmlfile)
page = sanitizeStr(page) page = sanitizeStr(page)
handler = htmlHandler(page) handler = htmlHandler(page)

View File

@ -31,7 +31,6 @@ from lib.core.common import randomStr
from lib.core.data import conf from lib.core.data import conf
from lib.core.data import kb from lib.core.data import kb
from lib.core.data import logger from lib.core.data import logger
from lib.core.data import paths
from lib.core.data import temp from lib.core.data import temp
from lib.core.exception import sqlmapUnsupportedDBMSException from lib.core.exception import sqlmapUnsupportedDBMSException
from lib.core.session import setUnion from lib.core.session import setUnion
@ -74,7 +73,7 @@ def __unionPosition(count, expression):
# HTML code of the result page because, for instance, it is there # HTML code of the result page because, for instance, it is there
# when the query is wrong and the back-end DBMS is Microsoft SQL # when the query is wrong and the back-end DBMS is Microsoft SQL
# server # server
htmlParsed = htmlParser(resultPage, paths.ERRORS_XML) htmlParsed = htmlParser(resultPage)
if randQuery in resultPage and not htmlParsed: if randQuery in resultPage and not htmlParsed:
setUnion(position=exprPosition) setUnion(position=exprPosition)