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

Skip to content

Commit f4a0820

Browse files
committed
Merging of tamper script arguments (e.g. --tamper A --tamper B -> --tamper=A,B)
1 parent 459e1dd commit f4a0820

3 files changed

Lines changed: 10 additions & 3 deletions

File tree

lib/core/settings.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
from lib.core.enums import OS
2020

2121
# sqlmap version (<major>.<minor>.<month>.<monthly commit>)
22-
VERSION = "1.2.9.37"
22+
VERSION = "1.2.9.38"
2323
TYPE = "dev" if VERSION.count('.') > 2 and VERSION.split('.')[-1] != '0' else "stable"
2424
TYPE_COLORS = {"dev": 33, "stable": 90, "pip": 34}
2525
VERSION_STRING = "sqlmap/%s#%s" % ('.'.join(VERSION.split('.')[:-1]) if VERSION.count('.') > 2 and VERSION.split('.')[-1] == '0' else VERSION, TYPE)

lib/parse/cmdline.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -753,6 +753,7 @@ def _(self, *args):
753753
prompt = False
754754
advancedHelp = True
755755
extraHeaders = []
756+
tamperIndex = None
756757

757758
# Reference: https://stackoverflow.com/a/4012683 (Note: previously used "...sys.getfilesystemencoding() or UNICODE_ENCODING")
758759
for arg in argv:
@@ -824,6 +825,12 @@ def _(self, *args):
824825
elif re.search(r"\A-\w=.+", argv[i]):
825826
dataToStdout("[!] potentially miswritten (illegal '=') short option detected ('%s')\n" % argv[i])
826827
raise SystemExit
828+
elif argv[i].startswith("--tamper"):
829+
if tamperIndex is None:
830+
tamperIndex = i if '=' in argv[i] else (i + 1 if i + 1 < len(argv) and not argv[i + 1].startswith('-') else None)
831+
else:
832+
argv[tamperIndex] = "%s,%s" % (argv[tamperIndex], argv[i].split('=')[1] if '=' in argv[i] else (argv[i + 1] if i + 1 < len(argv) and not argv[i + 1].startswith('-') else ""))
833+
argv[i] = ""
827834
elif argv[i] == "-H":
828835
if i + 1 < len(argv):
829836
extraHeaders.append(argv[i + 1])

txt/checksum.md5

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ c8c386d644d57c659d74542f5f57f632 lib/core/patch.py
5050
0c3eef46bdbf87e29a3f95f90240d192 lib/core/replication.py
5151
a7db43859b61569b601b97f187dd31c5 lib/core/revision.py
5252
fcb74fcc9577523524659ec49e2e964b lib/core/session.py
53-
d19e57fe2d2830703117b44a57f5922a lib/core/settings.py
53+
9f3052dd8ab94a3429f356d40dc263c1 lib/core/settings.py
5454
dd68a9d02fccb4fa1428b20e15b0db5d lib/core/shell.py
5555
a7edc9250d13af36ac0108f259859c19 lib/core/subprocessng.py
5656
62bc180e3e828949ffb342a8f756c183 lib/core/target.py
@@ -61,7 +61,7 @@ b35636650cfe721f5cc47fb91737c061 lib/core/update.py
6161
e772deb63270375e685fa5a7b775c382 lib/core/wordlist.py
6262
1e5532ede194ac9c083891c2f02bca93 lib/__init__.py
6363
7620f1f4b8791e13c7184c06b5421754 lib/parse/banner.py
64-
134bbbf67bb30c188b8409c0b3bfbc2a lib/parse/cmdline.py
64+
4296aee13e84a7394f2329dc7ea542ef lib/parse/cmdline.py
6565
fb2e2f05dde98caeac6ccf3e67192177 lib/parse/configfile.py
6666
3794ff139869f5ae8e81cfdbe5714f56 lib/parse/handler.py
6767
6bab53ea9d75bc9bb8169d3e8f3f149f lib/parse/headers.py

0 commit comments

Comments
 (0)