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

Skip to content

Commit d58ba7e

Browse files
committed
added --scope feature regarding Feature #105
1 parent f316e72 commit d58ba7e

4 files changed

Lines changed: 16 additions & 3 deletions

File tree

lib/core/option.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,10 @@ def __feedTargetsDict(reqFile, addedTargetUrls):
162162
elif method is not None and method == "POST" and "=" in line:
163163
data = line
164164
params = True
165-
165+
166+
if conf.scope:
167+
getPostReq &= re.search(conf.scope, host) is not None
168+
166169
if getPostReq and params:
167170
if not url.startswith("http"):
168171
url = "%s://%s:%s%s" % (scheme or "http", host, port or "80", url)

lib/core/optiondict.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,9 @@
4545
"proxy": "string",
4646
"threads": "integer",
4747
"delay": "float",
48-
"timeout": "float"
48+
"timeout": "float",
49+
"retries": "integer",
50+
"scope": "string"
4951
},
5052

5153
"Injection": {
@@ -63,6 +65,7 @@
6365
"Techniques": {
6466
"stackedTest": "boolean",
6567
"timeTest": "boolean",
68+
"timesec": "integer",
6669
"unionTest": "boolean",
6770
"uTech": "string",
6871
"unionUse": "boolean"

lib/parse/cmdline.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,9 @@ def cmdLineParser():
117117
request.add_option("--retries", dest="retries", type="int", default=3,
118118
help="Retries when the connection timeouts "
119119
"(default 3)")
120+
request.add_option("--scope", dest="scope",
121+
help="Regex expression for filtering targets "
122+
"from provided Burp or WebScarab log")
120123

121124
# Injection options
122125
injection = OptionGroup(parser, "Injection", "These options can be "

sqlmap.conf

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,10 @@ timeout = 30
9595
# Default: 3
9696
retries = 3
9797

98+
# Regex expression for filtering targets
99+
# from provided Burp or WebScarab log (e.g. (google|yahoo))
100+
scope = None
101+
98102

99103
[Injection]
100104

@@ -415,4 +419,4 @@ cleanup = False
415419
# 4: Show also HTTP responses headers
416420
# 5: Show also HTTP responses page content
417421
# Default: 1
418-
verbose = 1
422+
verbose = 1

0 commit comments

Comments
 (0)