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

Skip to content

Commit 57f1779

Browse files
committed
Adding support for all_proxy (#91)
1 parent 7a0a4c2 commit 57f1779

2 files changed

Lines changed: 11 additions & 1 deletion

File tree

lib/core/option.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1759,6 +1759,13 @@ class _(six.text_type):
17591759
conf.binaryFields = conf.binaryFields.replace(" ", "")
17601760
conf.binaryFields = re.split(PARAMETER_SPLITTING_REGEX, conf.binaryFields)
17611761

1762+
envProxy = max(os.environ.get(_, "") for _ in ("all_proxy", "ALL_PROXY", "http_proxy", "HTTP_PROXY", "https_proxy", "HTTPS_PROXY"))
1763+
if re.search(r"\A(https?|socks[45])://.+:\d+\Z", envProxy) and conf.proxy is None:
1764+
debugMsg = "using environment proxy '%s'" % envProxy
1765+
logger.debug(debugMsg)
1766+
1767+
conf.proxy = envProxy
1768+
17621769
if any((conf.proxy, conf.proxyFile, conf.tor)):
17631770
conf.disablePrecon = True
17641771

lib/core/settings.py

Lines changed: 4 additions & 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.4.1.10"
21+
VERSION = "1.4.1.11"
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)
@@ -486,6 +486,9 @@
486486
# Prefix for configuration overriding environment variables
487487
SQLMAP_ENVIRONMENT_PREFIX = "SQLMAP_"
488488

489+
# General OS environment variables that can be used for setting proxy address
490+
PROXY_ENVIRONMENT_VARIABLES = ("all_proxy", "ALL_PROXY", "http_proxy", "HTTP_PROXY", "https_proxy", "HTTPS_PROXY")
491+
489492
# Turn off resume console info to avoid potential slowdowns
490493
TURN_OFF_RESUME_INFO_LIMIT = 20
491494

0 commit comments

Comments
 (0)