Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 56638f9

Browse files
committed
making --no-cast unhidden and renaming --negative-logic to --logical-negate to prevent confusion with stuff used in OR boolean based injection
1 parent 79c3d6f commit 56638f9

5 files changed

Lines changed: 16 additions & 11 deletions

File tree

lib/controller/checks.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ def checkSqlInjection(place, parameter, value):
285285
# Use different page template than the original
286286
# one as we are changing parameters value, which
287287
# will likely result in a different content
288-
if not conf.logicNegative:
288+
if not conf.logicalNegate:
289289
origValue = "-%s" % randomInt()
290290
else:
291291
origValue = "%s AND %s=%s" % (origValue, randomInt(), randomInt())

lib/core/agent.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ def payload(self, place=None, parameter=None, value=None, newValue=None, where=N
8787
if where == PAYLOAD.WHERE.ORIGINAL:
8888
value = origValue
8989
elif where == PAYLOAD.WHERE.NEGATIVE:
90-
if not conf.logicNegative:
90+
if not conf.logicalNegate:
9191
if newValue.startswith("-"):
9292
value = ""
9393
else:

lib/core/optiondict.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@
6565
"os": "string",
6666
"prefix": "string",
6767
"suffix": "string",
68-
"logicNegative": "boolean",
68+
"logicalNegate": "boolean",
6969
"skip": "string",
7070
"tamper": "string"
7171
},

lib/parse/cmdline.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -196,12 +196,16 @@ def cmdLineParser():
196196
injection.add_option("--suffix", dest="suffix",
197197
help="Injection payload suffix string")
198198

199-
injection.add_option("--logic-negative", dest="logicNegative",
199+
injection.add_option("--logical-negate", dest="logicalNegate",
200200
action="store_true",
201-
help="Use logic operation(s) instead of negating values")
201+
help="Use logic operation(s) for negating values")
202+
203+
injection.add_option("--no-cast", dest="noCast",
204+
action="store_true",
205+
help="Turn off payload casting mechanism")
202206

203207
injection.add_option("--skip", dest="skip",
204-
help="Skip testing for given parameter(s)")
208+
help="Skip testing for given parameter(s)")
205209

206210
injection.add_option("--tamper", dest="tamper",
207211
help="Use given script(s) for tampering injection data")
@@ -622,9 +626,6 @@ def cmdLineParser():
622626
parser.add_option("--group-concat", dest="groupConcat", action="store_true",
623627
help=SUPPRESS_HELP)
624628

625-
parser.add_option("--no-cast", dest="noCast", action="store_true",
626-
help=SUPPRESS_HELP)
627-
628629
parser.add_option("--test-filter", dest="testFilter",
629630
help=SUPPRESS_HELP)
630631

sqlmap.conf

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -197,9 +197,13 @@ prefix =
197197
# Injection payload suffix string.
198198
suffix =
199199

200-
# Use logic operation(s) instead of negating values.
200+
# Use logic operation(s) for negating values.
201201
# Valid: True or False
202-
logicNegative = False
202+
logicalNegate = False
203+
204+
# Turn off payload casting mechanism
205+
# Valid: True or False
206+
noCast = False
203207

204208
# Skip testing for given parameter(s).
205209
skip =

0 commit comments

Comments
 (0)