mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2025-03-03 11:45:46 +03:00
minor update
This commit is contained in:
parent
63f5c35c23
commit
f8a01ddaf8
|
@ -36,12 +36,8 @@ from lib.core.exception import sqlmapNotVulnerableException
|
|||
from lib.core.exception import sqlmapSilentQuitException
|
||||
from lib.core.exception import sqlmapValueException
|
||||
from lib.core.exception import sqlmapUserQuitException
|
||||
from lib.core.session import setBooleanBased
|
||||
from lib.core.session import setError
|
||||
from lib.core.session import setInjection
|
||||
from lib.core.session import setMatchRatio
|
||||
from lib.core.session import setStacked
|
||||
from lib.core.session import setTimeBased
|
||||
from lib.core.target import initTargetEnv
|
||||
from lib.core.target import setupTargetEnv
|
||||
|
||||
|
@ -132,25 +128,6 @@ def __saveToSessionFile():
|
|||
|
||||
setInjection(inj)
|
||||
|
||||
place = inj.place
|
||||
parameter = inj.parameter
|
||||
|
||||
for stype, sdata in inj.data.items():
|
||||
payload = sdata.payload
|
||||
|
||||
if stype == 1:
|
||||
kb.booleanTest = payload
|
||||
setBooleanBased(place, parameter, payload)
|
||||
elif stype == 2:
|
||||
kb.errorTest = payload
|
||||
setError(place, parameter, payload)
|
||||
elif stype == 4:
|
||||
kb.stackedTest = payload
|
||||
setStacked(place, parameter, payload)
|
||||
elif stype == 5:
|
||||
kb.timeTest = payload
|
||||
setTimeBased(place, parameter, payload)
|
||||
|
||||
def start():
|
||||
"""
|
||||
This function calls a function that performs checks on both URL
|
||||
|
|
|
@ -1651,7 +1651,7 @@ def logHTTPTraffic(requestLogMsg, responseLogMsg):
|
|||
|
||||
kb.locks.reqLock.release()
|
||||
|
||||
def getPublicTypeMembers(type_):
|
||||
def getPublicTypeMembers(type_, onlyValues=False):
|
||||
"""
|
||||
Useful for getting members from types (e.g. in enums)
|
||||
"""
|
||||
|
@ -1659,7 +1659,10 @@ def getPublicTypeMembers(type_):
|
|||
|
||||
for name, value in getmembers(type_):
|
||||
if not name.startswith('__'):
|
||||
retVal.append((name, value))
|
||||
if not onlyValues:
|
||||
retVal.append((name, value))
|
||||
else:
|
||||
retVal.append(value)
|
||||
|
||||
return retVal
|
||||
|
||||
|
@ -1743,3 +1746,11 @@ def parseSqliteTableSchema(value):
|
|||
|
||||
table[conf.tbl] = columns
|
||||
kb.data.cachedColumns[conf.db] = table
|
||||
|
||||
def getTechniqueData(technique=None):
|
||||
retVal = None
|
||||
|
||||
if technique and technique in kb.injection.data:
|
||||
retVal = kb.injection.data[technique]
|
||||
|
||||
return retVal
|
||||
|
|
|
@ -358,34 +358,6 @@ def resumeConfKb(expression, url, value):
|
|||
warnMsg += "but you did not provided it this time"
|
||||
logger.warn(warnMsg)
|
||||
|
||||
elif expression == "Boolean-based blind injection" and url == conf.url:
|
||||
kb.booleanTest = unSafeFormatString(value[:-1])
|
||||
|
||||
logMsg = "resuming boolean-based blind injection "
|
||||
logMsg += "'%s' from session file" % kb.booleanTest
|
||||
logger.info(logMsg)
|
||||
|
||||
elif expression == "Error-based injection" and url == conf.url:
|
||||
kb.errorTest = unSafeFormatString(value[:-1])
|
||||
|
||||
logMsg = "resuming error-based injection "
|
||||
logMsg += "'%s' from session file" % kb.errorTest
|
||||
logger.info(logMsg)
|
||||
|
||||
elif expression == "Stacked queries" and url == conf.url:
|
||||
kb.stackedTest = unSafeFormatString(value[:-1])
|
||||
|
||||
logMsg = "resuming stacked queries syntax "
|
||||
logMsg += "'%s' from session file" % kb.stackedTest
|
||||
logger.info(logMsg)
|
||||
|
||||
elif expression == "Time-based blind injection" and url == conf.url:
|
||||
kb.timeTest = unSafeFormatString(value[:-1])
|
||||
|
||||
logMsg = "resuming time-based blind injection "
|
||||
logMsg += "'%s' from session file" % kb.timeTest
|
||||
logger.info(logMsg)
|
||||
|
||||
elif expression == "DBMS" and url == conf.url:
|
||||
dbms = unSafeFormatString(value[:-1])
|
||||
dbms = dbms.lower()
|
||||
|
|
|
@ -21,7 +21,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.session import setError
|
||||
from lib.core.enums import PAYLOAD
|
||||
from lib.core.unescaper import unescaper
|
||||
from lib.request.connect import Connect as Request
|
||||
|
||||
|
@ -32,7 +32,7 @@ def errorUse(expression):
|
|||
"""
|
||||
|
||||
output = None
|
||||
vector = agent.cleanupPayload(kb.injection.data[2].vector)
|
||||
vector = agent.cleanupPayload(kb.injection.data[PAYLOAD.TECHNIQUE.ERROR].vector)
|
||||
query = unescaper.unescape(vector)
|
||||
query = agent.prefixQuery(query)
|
||||
query = agent.suffixQuery(query)
|
||||
|
|
Loading…
Reference in New Issue
Block a user