Skip to content

Commit 10b0639

Browse files
committed
making a "--exact" switch on demand (choosing exact identifier names by default instead of LIKE)
1 parent 76a4aa1 commit 10b0639

4 files changed

Lines changed: 13 additions & 4 deletions

File tree

lib/core/optiondict.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,7 @@
188188
"checkPayload": "boolean",
189189
"cleanup": "boolean",
190190
"dependencies": "boolean",
191+
"exact": "boolean",
191192
"googlePage": "integer",
192193
"mobile": "boolean",
193194
"pageRank": "boolean",

lib/parse/cmdline.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -596,6 +596,10 @@ def cmdLineParser():
596596
action="store_true",
597597
help="Check for missing sqlmap dependencies")
598598

599+
miscellaneous.add_option("--exact", dest="exact",
600+
action="store_true",
601+
help="Prefer usage of exact names for provided identificators")
602+
599603
miscellaneous.add_option("--gpage", dest="googlePage", type="int",
600604
help="Use Google dork results from specified page number")
601605

plugins/generic/misc.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -171,12 +171,12 @@ def likeOrExact(self, what):
171171
message += "[1] as LIKE %s names (default)\n" % what
172172
message += "[2] as exact %s names" % what
173173

174-
choice = readInput(message, default="1")
174+
choice = readInput(message, default='1') if not conf.exact else '2'
175175

176-
if not choice or choice == "1":
177-
choice = "1"
176+
if not choice or choice == '1':
177+
choice = '1'
178178
condParam = " LIKE '%%%s%%'"
179-
elif choice == "2":
179+
elif choice == '2':
180180
condParam = "='%s'"
181181
else:
182182
errMsg = "invalid value"

sqlmap.conf

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -635,6 +635,10 @@ cleanup = False
635635
# Valid: True or False
636636
dependencies = False
637637

638+
# Prefer usage of exact names for provided identificators.
639+
# Valid: True or False
640+
exact = False
641+
638642
# Use Google dork results from specified page number.
639643
# Valid: integer
640644
# Default: 1

0 commit comments

Comments
 (0)