mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2025-02-03 13:14:13 +03:00
minor refactoring
This commit is contained in:
parent
9c4a62f725
commit
31571e6e2d
|
@ -54,32 +54,6 @@ from lib.techniques.dns.use import dnsUse
|
||||||
from lib.techniques.error.use import errorUse
|
from lib.techniques.error.use import errorUse
|
||||||
from lib.techniques.union.use import unionUse
|
from lib.techniques.union.use import unionUse
|
||||||
|
|
||||||
def __goInference(payload, expression, charsetType=None, firstChar=None, lastChar=None, dump=False):
|
|
||||||
start = time.time()
|
|
||||||
value = None
|
|
||||||
count = 0
|
|
||||||
|
|
||||||
value = __goDns(payload, expression)
|
|
||||||
|
|
||||||
if value is None:
|
|
||||||
timeBasedCompare = (kb.technique in (PAYLOAD.TECHNIQUE.TIME, PAYLOAD.TECHNIQUE.STACKED))
|
|
||||||
|
|
||||||
if not (timeBasedCompare and kb.dnsTest):
|
|
||||||
if (conf.eta or conf.threads > 1) and Backend.getIdentifiedDbms() and not timeBasedCompare:
|
|
||||||
_, length, _ = queryOutputLength(expression, payload)
|
|
||||||
else:
|
|
||||||
length = None
|
|
||||||
|
|
||||||
kb.inferenceMode = True
|
|
||||||
count, value = bisection(payload, expression, length, charsetType, firstChar, lastChar, dump)
|
|
||||||
kb.inferenceMode = False
|
|
||||||
|
|
||||||
if not kb.bruteMode:
|
|
||||||
debugMsg = "performed %d queries in %d seconds" % (count, calculateDeltaSeconds(start))
|
|
||||||
logger.debug(debugMsg)
|
|
||||||
|
|
||||||
return value
|
|
||||||
|
|
||||||
def __goDns(payload, expression):
|
def __goDns(payload, expression):
|
||||||
value = None
|
value = None
|
||||||
|
|
||||||
|
@ -92,6 +66,34 @@ def __goDns(payload, expression):
|
||||||
|
|
||||||
return value
|
return value
|
||||||
|
|
||||||
|
def __goInference(payload, expression, charsetType=None, firstChar=None, lastChar=None, dump=False):
|
||||||
|
start = time.time()
|
||||||
|
value = None
|
||||||
|
count = 0
|
||||||
|
|
||||||
|
value = __goDns(payload, expression)
|
||||||
|
|
||||||
|
if value:
|
||||||
|
return value
|
||||||
|
|
||||||
|
timeBasedCompare = (kb.technique in (PAYLOAD.TECHNIQUE.TIME, PAYLOAD.TECHNIQUE.STACKED))
|
||||||
|
|
||||||
|
if not (timeBasedCompare and kb.dnsTest):
|
||||||
|
if (conf.eta or conf.threads > 1) and Backend.getIdentifiedDbms() and not timeBasedCompare:
|
||||||
|
_, length, _ = queryOutputLength(expression, payload)
|
||||||
|
else:
|
||||||
|
length = None
|
||||||
|
|
||||||
|
kb.inferenceMode = True
|
||||||
|
count, value = bisection(payload, expression, length, charsetType, firstChar, lastChar, dump)
|
||||||
|
kb.inferenceMode = False
|
||||||
|
|
||||||
|
if not kb.bruteMode:
|
||||||
|
debugMsg = "performed %d queries in %d seconds" % (count, calculateDeltaSeconds(start))
|
||||||
|
logger.debug(debugMsg)
|
||||||
|
|
||||||
|
return value
|
||||||
|
|
||||||
def __goInferenceFields(expression, expressionFields, expressionFieldsList, payload, expected=None, num=None, charsetType=None, firstChar=None, lastChar=None, dump=False):
|
def __goInferenceFields(expression, expressionFields, expressionFieldsList, payload, expected=None, num=None, charsetType=None, firstChar=None, lastChar=None, dump=False):
|
||||||
outputs = []
|
outputs = []
|
||||||
origExpr = None
|
origExpr = None
|
||||||
|
|
Loading…
Reference in New Issue
Block a user