Skip to content

Commit 2a754ee

Browse files
committed
Adding switch --ignore-redirects (Issue #2286)
1 parent 4e1bdb0 commit 2a754ee

File tree

6 files changed

+14
-6
lines changed

6 files changed

+14
-6
lines changed

lib/core/optiondict.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
"authFile": "string",
4141
"ignore401": "boolean",
4242
"ignoreProxy": "boolean",
43+
"ignoreRedirects": "boolean",
4344
"ignoreTimeouts": "boolean",
4445
"proxy": "string",
4546
"proxyCred": "string",

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.0.11.15"
22+
VERSION = "1.0.11.16"
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: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,9 @@ def cmdLineParser(argv=None):
155155
request.add_option("--ignore-proxy", dest="ignoreProxy", action="store_true",
156156
help="Ignore system default proxy settings")
157157

158+
request.add_option("--ignore-redirects", dest="ignoreRedirects", action="store_true",
159+
help="Ignore redirection attempts")
160+
158161
request.add_option("--ignore-timeouts", dest="ignoreTimeouts", action="store_true",
159162
help="Ignore connection timeouts")
160163

lib/request/redirecthandler.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ def _redirect_request(self, req, fp, code, msg, headers, newurl):
7171

7272
def http_error_302(self, req, fp, code, msg, headers):
7373
content = None
74-
redurl = self._get_header_redirect(headers)
74+
redurl = self._get_header_redirect(headers) if not conf.ignoreRedirects else None
7575

7676
try:
7777
content = fp.read(MAX_CONNECTION_TOTAL_SIZE)

sqlmap.conf

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,10 @@ ignore401 = False
106106
# Valid: True or False
107107
ignoreProxy = False
108108

109+
# Ignore redirection attempts.
110+
# Valid: True or False
111+
ignoreRedirects = False
112+
109113
# Ignore connection timeouts.
110114
# Valid: True or False
111115
ignoreTimeouts = False

txt/checksum.md5

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,14 +38,14 @@ b218e03ef7426fb0414881b05add1092 lib/core/enums.py
3838
e4aec2b11c1ad6039d0c3dbbfbc5eb1a lib/core/exception.py
3939
cc9c82cfffd8ee9b25ba3af6284f057e lib/core/__init__.py
4040
91c514013daa796e2cdd940389354eac lib/core/log.py
41-
d027df65e7cbb99758daf77aaa6ab61c lib/core/optiondict.py
41+
86c86d2ee9e0eb74b13c16797b7dfc51 lib/core/optiondict.py
4242
eb5e96b4baef52ad172e0359c1783d83 lib/core/option.py
4343
7af487340c138f7b5dbd443161cbb428 lib/core/profiling.py
4444
e60456db5380840a586654344003d4e6 lib/core/readlineng.py
4545
b3a62d41a5af6cd7fa733b6227febb0c lib/core/replication.py
4646
99a2b496b9d5b546b335653ca801153f lib/core/revision.py
4747
7c15dd2777af4dac2c89cab6df17462e lib/core/session.py
48-
d318ccb3fe404d6cf646e0cfe6d90f6d lib/core/settings.py
48+
7f04f7e55179f45470b137dbb15657c6 lib/core/settings.py
4949
7af83e4f18cab6dff5e67840eb65be80 lib/core/shell.py
5050
23657cd7d924e3c6d225719865855827 lib/core/subprocessng.py
5151
c3ace7874a536d801f308cf1fd03df99 lib/core/target.py
@@ -56,7 +56,7 @@ d43f059747ffd48952922c94152e2a07 lib/core/testing.py
5656
8485a3cd94c0a5af2718bad60c5f1ae5 lib/core/wordlist.py
5757
cc9c82cfffd8ee9b25ba3af6284f057e lib/__init__.py
5858
c1288bc4ce5651dbdd82d4a9435fdc03 lib/parse/banner.py
59-
39c07b707916d99a75a2c7622785dc13 lib/parse/cmdline.py
59+
ba4c9a57e87f54c647ca29a14fa82f9c lib/parse/cmdline.py
6060
8ec4d4f02634834701f8258726f2e511 lib/parse/configfile.py
6161
fe4e2152292587928edb94c9a4d311ff lib/parse/handler.py
6262
8e6bfb13e5a34b2610f3ff23467a34cf lib/parse/headers.py
@@ -76,7 +76,7 @@ cc9c82cfffd8ee9b25ba3af6284f057e lib/request/__init__.py
7676
3fc323d525beddd14cd4d4dca4934fa8 lib/request/methodrequest.py
7777
585a6705cfac79f795b835affb80c901 lib/request/pkihandler.py
7878
b2ffd261947994f4a4af555d468b4970 lib/request/rangehandler.py
79-
53eede2efbfabc7315ea99756a03f49d lib/request/redirecthandler.py
79+
30eda640dc427585c3dbf4762a30bd38 lib/request/redirecthandler.py
8080
4d838b086f128a94a91aa293ca1e0719 lib/request/templates.py
8181
937b7e276f25ccac5a2ac0bf9b1ef434 lib/takeover/abstraction.py
8282
3ecf028d8d93025d2a12c6f6fc13adb2 lib/takeover/icmpsh.py

0 commit comments

Comments
 (0)