mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2025-05-26 00:33:14 +03:00
Minor code refactoring and added internal debug prints
This commit is contained in:
parent
af9725214a
commit
b3a0f38f3f
|
@ -67,15 +67,15 @@ class Agent:
|
|||
if where is None and isTechniqueAvailable(kb.technique):
|
||||
where = kb.injection.data[kb.technique].where
|
||||
|
||||
# Debug print
|
||||
#print "value: %s, newValue: %s, where: %s, kb.technique: %s" % (value, newValue, where, kb.technique)
|
||||
|
||||
if kb.injection.place is not None:
|
||||
place = kb.injection.place
|
||||
|
||||
if kb.injection.parameter is not None:
|
||||
parameter = kb.injection.parameter
|
||||
|
||||
if place == PLACE.UA:
|
||||
retValue = parameter.replace(parameter, self.addPayloadDelimiters(parameter + newValue))
|
||||
else:
|
||||
paramString = conf.parameters[place]
|
||||
paramDict = conf.paramDict[place]
|
||||
origValue = paramDict[parameter]
|
||||
|
@ -84,6 +84,9 @@ class Agent:
|
|||
if where == 1:
|
||||
value = origValue
|
||||
elif where == 2:
|
||||
if newValue.startswith("-"):
|
||||
value = ""
|
||||
else:
|
||||
value = "-%s" % randomInt()
|
||||
elif where == 3:
|
||||
value = ""
|
||||
|
@ -102,12 +105,15 @@ class Agent:
|
|||
child.text = self.addPayloadDelimiters(newValue)
|
||||
|
||||
retValue = ET.tostring(root)
|
||||
elif place == PLACE.URI:
|
||||
elif place in (PLACE.UA, PLACE.URI):
|
||||
retValue = paramString.replace("*", self.addPayloadDelimiters(newValue))
|
||||
else:
|
||||
retValue = paramString.replace("%s=%s" % (parameter, origValue),
|
||||
"%s=%s" % (parameter, self.addPayloadDelimiters(newValue)))
|
||||
|
||||
# Debug print
|
||||
#print "retValue:", retValue
|
||||
|
||||
return retValue
|
||||
|
||||
def fullPayload(self, query):
|
||||
|
|
Loading…
Reference in New Issue
Block a user