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

Skip to content

Commit 73e85bf

Browse files
committed
Minor bug fix: the --tamper scripts have to be provided from the highest to the lowest priority, if not, sqlmap will reverse-sort them automatically as per user's choice. Tested, works now
1 parent 4d81da6 commit 73e85bf

1 file changed

Lines changed: 9 additions & 7 deletions

File tree

lib/core/option.py

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -525,7 +525,7 @@ def __setTamperingFunctions():
525525
"""
526526

527527
if conf.tamper:
528-
last_priority = PRIORITY.LOWEST
528+
last_priority = PRIORITY.HIGHEST
529529
check_priority = True
530530
resolve_priorities = False
531531
priorities = []
@@ -569,13 +569,13 @@ def __setTamperingFunctions():
569569

570570
for name, function in inspect.getmembers(module, inspect.isfunction):
571571
if name == "tamper" and function.func_code.co_argcount == 1:
572-
kb.tamperFunctions.append(function)
573572
found = True
573+
kb.tamperFunctions.append(function)
574574

575-
if check_priority and priority < last_priority:
576-
message = "it seems that you've probably "
577-
message += "mixed order of tamper scripts.\n"
578-
message += "do you want to auto resolve this? [Y/n/q]"
575+
if check_priority and priority > last_priority:
576+
message = "it seems that you might have mixed "
577+
message += "the order of tamper scripts.\n"
578+
message += "Do you want to auto resolve this? [Y/n/q]"
579579
test = readInput(message, default="Y")
580580

581581
if not test or test[0] in ("y", "Y"):
@@ -589,14 +589,16 @@ def __setTamperingFunctions():
589589

590590
priorities.append((priority, function))
591591
last_priority = priority
592+
592593
break
593594

594595
if not found:
595596
raise sqlmapGenericException, "missing function 'tamper(value)' in tamper script '%s'" % tfile
596597

597598
if resolve_priorities and priorities:
598-
priorities.sort()
599+
priorities.sort(reverse=True)
599600
kb.tamperFunctions = []
601+
600602
for _, function in priorities:
601603
kb.tamperFunctions.append(function)
602604

0 commit comments

Comments
 (0)