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

Skip to content

Commit 9832fc4

Browse files
committed
minor improvement for --tamper (now standard tamper scripts can be used like --tamper=randomcase)
1 parent 3048e9f commit 9832fc4

2 files changed

Lines changed: 5 additions & 1 deletion

File tree

lib/core/common.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -902,6 +902,7 @@ def setPaths():
902902
# sqlmap paths
903903
paths.SQLMAP_EXTRAS_PATH = os.path.join(paths.SQLMAP_ROOT_PATH, "extra")
904904
paths.SQLMAP_SHELL_PATH = os.path.join(paths.SQLMAP_ROOT_PATH, "shell")
905+
paths.SQLMAP_TAMPER_PATH = os.path.join(paths.SQLMAP_ROOT_PATH, "tamper")
905906
paths.SQLMAP_TXT_PATH = os.path.join(paths.SQLMAP_ROOT_PATH, "txt")
906907
paths.SQLMAP_UDF_PATH = os.path.join(paths.SQLMAP_ROOT_PATH, "udf")
907908
paths.SQLMAP_XML_PATH = os.path.join(paths.SQLMAP_ROOT_PATH, "xml")

lib/core/option.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -721,14 +721,17 @@ def __setTamperingFunctions():
721721
resolve_priorities = False
722722
priorities = []
723723

724-
for tfile in conf.tamper.split(','):
724+
for tfile in re.split(r'[,|;]', conf.tamper):
725725
found = False
726726

727727
tfile = tfile.strip()
728728

729729
if not tfile:
730730
continue
731731

732+
elif os.path.exists(os.path.join(paths.SQLMAP_TAMPER_PATH, tfile if tfile.endswith('.py') else "%s.py" % tfile)):
733+
tfile = os.path.join(paths.SQLMAP_TAMPER_PATH, tfile if tfile.endswith('.py') else "%s.py" % tfile)
734+
732735
elif not os.path.exists(tfile):
733736
errMsg = "tamper script '%s' does not exist" % tfile
734737
raise sqlmapFilePathException, errMsg

0 commit comments

Comments
 (0)