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

Skip to content

Commit 6bedb80

Browse files
committed
adding --force-ssl switch (most useful in combination with -r)
1 parent 11887f3 commit 6bedb80

4 files changed

Lines changed: 10 additions & 1 deletion

File tree

lib/core/common.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1268,7 +1268,7 @@ def parseTargetUrl():
12681268
__urlSplit = urlparse.urlsplit(conf.url)
12691269
__hostnamePort = __urlSplit[1].split(":")
12701270

1271-
conf.scheme = __urlSplit[0].strip()
1271+
conf.scheme = __urlSplit[0].strip() if not conf.forceSSL else "https"
12721272
conf.path = __urlSplit[2].strip()
12731273
conf.hostname = __hostnamePort[0].strip()
12741274

lib/core/optiondict.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
"agent": "string",
3232
"randomAgent": "boolean",
3333
"rParam": "string",
34+
"forceSSL": "boolean",
3435
"host": "string",
3536
"referer": "string",
3637
"headers": "string",

lib/parse/cmdline.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,10 @@ def cmdLineParser():
9292
request.add_option("--randomize", dest="rParam",
9393
help="Randomly change value for given parameter(s)")
9494

95+
request.add_option("--force-ssl", dest="forceSSL",
96+
action="store_true",
97+
help="Force usage of SSL/HTTPS requests")
98+
9599
request.add_option("--host", dest="host",
96100
help="HTTP Host header")
97101

sqlmap.conf

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,10 @@ referer =
6969
# Randomly change value for the given parameter
7070
rParam =
7171

72+
# Force usage of SSL/HTTPS requests
73+
# Valid: True or False
74+
forceSSL = False
75+
7276
# Extra HTTP headers
7377
headers = Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
7478
Accept-Language: en-us,en;q=0.5

0 commit comments

Comments
 (0)