From 703b7079a47c69ebefd27ada38b303d9b181f250 Mon Sep 17 00:00:00 2001 From: Miroslav Stampar Date: Sat, 27 Oct 2018 14:30:28 +0200 Subject: [PATCH] Fixes #3319 --- lib/core/option.py | 9 +++++++++ lib/core/settings.py | 2 +- txt/checksum.md5 | 4 ++-- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/lib/core/option.py b/lib/core/option.py index 379eed0dd..1f37b48e9 100644 --- a/lib/core/option.py +++ b/lib/core/option.py @@ -1367,6 +1367,14 @@ def _setHTTPCookies(): conf.httpHeaders.append((HTTP_HEADER.COOKIE, conf.cookie)) +def _setHostname(): + """ + Set value conf.hostname + """ + + if conf.url: + conf.hostname = urlparse.urlsplit(conf.url).netloc.split(':')[0] + def _setHTTPTimeout(): """ Set the HTTP timeout @@ -2479,6 +2487,7 @@ def init(): parseTargetDirect() if any((conf.url, conf.logFile, conf.bulkFile, conf.sitemapUrl, conf.requestFile, conf.googleDork, conf.liveTest)): + _setHostname() _setHTTPTimeout() _setHTTPExtraHeaders() _setHTTPCookies() diff --git a/lib/core/settings.py b/lib/core/settings.py index 68d761779..69dd4a67e 100644 --- a/lib/core/settings.py +++ b/lib/core/settings.py @@ -19,7 +19,7 @@ from lib.core.enums import DBMS_DIRECTORY_NAME from lib.core.enums import OS # sqlmap version (...) -VERSION = "1.2.10.37" +VERSION = "1.2.10.38" TYPE = "dev" if VERSION.count('.') > 2 and VERSION.split('.')[-1] != '0' else "stable" TYPE_COLORS = {"dev": 33, "stable": 90, "pip": 34} VERSION_STRING = "sqlmap/%s#%s" % ('.'.join(VERSION.split('.')[:-1]) if VERSION.count('.') > 2 and VERSION.split('.')[-1] == '0' else VERSION, TYPE) diff --git a/txt/checksum.md5 b/txt/checksum.md5 index f823b9358..51d66d017 100644 --- a/txt/checksum.md5 +++ b/txt/checksum.md5 @@ -42,14 +42,14 @@ cada93357a7321655927fc9625b3bfec lib/core/exception.py 1e5532ede194ac9c083891c2f02bca93 lib/core/__init__.py 458a194764805cd8312c14ecd4be4d1e lib/core/log.py 7d6edc552e08c30f4f4d49fa93b746f1 lib/core/optiondict.py -18f33e43a09f5d682b92ca63baacd531 lib/core/option.py +d6dace6468ed5d2bbd500b0a244a9650 lib/core/option.py c8c386d644d57c659d74542f5f57f632 lib/core/patch.py 6783160150b4711d02c56ee2beadffdb lib/core/profiling.py 6f654e1715571eff68a0f8af3d62dcf8 lib/core/readlineng.py 0c3eef46bdbf87e29a3f95f90240d192 lib/core/replication.py a7db43859b61569b601b97f187dd31c5 lib/core/revision.py fcb74fcc9577523524659ec49e2e964b lib/core/session.py -07e1402306b18144c9a4d2e1e43ce9d0 lib/core/settings.py +dc1382ae6b5899619d11d972435c6bd2 lib/core/settings.py dd68a9d02fccb4fa1428b20e15b0db5d lib/core/shell.py a7edc9250d13af36ac0108f259859c19 lib/core/subprocessng.py 721198b5be72c8015a02acb116532a1f lib/core/target.py