From 71208e891c856552ac1b6abfd01189fb35a771b7 Mon Sep 17 00:00:00 2001 From: Miroslav Stampar Date: Thu, 27 Sep 2018 09:15:53 +0200 Subject: [PATCH] Update regarding #3258 --- lib/core/settings.py | 2 +- lib/utils/versioncheck.py | 3 +- sqlmap.py | 60 +++++++++++++++++++++------------------ txt/checksum.md5 | 6 ++-- 4 files changed, 38 insertions(+), 33 deletions(-) diff --git a/lib/core/settings.py b/lib/core/settings.py index a855f3eb0..355459dd1 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.9.40" +VERSION = "1.2.9.41" 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/versioncheck.py b/lib/utils/versioncheck.py index f57ea0682..c78b69545 100644 --- a/lib/utils/versioncheck.py +++ b/lib/utils/versioncheck.py @@ -6,11 +6,12 @@ See the file 'LICENSE' for copying permission """ import sys +import time PYVERSION = sys.version.split()[0] if PYVERSION >= "3" or PYVERSION < "2.6": - exit("[CRITICAL] incompatible Python version detected ('%s'). To successfully run sqlmap you'll have to use version 2.6.x or 2.7.x (visit 'https://www.python.org/downloads/')" % PYVERSION) + exit("[%s] [CRITICAL] incompatible Python version detected ('%s'). To successfully run sqlmap you'll have to use version 2.6.x or 2.7.x (visit 'https://www.python.org/downloads/')" % (time.strftime("%X"), PYVERSION)) errors = [] extensions = ("bz2", "gzip", "pyexpat", "ssl", "sqlite3", "zlib") diff --git a/sqlmap.py b/sqlmap.py index f64e5e9ff..31410a11f 100755 --- a/sqlmap.py +++ b/sqlmap.py @@ -5,37 +5,37 @@ Copyright (c) 2006-2018 sqlmap developers (http://sqlmap.org/) See the file 'LICENSE' for copying permission """ -import sys - -sys.dont_write_bytecode = True - try: - __import__("lib.utils.versioncheck") # this has to be the first non-standard import -except ImportError: - exit("[!] wrong installation detected (missing modules). Visit 'https://github.com/sqlmapproject/sqlmap/#installation' for further details") + import sys -import bdb -import distutils -import glob -import inspect -import json -import logging -import os -import re -import shutil -import sys -import thread -import threading -import time -import traceback -import warnings + sys.dont_write_bytecode = True -warnings.filterwarnings(action="ignore", message=".*was already imported", category=UserWarning) -warnings.filterwarnings(action="ignore", category=DeprecationWarning) + try: + __import__("lib.utils.versioncheck") # this has to be the first non-standard import + except ImportError: + exit("[!] wrong installation detected (missing modules). Visit 'https://github.com/sqlmapproject/sqlmap/#installation' for further details") -from lib.core.data import logger + import bdb + import distutils + import glob + import inspect + import json + import logging + import os + import re + import shutil + import sys + import thread + import threading + import time + import traceback + import warnings + + warnings.filterwarnings(action="ignore", message=".*was already imported", category=UserWarning) + warnings.filterwarnings(action="ignore", category=DeprecationWarning) + + from lib.core.data import logger -try: from lib.core.common import banner from lib.core.common import checkIntegrity from lib.core.common import createGithubIssue @@ -67,9 +67,13 @@ try: from lib.parse.cmdline import cmdLineParser except KeyboardInterrupt: errMsg = "user aborted" - logger.error(errMsg) - raise SystemExit + if "logger" in globals(): + logger.error(errMsg) + raise SystemExit + else: + import time + exit("\r[%s] [ERROR] %s" % (time.strftime("%X"), errMsg)) def modulePath(): """ diff --git a/txt/checksum.md5 b/txt/checksum.md5 index 5ee23611f..6abbdd545 100644 --- a/txt/checksum.md5 +++ b/txt/checksum.md5 @@ -50,7 +50,7 @@ c8c386d644d57c659d74542f5f57f632 lib/core/patch.py 0c3eef46bdbf87e29a3f95f90240d192 lib/core/replication.py a7db43859b61569b601b97f187dd31c5 lib/core/revision.py fcb74fcc9577523524659ec49e2e964b lib/core/session.py -495854418b62c5ad47ae1eb0ac891976 lib/core/settings.py +59274b9acea517616aed86e58808e02d lib/core/settings.py dd68a9d02fccb4fa1428b20e15b0db5d lib/core/shell.py a7edc9250d13af36ac0108f259859c19 lib/core/subprocessng.py 62bc180e3e828949ffb342a8f756c183 lib/core/target.py @@ -118,7 +118,7 @@ d0f4d56c5d6a09a4635035e233d4a782 lib/utils/hash.py 2c5a655c8e94cbe2664ee497752ac1f2 lib/utils/search.py 571884f530796534f03c49cf3f380a4c lib/utils/sqlalchemy.py dcc25183c6bd85b172c87cfcbc305ab6 lib/utils/timeout.py -faa7536c4788ee118b19338f3e98e556 lib/utils/versioncheck.py +4703ceeb32131a9a7a6561575644123b lib/utils/versioncheck.py e9e73cd6bd814dd7823a9da913cea61c lib/utils/xrange.py b9d2761f47fec3d98b88311a263fd5db plugins/dbms/access/connector.py 3f1c50a1507d1c2f69c20c706230e2e2 plugins/dbms/access/enumeration.py @@ -228,7 +228,7 @@ ec2ba8c757ac96425dcd2b97970edd3a shell/stagers/stager.asp_ 0c48ddb1feb7e38a951ef05a0d48e032 shell/stagers/stager.jsp_ 2f9e459a4cf6a58680978cdce5ff7971 shell/stagers/stager.php_ cd90da0474d7b1a67d7b40d208493375 sqlmapapi.py -a35b5b83c12841fdf3925190c9d24299 sqlmap.py +5f30815ebe320e46e5898dc819e629a7 sqlmap.py 523dab9e1093eb59264c6beb366b255a tamper/0x2char.py 3a1697585ae4e7bf315e9dda97d6f321 tamper/apostrophemask.py d7a119a74be9b385ee3884fb5e6af041 tamper/apostrophenullencode.py