From 0a8bc52910d7dbcda9c8ddca7e4bdf88ca83b8aa Mon Sep 17 00:00:00 2001 From: Miroslav Stampar Date: Wed, 31 Jan 2018 11:13:08 +0100 Subject: [PATCH] Minor updates --- lib/core/option.py | 5 +++-- lib/core/settings.py | 2 +- lib/utils/api.py | 1 - plugins/dbms/mysql/filesystem.py | 9 ++++----- txt/checksum.md5 | 8 ++++---- 5 files changed, 12 insertions(+), 13 deletions(-) diff --git a/lib/core/option.py b/lib/core/option.py index 13b1103d4..ae27ae60a 100644 --- a/lib/core/option.py +++ b/lib/core/option.py @@ -1046,7 +1046,7 @@ def _setSocketPreConnect(): if conf.disablePrecon: return - def _(): + def _thread(): while kb.get("threadContinue") and not conf.get("disablePrecon"): try: for key in socket._ready: @@ -1078,6 +1078,7 @@ def _setSocketPreConnect(): break else: try: + candidate.shutdown(socket.SHUT_RDWR) candidate.close() except socket.error: pass @@ -1090,7 +1091,7 @@ def _setSocketPreConnect(): socket.socket._connect = socket.socket.connect socket.socket.connect = connect - thread = threading.Thread(target=_) + thread = threading.Thread(target=_thread) setDaemon(thread) thread.start() diff --git a/lib/core/settings.py b/lib/core/settings.py index e0b9fe015..e7c146c20 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.1.21" +VERSION = "1.2.1.22" 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/lib/utils/api.py b/lib/utils/api.py index 5aea6ae2b..28f0a6c26 100644 --- a/lib/utils/api.py +++ b/lib/utils/api.py @@ -45,7 +45,6 @@ from lib.core.settings import RESTAPI_DEFAULT_ADDRESS from lib.core.settings import RESTAPI_DEFAULT_PORT from lib.core.subprocessng import Popen from lib.parse.cmdline import cmdLineParser -from thirdparty.bottle.bottle import abort from thirdparty.bottle.bottle import error as return_error from thirdparty.bottle.bottle import get from thirdparty.bottle.bottle import hook diff --git a/plugins/dbms/mysql/filesystem.py b/plugins/dbms/mysql/filesystem.py index cebeca56b..d28d12312 100644 --- a/plugins/dbms/mysql/filesystem.py +++ b/plugins/dbms/mysql/filesystem.py @@ -68,14 +68,13 @@ class Filesystem(GenericFilesystem): raise SqlmapNoneDataException(warnMsg) else: length = int(length) - sustrLen = 1024 + chunkSize = 1024 - if length > sustrLen: + if length > chunkSize: result = [] - for i in xrange(1, length, sustrLen): - chunk = inject.getValue("SELECT MID(%s, %d, %d) FROM %s" % (self.tblField, i, sustrLen, self.fileTblName), unpack=False, resumeValue=False, charsetType=CHARSET_TYPE.HEXADECIMAL) - + for i in xrange(1, length, chunkSize): + chunk = inject.getValue("SELECT MID(%s, %d, %d) FROM %s" % (self.tblField, i, chunkSize, self.fileTblName), unpack=False, resumeValue=False, charsetType=CHARSET_TYPE.HEXADECIMAL) result.append(chunk) else: result = inject.getValue("SELECT %s FROM %s" % (self.tblField, self.fileTblName), resumeValue=False, charsetType=CHARSET_TYPE.HEXADECIMAL) diff --git a/txt/checksum.md5 b/txt/checksum.md5 index a9c50c748..1eb37c21c 100644 --- a/txt/checksum.md5 +++ b/txt/checksum.md5 @@ -40,13 +40,13 @@ cada93357a7321655927fc9625b3bfec lib/core/exception.py 1e5532ede194ac9c083891c2f02bca93 lib/core/__init__.py 458a194764805cd8312c14ecd4be4d1e lib/core/log.py 9eed2d4d370f375bda5e0c0488740e7f lib/core/optiondict.py -ac01954e9881b5ba6e41b85e6c08bd9a lib/core/option.py +598863f3b058650c17f465b16892dc67 lib/core/option.py 7dadbb9a301d40cc8cd9c7491e99b43d lib/core/profiling.py ffa5f01f39b17c8d73423acca6cfe86a lib/core/readlineng.py 0c3eef46bdbf87e29a3f95f90240d192 lib/core/replication.py a7db43859b61569b601b97f187dd31c5 lib/core/revision.py fcb74fcc9577523524659ec49e2e964b lib/core/session.py -4f27b5c4801cad5c6b8361f953a4f313 lib/core/settings.py +7fc35bef60750c8ba2475c154d7d481c lib/core/settings.py d0adc28a38e43a787df4471f7f027413 lib/core/shell.py 63491be462c515a1a3880c27c2acc4a2 lib/core/subprocessng.py 505aaa61e1bba3c3d4567c3e667699e3 lib/core/target.py @@ -98,7 +98,7 @@ f6844893afa7569052529e1c8d89bc35 lib/techniques/blind/inference.py 1e5532ede194ac9c083891c2f02bca93 lib/techniques/union/__init__.py c497003ecf231d03a311a816a6b3b753 lib/techniques/union/test.py 6c3c4c7d43ad75e61a73184323a81eac lib/techniques/union/use.py -918d6f34c415c578c2eae8730f555ae8 lib/utils/api.py +e4146464cf968d4015a52cb8c10e3da5 lib/utils/api.py 37dfb641358669f62c2acedff241348b lib/utils/brute.py 8f2f246d17f5891a2e584533bd18e65c lib/utils/crawler.py 985c737cd8a6a722160c55cf5ee224f4 lib/utils/deps.py @@ -168,7 +168,7 @@ affef90b1442285da7e89e46603c502e plugins/dbms/mssqlserver/__init__.py b9e62a80bd3ead133a511f9769e5e6c3 plugins/dbms/mssqlserver/takeover.py f6e1f3f09f32b9cb2ca11c016d373423 plugins/dbms/mysql/connector.py 445164daf59b890aeacc968af58fcb53 plugins/dbms/mysql/enumeration.py -d6836e2a6a308eb3536e2e7fc74fdc8b plugins/dbms/mysql/filesystem.py +f36e09edc3eafedd989fbe44ec048e71 plugins/dbms/mysql/filesystem.py 2bfd2369aebe2999f7333cca0895507c plugins/dbms/mysql/fingerprint.py 88b876f085fec2569a0697f4b69f41da plugins/dbms/mysql/__init__.py 0e2adbee217f5b94dcc124d24b8dde99 plugins/dbms/mysql/syntax.py