Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 2e10de8

Browse files
committed
minor update
1 parent ac04139 commit 2e10de8

4 files changed

Lines changed: 8 additions & 8 deletions

File tree

lib/core/option.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1407,7 +1407,6 @@ def __setKnowledgeBaseAttributes(flushAll=True):
14071407
kb.explicitSettings = set()
14081408
kb.errorIsNone = True
14091409
kb.forcedDbms = None
1410-
kb.headersCount = 0
14111410
kb.headersFp = {}
14121411
kb.heuristicTest = None
14131412
kb.hintValue = None
@@ -1445,6 +1444,7 @@ def __setKnowledgeBaseAttributes(flushAll=True):
14451444
kb.pageEncoding = DEFAULT_PAGE_ENCODING
14461445
kb.pageStable = None
14471446
kb.partRun = None
1447+
kb.processResponseCounter = 0
14481448
kb.proxyAuthHeader = None
14491449
kb.queryCounter = 0
14501450
kb.redirectSetCookie = None

lib/core/settings.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -392,6 +392,9 @@
392392
# Only console display last n table rows
393393
TRIM_STDOUT_DUMP_SIZE = 256
394394

395+
# Parse response headers only first couple of times
396+
PARSE_HEADERS_LIMIT = 3
397+
395398
# Step used in ORDER BY technique used for finding the right number of columns in UNION query injections
396399
ORDER_BY_STEP = 10
397400

lib/parse/headers.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,6 @@ def headersParser(headers):
2222
and the web application technology
2323
"""
2424

25-
# It is enough to parse the headers on first four HTTP responses
26-
if kb.headersCount > 3:
27-
return
28-
29-
kb.headersCount += 1
30-
3125
topHeaders = {
3226
"cookie": os.path.join(paths.SQLMAP_XML_BANNER_PATH, "cookie.xml"),
3327
"microsoftsharepointteamservices": os.path.join(paths.SQLMAP_XML_BANNER_PATH, "sharepoint.xml"),

lib/request/basic.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
from lib.core.exception import sqlmapDataException
3030
from lib.core.settings import ML
3131
from lib.core.settings import META_CHARSET_REGEX
32+
from lib.core.settings import PARSE_HEADERS_LIMIT
3233
from lib.core.settings import UNICODE_ENCODING
3334
from lib.parse.headers import headersParser
3435
from lib.parse.html import htmlParser
@@ -191,8 +192,10 @@ def decodePage(page, contentEncoding, contentType):
191192
return page
192193

193194
def processResponse(page, responseHeaders):
195+
kb.processResponseCounter += 1
196+
194197
if not kb.dumpMode:
195-
parseResponse(page, responseHeaders)
198+
parseResponse(page, responseHeaders if kb.processResponseCounter < PARSE_HEADERS_LIMIT else None)
196199

197200
if conf.parseErrors:
198201
msg = extractErrorMessage(page)

0 commit comments

Comments
 (0)