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

Skip to content

Commit 519538a

Browse files
committed
Implements #3549
1 parent aa5645c commit 519538a

6 files changed

Lines changed: 15 additions & 1 deletion

File tree

lib/controller/controller.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -466,6 +466,8 @@ def start():
466466
skip |= (place == PLACE.COOKIE and intersect(PLACE.COOKIE, conf.skip, True) not in ([], None))
467467
skip |= (place == PLACE.HOST and intersect(PLACE.HOST, conf.skip, True) not in ([], None))
468468

469+
skip |= (conf.paramFilter and place.upper() not in conf.paramFilter)
470+
469471
skip &= not (place == PLACE.USER_AGENT and intersect(USER_AGENT_ALIASES, conf.testParameter, True))
470472
skip &= not (place == PLACE.REFERER and intersect(REFERER_ALIASES, conf.testParameter, True))
471473
skip &= not (place == PLACE.HOST and intersect(HOST_ALIASES, conf.testParameter, True))

lib/core/option.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1590,6 +1590,11 @@ def _cleanupOptions():
15901590
else:
15911591
conf.testParameter = []
15921592

1593+
if conf.paramFilter:
1594+
conf.paramFilter = [_.strip() for _ in re.split(PARAMETER_SPLITTING_REGEX, conf.paramFilter.upper())]
1595+
else:
1596+
conf.paramFilter = []
1597+
15931598
if conf.base64Parameter:
15941599
conf.base64Parameter = urldecode(conf.base64Parameter)
15951600
conf.base64Parameter = conf.base64Parameter.replace(" ", "")

lib/core/optiondict.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@
7979
"skip": "string",
8080
"skipStatic": "boolean",
8181
"paramExclude": "string",
82+
"paramFilter": "string",
8283
"dbms": "string",
8384
"dbmsCred": "string",
8485
"os": "string",

lib/core/settings.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
from thirdparty.six import unichr as _unichr
1919

2020
# sqlmap version (<major>.<minor>.<month>.<monthly commit>)
21-
VERSION = "1.3.5.102"
21+
VERSION = "1.3.5.103"
2222
TYPE = "dev" if VERSION.count('.') > 2 and VERSION.split('.')[-1] != '0' else "stable"
2323
TYPE_COLORS = {"dev": 33, "stable": 90, "pip": 34}
2424
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: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -261,6 +261,9 @@ def cmdLineParser(argv=None):
261261
injection.add_option("--param-exclude", dest="paramExclude",
262262
help="Regexp to exclude parameters from testing (e.g. \"ses\")")
263263

264+
injection.add_option("--param-filter", dest="paramFilter",
265+
help="Select testable parameter(s) by place (e.g. \"POST\")")
266+
264267
injection.add_option("--dbms", dest="dbms",
265268
help="Force back-end DBMS to provided value")
266269

sqlmap.conf

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,9 @@ skipStatic = False
245245
# Regexp to exclude parameters from testing (e.g. "ses").
246246
paramExclude =
247247

248+
# Select testable parameter(s) by place (e.g. "POST").
249+
paramFilter =
250+
248251
# Force back-end DBMS to provided value. If this option is set, the back-end
249252
# DBMS identification process will be minimized as needed.
250253
# If not set, sqlmap will detect back-end DBMS automatically by default.

0 commit comments

Comments
 (0)