mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2024-11-22 17:46:37 +03:00
minor speed optimizations (as a result of profiling)
This commit is contained in:
parent
36280b33fa
commit
10bdd90e60
|
@ -12,7 +12,7 @@ from lib.core.datatype import AttribDict
|
||||||
_defaults = {
|
_defaults = {
|
||||||
"timeSec": 5,
|
"timeSec": 5,
|
||||||
"googlePage": 1,
|
"googlePage": 1,
|
||||||
"cpuThrottle": 10,
|
"cpuThrottle": 5,
|
||||||
"verbose": 1,
|
"verbose": 1,
|
||||||
"cDel": ";",
|
"cDel": ";",
|
||||||
"delay": 0,
|
"delay": 0,
|
||||||
|
|
|
@ -1397,6 +1397,7 @@ def __setKnowledgeBaseAttributes(flushAll=True):
|
||||||
kb.delayCandidates = TIME_DELAY_CANDIDATES * [0]
|
kb.delayCandidates = TIME_DELAY_CANDIDATES * [0]
|
||||||
kb.dep = None
|
kb.dep = None
|
||||||
kb.docRoot = None
|
kb.docRoot = None
|
||||||
|
kb.dumpMode = False
|
||||||
kb.dynamicMarkings = []
|
kb.dynamicMarkings = []
|
||||||
kb.dynamicParameters = False
|
kb.dynamicParameters = False
|
||||||
kb.endDetection = False
|
kb.endDetection = False
|
||||||
|
|
|
@ -209,6 +209,7 @@ def decodePage(page, contentEncoding, contentType):
|
||||||
return page
|
return page
|
||||||
|
|
||||||
def processResponse(page, responseHeaders):
|
def processResponse(page, responseHeaders):
|
||||||
|
if not kb.dumpMode:
|
||||||
parseResponse(page, responseHeaders)
|
parseResponse(page, responseHeaders)
|
||||||
|
|
||||||
if conf.parseErrors:
|
if conf.parseErrors:
|
||||||
|
@ -216,5 +217,3 @@ def processResponse(page, responseHeaders):
|
||||||
|
|
||||||
if msg:
|
if msg:
|
||||||
logger.info("parsed error message: '%s'" % msg)
|
logger.info("parsed error message: '%s'" % msg)
|
||||||
|
|
||||||
return page
|
|
||||||
|
|
|
@ -419,7 +419,7 @@ class Connect:
|
||||||
else:
|
else:
|
||||||
debugMsg = "got HTTP error code: %d (%s)" % (code, status)
|
debugMsg = "got HTTP error code: %d (%s)" % (code, status)
|
||||||
logger.debug(debugMsg)
|
logger.debug(debugMsg)
|
||||||
page = processResponse(page, responseHeaders)
|
processResponse(page, responseHeaders)
|
||||||
return page, responseHeaders
|
return page, responseHeaders
|
||||||
|
|
||||||
except (urllib2.URLError, socket.error, socket.timeout, httplib.BadStatusLine, httplib.IncompleteRead), e:
|
except (urllib2.URLError, socket.error, socket.timeout, httplib.BadStatusLine, httplib.IncompleteRead), e:
|
||||||
|
@ -465,7 +465,7 @@ class Connect:
|
||||||
finally:
|
finally:
|
||||||
socket.setdefaulttimeout(conf.timeout)
|
socket.setdefaulttimeout(conf.timeout)
|
||||||
|
|
||||||
page = processResponse(page, responseHeaders)
|
processResponse(page, responseHeaders)
|
||||||
|
|
||||||
responseMsg += "[#%d] (%d %s):\n" % (threadData.lastRequestUID, code, status)
|
responseMsg += "[#%d] (%d %s):\n" % (threadData.lastRequestUID, code, status)
|
||||||
if responseHeaders:
|
if responseHeaders:
|
||||||
|
|
|
@ -1549,6 +1549,8 @@ class Enumeration:
|
||||||
kb.data.cachedColumns = foundData
|
kb.data.cachedColumns = foundData
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
kb.dumpMode = True
|
||||||
|
|
||||||
if not safeSQLIdentificatorNaming(conf.db) in kb.data.cachedColumns \
|
if not safeSQLIdentificatorNaming(conf.db) in kb.data.cachedColumns \
|
||||||
or safeSQLIdentificatorNaming(tbl, True) not in \
|
or safeSQLIdentificatorNaming(tbl, True) not in \
|
||||||
kb.data.cachedColumns[safeSQLIdentificatorNaming(conf.db)] \
|
kb.data.cachedColumns[safeSQLIdentificatorNaming(conf.db)] \
|
||||||
|
@ -1768,6 +1770,9 @@ class Enumeration:
|
||||||
errMsg += "'%s'" % e
|
errMsg += "'%s'" % e
|
||||||
logger.critical(errMsg)
|
logger.critical(errMsg)
|
||||||
|
|
||||||
|
finally:
|
||||||
|
kb.dumpMode = False
|
||||||
|
|
||||||
def dumpAll(self):
|
def dumpAll(self):
|
||||||
if conf.db is not None and conf.tbl is None:
|
if conf.db is not None and conf.tbl is None:
|
||||||
self.dumpTable()
|
self.dumpTable()
|
||||||
|
|
Loading…
Reference in New Issue
Block a user