mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2025-02-03 05:04:11 +03:00
code beautification
This commit is contained in:
parent
64cc2588f1
commit
6223f25dd9
|
@ -94,3 +94,11 @@ class PAYLOAD:
|
|||
COMPARISON = "comparison"
|
||||
GREP = "grep"
|
||||
TIME = "time"
|
||||
|
||||
class TECHNIQUE:
|
||||
HEURISTIC = 0
|
||||
BOOLEAN = 1
|
||||
ERROR = 2
|
||||
UNION = 3
|
||||
STACKED = 4
|
||||
TIME = 5
|
||||
|
|
|
@ -28,6 +28,7 @@ from lib.core.data import kb
|
|||
from lib.core.data import logger
|
||||
from lib.core.data import queries
|
||||
from lib.core.enums import DBMS
|
||||
from lib.core.enums import PAYLOAD
|
||||
from lib.core.exception import sqlmapNotVulnerableException
|
||||
from lib.core.settings import MIN_TIME_RESPONSES
|
||||
from lib.request.connect import Connect as Request
|
||||
|
@ -387,7 +388,7 @@ def getValue(expression, blind=True, inband=True, error=True, time=True, fromUse
|
|||
expression = expression.replace("DISTINCT ", "")
|
||||
|
||||
if inband and kb.unionTest is not None:
|
||||
kb.technique = 3
|
||||
kb.technique = PAYLOAD.TECHNIQUE.UNION
|
||||
value = __goInband(expression, expected, sort, resumeValue, unpack, dump)
|
||||
|
||||
if not value:
|
||||
|
@ -400,7 +401,7 @@ def getValue(expression, blind=True, inband=True, error=True, time=True, fromUse
|
|||
kb.unionNegative = False
|
||||
|
||||
if error and kb.errorTest and not value:
|
||||
kb.technique = 2
|
||||
kb.technique = PAYLOAD.TECHNIQUE.ERROR
|
||||
value = __goError(expression, resumeValue)
|
||||
|
||||
if not value:
|
||||
|
@ -410,11 +411,11 @@ def getValue(expression, blind=True, inband=True, error=True, time=True, fromUse
|
|||
logger.warn(warnMsg)
|
||||
|
||||
if blind and kb.booleanTest and not value:
|
||||
kb.technique = 1
|
||||
kb.technique = PAYLOAD.TECHNIQUE.BOOLEAN
|
||||
value = __goInferenceProxy(expression, fromUser, expected, batch, resumeValue, unpack, charsetType, firstChar, lastChar)
|
||||
|
||||
if time and kb.timeTest and not value:
|
||||
kb.technique = 5
|
||||
kb.technique = PAYLOAD.TECHNIQUE.TIME
|
||||
|
||||
while len(kb.responseTimes) < MIN_TIME_RESPONSES:
|
||||
_ = Request.queryPage(content=True)
|
||||
|
@ -436,7 +437,7 @@ def getValue(expression, blind=True, inband=True, error=True, time=True, fromUse
|
|||
return value
|
||||
|
||||
def goStacked(expression, silent=False):
|
||||
kb.technique = 4
|
||||
kb.technique = PAYLOAD.TECHNIQUE.STACKED
|
||||
expression = cleanQuery(expression)
|
||||
|
||||
if conf.direct:
|
||||
|
|
|
@ -27,6 +27,7 @@ from lib.core.data import kb
|
|||
from lib.core.data import logger
|
||||
from lib.core.data import queries
|
||||
from lib.core.enums import DBMS
|
||||
from lib.core.enums import PAYLOAD
|
||||
from lib.core.exception import sqlmapConnectionException
|
||||
from lib.core.exception import sqlmapValueException
|
||||
from lib.core.exception import sqlmapThreadException
|
||||
|
@ -44,7 +45,7 @@ def bisection(payload, expression, length=None, charsetType=None, firstChar=None
|
|||
partialValue = ""
|
||||
finalValue = ""
|
||||
asciiTbl = getCharset(charsetType)
|
||||
timeBasedCompare = (kb.technique == 5)
|
||||
timeBasedCompare = (kb.technique == PAYLOAD.TECHNIQUE.TIME)
|
||||
|
||||
# Set kb.partRun in case "common prediction" feature (a.k.a. "good
|
||||
# samaritan") is used
|
||||
|
|
Loading…
Reference in New Issue
Block a user