minor update

This commit is contained in:
Miroslav Stampar 2011-11-22 12:18:24 +00:00
parent ac041399f0
commit 2e10de8921
4 changed files with 8 additions and 8 deletions

View File

@ -1407,7 +1407,6 @@ def __setKnowledgeBaseAttributes(flushAll=True):
kb.explicitSettings = set()
kb.errorIsNone = True
kb.forcedDbms = None
kb.headersCount = 0
kb.headersFp = {}
kb.heuristicTest = None
kb.hintValue = None
@ -1445,6 +1444,7 @@ def __setKnowledgeBaseAttributes(flushAll=True):
kb.pageEncoding = DEFAULT_PAGE_ENCODING
kb.pageStable = None
kb.partRun = None
kb.processResponseCounter = 0
kb.proxyAuthHeader = None
kb.queryCounter = 0
kb.redirectSetCookie = None

View File

@ -392,6 +392,9 @@ BIGARRAY_CHUNK_LENGTH = 4096
# Only console display last n table rows
TRIM_STDOUT_DUMP_SIZE = 256
# Parse response headers only first couple of times
PARSE_HEADERS_LIMIT = 3
# Step used in ORDER BY technique used for finding the right number of columns in UNION query injections
ORDER_BY_STEP = 10

View File

@ -22,12 +22,6 @@ def headersParser(headers):
and the web application technology
"""
# It is enough to parse the headers on first four HTTP responses
if kb.headersCount > 3:
return
kb.headersCount += 1
topHeaders = {
"cookie": os.path.join(paths.SQLMAP_XML_BANNER_PATH, "cookie.xml"),
"microsoftsharepointteamservices": os.path.join(paths.SQLMAP_XML_BANNER_PATH, "sharepoint.xml"),

View File

@ -29,6 +29,7 @@ from lib.core.data import logger
from lib.core.exception import sqlmapDataException
from lib.core.settings import ML
from lib.core.settings import META_CHARSET_REGEX
from lib.core.settings import PARSE_HEADERS_LIMIT
from lib.core.settings import UNICODE_ENCODING
from lib.parse.headers import headersParser
from lib.parse.html import htmlParser
@ -191,8 +192,10 @@ def decodePage(page, contentEncoding, contentType):
return page
def processResponse(page, responseHeaders):
kb.processResponseCounter += 1
if not kb.dumpMode:
parseResponse(page, responseHeaders)
parseResponse(page, responseHeaders if kb.processResponseCounter < PARSE_HEADERS_LIMIT else None)
if conf.parseErrors:
msg = extractErrorMessage(page)