added switch --logic-negative

This commit is contained in:
Miroslav Stampar 2011-10-24 00:40:06 +00:00
parent 8bd3cfdc8e
commit 20ae1c2187
4 changed files with 18 additions and 4 deletions

View File

@ -289,7 +289,10 @@ def checkSqlInjection(place, parameter, value):
# Use different page template than the original # Use different page template than the original
# one as we are changing parameters value, which # one as we are changing parameters value, which
# will likely result in a different content # will likely result in a different content
if not conf.logicNegative:
origValue = "-%s" % randomInt() origValue = "-%s" % randomInt()
else:
origValue = "%s AND %s=%s" % (origValue, randomInt(), randomInt())
templatePayload = agent.payload(place, parameter, newValue=origValue, where=where) templatePayload = agent.payload(place, parameter, newValue=origValue, where=where)
elif where == PAYLOAD.WHERE.REPLACE: elif where == PAYLOAD.WHERE.REPLACE:
origValue = "" origValue = ""

View File

@ -88,10 +88,13 @@ class Agent:
if where == PAYLOAD.WHERE.ORIGINAL: if where == PAYLOAD.WHERE.ORIGINAL:
value = origValue value = origValue
elif where == PAYLOAD.WHERE.NEGATIVE: elif where == PAYLOAD.WHERE.NEGATIVE:
if not conf.logicNegative:
if newValue.startswith("-"): if newValue.startswith("-"):
value = "" value = ""
else: else:
value = "-%s" % randomInt() value = "-%s" % randomInt()
else:
value = "%s AND %s=%s" % (origValue, randomInt(2), randomInt(2))
elif where == PAYLOAD.WHERE.REPLACE: elif where == PAYLOAD.WHERE.REPLACE:
value = "" value = ""
else: else:

View File

@ -184,6 +184,10 @@ def cmdLineParser():
injection.add_option("--suffix", dest="suffix", injection.add_option("--suffix", dest="suffix",
help="Injection payload suffix string") help="Injection payload suffix string")
injection.add_option("--logic-negative", dest="logicNegative",
action="store_true",
help="Use logic operation(s) instead of negating values")
injection.add_option("--skip", dest="skip", injection.add_option("--skip", dest="skip",
help="Skip testing for given parameter(s)") help="Skip testing for given parameter(s)")

View File

@ -185,6 +185,10 @@ prefix =
# Injection payload suffix string # Injection payload suffix string
suffix = suffix =
# Use logic operation(s) instead of negating values
# Valid: True or False
logicNegative = False
# Skip testing for given parameter(s) # Skip testing for given parameter(s)
skip = skip =