mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2025-12-20 14:39:02 +00:00
Got rid of UNION false cond
This commit is contained in:
@@ -49,7 +49,7 @@ class Agent:
|
||||
|
||||
return query
|
||||
|
||||
def payload(self, place=None, parameter=None, value=None, newValue=None, negative=False, falseCond=False):
|
||||
def payload(self, place=None, parameter=None, value=None, newValue=None, negative=False):
|
||||
"""
|
||||
This method replaces the affected parameter with the SQL
|
||||
injection statement to request
|
||||
@@ -64,9 +64,6 @@ class Agent:
|
||||
|
||||
if negative or kb.unionNegative:
|
||||
negValue = "-"
|
||||
elif falseCond or kb.unionFalseCond:
|
||||
randInt = randomInt()
|
||||
falseValue = " AND %d=%d" % (randInt, randInt + 1)
|
||||
|
||||
# After identifing the injectable parameter
|
||||
if kb.injection.place == PLACE.UA and kb.injection.parameter:
|
||||
|
||||
@@ -1182,7 +1182,6 @@ def __setKnowledgeBaseAttributes():
|
||||
kb.unionCount = None
|
||||
kb.unionPosition = None
|
||||
kb.unionNegative = False
|
||||
kb.unionFalseCond = False
|
||||
kb.userAgents = None
|
||||
kb.valueStack = []
|
||||
kb.redirectSetCookie = None
|
||||
|
||||
@@ -203,7 +203,7 @@ def setTimeBased(place, parameter, payload):
|
||||
if condition:
|
||||
dataToSessionFile("[%s][%s][%s][Time-based blind injection][%s]\n" % (conf.url, place, safeFormatString(conf.parameters[place]), payload))
|
||||
|
||||
def setUnion(comment=None, count=None, position=None, negative=False, falseCond=False, char=None, payload=None):
|
||||
def setUnion(comment=None, count=None, position=None, negative=False, char=None, payload=None):
|
||||
"""
|
||||
@param comment: union comment to save in session file
|
||||
@type comment: C{str}
|
||||
@@ -260,18 +260,6 @@ def setUnion(comment=None, count=None, position=None, negative=False, falseCond=
|
||||
|
||||
kb.unionNegative = True
|
||||
|
||||
if falseCond:
|
||||
condition = (
|
||||
not kb.resumedQueries or ( kb.resumedQueries.has_key(conf.url) and
|
||||
( not kb.resumedQueries[conf.url].has_key("Union false condition")
|
||||
) )
|
||||
)
|
||||
|
||||
if condition:
|
||||
dataToSessionFile("[%s][%s][%s][Union false condition][Yes]\n" % (conf.url, kb.injection.place, safeFormatString(conf.parameters[kb.injection.place])))
|
||||
|
||||
kb.unionFalseCond = True
|
||||
|
||||
if char:
|
||||
condition = (
|
||||
not kb.resumedQueries or ( kb.resumedQueries.has_key(conf.url) and
|
||||
@@ -475,12 +463,6 @@ def resumeConfKb(expression, url, value):
|
||||
logMsg = "resuming union negative from session file"
|
||||
logger.info(logMsg)
|
||||
|
||||
elif expression == "Union false condition" and url == conf.url:
|
||||
kb.unionFalseCond = True if value[:-1] == "Yes" else False
|
||||
|
||||
logMsg = "resuming union false condition from session file"
|
||||
logger.info(logMsg)
|
||||
|
||||
elif expression == "Union char" and url == conf.url:
|
||||
conf.uChar = value[:-1]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user