mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2025-12-09 14:11:29 +00:00
added helper function for HashDB data storing/retrieval
This commit is contained in:
@@ -21,6 +21,8 @@ from lib.core.common import getCharset
|
||||
from lib.core.common import getCounter
|
||||
from lib.core.common import goGoodSamaritan
|
||||
from lib.core.common import getPartRun
|
||||
from lib.core.common import hashDBRetrieve
|
||||
from lib.core.common import hashDBWrite
|
||||
from lib.core.common import incrementCounter
|
||||
from lib.core.common import safeStringFormat
|
||||
from lib.core.common import setFormatterPrependFlag
|
||||
@@ -57,7 +59,7 @@ def bisection(payload, expression, length=None, charsetType=None, firstChar=None
|
||||
abortedFlag = False
|
||||
asciiTbl = getCharset(charsetType)
|
||||
timeBasedCompare = (kb.technique in (PAYLOAD.TECHNIQUE.TIME, PAYLOAD.TECHNIQUE.STACKED))
|
||||
retVal = conf.hashDB.retrieve(expression) if not any([conf.flushSession, conf.freshQueries, not kb.resumeValues]) else None
|
||||
retVal = hashDBRetrieve(expression)
|
||||
|
||||
if retVal:
|
||||
if PARTIAL_VALUE_MARKER in retVal:
|
||||
@@ -517,9 +519,9 @@ def bisection(payload, expression, length=None, charsetType=None, firstChar=None
|
||||
|
||||
if finalValue is not None:
|
||||
finalValue = decodeHexValue(finalValue) if conf.hexConvert else finalValue
|
||||
conf.hashDB.write(expression, finalValue)
|
||||
hashDBWrite(expression, finalValue)
|
||||
else:
|
||||
conf.hashDB.write(expression, "%s%s" % (PARTIAL_VALUE_MARKER, partialValue))
|
||||
hashDBWrite(expression, "%s%s" % (PARTIAL_VALUE_MARKER, partialValue))
|
||||
|
||||
if kb.threadException:
|
||||
raise sqlmapThreadException, "something unexpected happened inside the threads"
|
||||
|
||||
@@ -15,6 +15,8 @@ from lib.core.common import filterListValue
|
||||
from lib.core.common import getFileItems
|
||||
from lib.core.common import Backend
|
||||
from lib.core.common import getPageWordSet
|
||||
from lib.core.common import hashDBRetrieve
|
||||
from lib.core.common import hashDBWrite
|
||||
from lib.core.common import randomInt
|
||||
from lib.core.common import randomStr
|
||||
from lib.core.common import safeStringFormat
|
||||
@@ -132,7 +134,7 @@ def tableExists(tableFile, regex=None):
|
||||
if _ not in kb.brute.tables:
|
||||
kb.brute.tables.append(_)
|
||||
|
||||
conf.hashDB.write(HASHDB_KEYS.KB_BRUTE_TABLES, kb.brute.tables, True)
|
||||
hashDBWrite(HASHDB_KEYS.KB_BRUTE_TABLES, kb.brute.tables, True)
|
||||
|
||||
return kb.data.cachedTables
|
||||
|
||||
@@ -231,6 +233,6 @@ def columnExists(columnFile, regex=None):
|
||||
if _ not in kb.brute.columns:
|
||||
kb.brute.columns.append(_)
|
||||
|
||||
conf.hashDB.write(HASHDB_KEYS.KB_BRUTE_COLUMNS, kb.brute.columns, True)
|
||||
hashDBWrite(HASHDB_KEYS.KB_BRUTE_COLUMNS, kb.brute.columns, True)
|
||||
|
||||
return kb.data.cachedColumns
|
||||
|
||||
@@ -19,6 +19,8 @@ from lib.core.common import dataToStdout
|
||||
from lib.core.common import decodeHexValue
|
||||
from lib.core.common import extractRegexResult
|
||||
from lib.core.common import getUnicode
|
||||
from lib.core.common import hashDBRetrieve
|
||||
from lib.core.common import hashDBWrite
|
||||
from lib.core.common import incrementCounter
|
||||
from lib.core.common import initTechnique
|
||||
from lib.core.common import isNumPosStrValue
|
||||
@@ -43,7 +45,7 @@ from lib.core.unescaper import unescaper
|
||||
from lib.request.connect import Connect as Request
|
||||
|
||||
def __oneShotErrorUse(expression, field):
|
||||
retVal = conf.hashDB.retrieve(expression) if not any([conf.flushSession, conf.freshQueries, not kb.resumeValues]) else None
|
||||
retVal = hashDBRetrieve(expression)
|
||||
|
||||
threadData = getCurrentThreadData()
|
||||
threadData.resumed = retVal is not None
|
||||
@@ -126,7 +128,7 @@ def __oneShotErrorUse(expression, field):
|
||||
|
||||
retVal = __errorReplaceChars(retVal)
|
||||
|
||||
conf.hashDB.write(expression, retVal)
|
||||
hashDBWrite(expression, retVal)
|
||||
|
||||
else:
|
||||
_ = "%s(?P<result>.*?)%s" % (kb.chars.start, kb.chars.stop)
|
||||
|
||||
@@ -20,6 +20,8 @@ from lib.core.common import dataToStdout
|
||||
from lib.core.common import extractRegexResult
|
||||
from lib.core.common import getConsoleWidth
|
||||
from lib.core.common import getUnicode
|
||||
from lib.core.common import hashDBRetrieve
|
||||
from lib.core.common import hashDBWrite
|
||||
from lib.core.common import incrementCounter
|
||||
from lib.core.common import initTechnique
|
||||
from lib.core.common import isNumPosStrValue
|
||||
@@ -43,7 +45,7 @@ from lib.core.unescaper import unescaper
|
||||
from lib.request.connect import Connect as Request
|
||||
|
||||
def __oneShotUnionUse(expression, unpack=True, limited=False):
|
||||
retVal = conf.hashDB.retrieve(expression) if not any([conf.flushSession, conf.freshQueries, not kb.resumeValues]) else None
|
||||
retVal = hashDBRetrieve(expression)
|
||||
|
||||
threadData = getCurrentThreadData()
|
||||
threadData.resumed = retVal is not None
|
||||
@@ -92,7 +94,7 @@ def __oneShotUnionUse(expression, unpack=True, limited=False):
|
||||
warnMsg += "issues) or switch '--hex'"
|
||||
singleTimeWarnMessage(warnMsg)
|
||||
|
||||
conf.hashDB.write(expression, retVal)
|
||||
hashDBWrite(expression, retVal)
|
||||
|
||||
return retVal
|
||||
|
||||
|
||||
Reference in New Issue
Block a user