mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2025-02-03 05:04:11 +03:00
update (smaller memory footprint in postprocessing phase because of safecharencode part)
This commit is contained in:
parent
5770c08784
commit
6bbb8139a0
|
@ -1442,6 +1442,7 @@ def __setKnowledgeBaseAttributes(flushAll=True):
|
||||||
kb.reflectiveCounters = {REFLECTIVE_COUNTER.MISS:0, REFLECTIVE_COUNTER.HIT:0}
|
kb.reflectiveCounters = {REFLECTIVE_COUNTER.MISS:0, REFLECTIVE_COUNTER.HIT:0}
|
||||||
kb.responseTimes = []
|
kb.responseTimes = []
|
||||||
kb.resumedQueries = {}
|
kb.resumedQueries = {}
|
||||||
|
kb.safeCharEncode = False
|
||||||
kb.singleLogFlags = set()
|
kb.singleLogFlags = set()
|
||||||
kb.skipOthersDbms = None
|
kb.skipOthersDbms = None
|
||||||
kb.suppressSession = False
|
kb.suppressSession = False
|
||||||
|
|
|
@ -28,7 +28,6 @@ from lib.core.common import randomInt
|
||||||
from lib.core.common import readInput
|
from lib.core.common import readInput
|
||||||
from lib.core.common import replaceNewlineTabs
|
from lib.core.common import replaceNewlineTabs
|
||||||
from lib.core.common import safeStringFormat
|
from lib.core.common import safeStringFormat
|
||||||
from lib.core.convert import safecharencode
|
|
||||||
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
|
||||||
|
@ -401,6 +400,8 @@ def getValue(expression, blind=True, inband=True, error=True, time=True, fromUse
|
||||||
(if selected).
|
(if selected).
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
kb.safeCharEncode = safeCharEncode
|
||||||
|
|
||||||
if suppressOutput is not None:
|
if suppressOutput is not None:
|
||||||
pushValue(getCurrentThreadData().disableStdOut)
|
pushValue(getCurrentThreadData().disableStdOut)
|
||||||
getCurrentThreadData().disableStdOut = suppressOutput
|
getCurrentThreadData().disableStdOut = suppressOutput
|
||||||
|
@ -499,8 +500,7 @@ def getValue(expression, blind=True, inband=True, error=True, time=True, fromUse
|
||||||
elif value == [None]:
|
elif value == [None]:
|
||||||
value = None
|
value = None
|
||||||
|
|
||||||
if safeCharEncode:
|
kb.safeCharEncode = False
|
||||||
value = safecharencode(value)
|
|
||||||
|
|
||||||
return value
|
return value
|
||||||
|
|
||||||
|
|
|
@ -27,6 +27,7 @@ from lib.core.common import replaceNewlineTabs
|
||||||
from lib.core.common import safeStringFormat
|
from lib.core.common import safeStringFormat
|
||||||
from lib.core.common import singleTimeWarnMessage
|
from lib.core.common import singleTimeWarnMessage
|
||||||
from lib.core.common import unhandledExceptionMessage
|
from lib.core.common import unhandledExceptionMessage
|
||||||
|
from lib.core.convert import safecharencode
|
||||||
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
|
||||||
|
@ -521,4 +522,4 @@ def bisection(payload, expression, length=None, charsetType=None, firstChar=None
|
||||||
if kb.threadException:
|
if kb.threadException:
|
||||||
raise sqlmapThreadException, "something unexpected happened inside the threads"
|
raise sqlmapThreadException, "something unexpected happened inside the threads"
|
||||||
|
|
||||||
return queriesCount[0], finalValue
|
return queriesCount[0], safecharencode(finalValue) if kb.safeCharEncode else finalValue
|
||||||
|
|
|
@ -131,7 +131,7 @@ def __oneShotErrorUse(expression, field):
|
||||||
|
|
||||||
dataToSessionFile("[%s][%s][%s][%s][%s]\n" % (conf.url, kb.injection.place, conf.parameters[kb.injection.place], expression, replaceNewlineTabs(retVal)))
|
dataToSessionFile("[%s][%s][%s][%s][%s]\n" % (conf.url, kb.injection.place, conf.parameters[kb.injection.place], expression, replaceNewlineTabs(retVal)))
|
||||||
|
|
||||||
return retVal
|
return safecharencode(retVal) if kb.safeCharEncode else retVal
|
||||||
|
|
||||||
def __errorFields(expression, expressionFields, expressionFieldsList, expected=None, num=None, resumeValue=True):
|
def __errorFields(expression, expressionFields, expressionFieldsList, expected=None, num=None, resumeValue=True):
|
||||||
outputs = []
|
outputs = []
|
||||||
|
|
|
@ -97,7 +97,7 @@ def __oneShotUnionUse(expression, unpack=True):
|
||||||
warnMsg += "issues)"
|
warnMsg += "issues)"
|
||||||
singleTimeWarnMessage(warnMsg)
|
singleTimeWarnMessage(warnMsg)
|
||||||
|
|
||||||
return output
|
return safecharencode(output) if kb.safeCharEncode else output
|
||||||
|
|
||||||
def configUnion(char=None, columns=None):
|
def configUnion(char=None, columns=None):
|
||||||
def __configUnionChar(char):
|
def __configUnionChar(char):
|
||||||
|
|
Loading…
Reference in New Issue
Block a user