From 0c5965c7b8d309902e6753a14ca689e232a8ff34 Mon Sep 17 00:00:00 2001 From: Miroslav Stampar Date: Tue, 19 Apr 2016 13:13:37 +0200 Subject: [PATCH] Minor patches --- lib/core/convert.py | 1 - lib/core/settings.py | 3 +-- lib/core/wordlist.py | 1 - lib/techniques/blind/inference.py | 5 ----- lib/utils/search.py | 3 --- plugins/generic/databases.py | 8 ++++++++ tamper/commalesslimit.py | 2 -- tamper/escapequotes.py | 3 --- 8 files changed, 9 insertions(+), 17 deletions(-) diff --git a/lib/core/convert.py b/lib/core/convert.py index dbcbb233b..9e88d3e73 100644 --- a/lib/core/convert.py +++ b/lib/core/convert.py @@ -11,7 +11,6 @@ import pickle import re import StringIO import sys -import types from lib.core.settings import IS_WIN from lib.core.settings import UNICODE_ENCODING diff --git a/lib/core/settings.py b/lib/core/settings.py index daaa803a0..4799bcf4e 100644 --- a/lib/core/settings.py +++ b/lib/core/settings.py @@ -10,7 +10,6 @@ import re import subprocess import string import sys -import time import types from lib.core.datatype import AttribDict @@ -20,7 +19,7 @@ from lib.core.enums import OS from lib.core.revision import getRevisionNumber # sqlmap version (...) -VERSION = "1.0.4.19" +VERSION = "1.0.4.20" REVISION = getRevisionNumber() STABLE = VERSION.count('.') <= 2 VERSION_STRING = "sqlmap/%s#%s" % (VERSION, "stable" if STABLE else "dev") diff --git a/lib/core/wordlist.py b/lib/core/wordlist.py index 13e763b17..2ba368777 100644 --- a/lib/core/wordlist.py +++ b/lib/core/wordlist.py @@ -11,7 +11,6 @@ import zipfile from lib.core.common import getSafeExString from lib.core.exception import SqlmapDataException from lib.core.exception import SqlmapInstallationException -from lib.core.settings import UNICODE_ENCODING class Wordlist(object): """ diff --git a/lib/techniques/blind/inference.py b/lib/techniques/blind/inference.py index 41b54d7ca..20a96474e 100644 --- a/lib/techniques/blind/inference.py +++ b/lib/techniques/blind/inference.py @@ -5,11 +5,9 @@ Copyright (c) 2006-2016 sqlmap developers (http://sqlmap.org/) See the file 'doc/COPYING' for copying permission """ -import re import threading import time -from extra.safe2bin.safe2bin import safechardecode from extra.safe2bin.safe2bin import safecharencode from lib.core.agent import agent from lib.core.common import Backend @@ -20,13 +18,11 @@ from lib.core.common import decodeIntToUnicode from lib.core.common import filterControlChars from lib.core.common import getCharset from lib.core.common import getCounter -from lib.core.common import getUnicode from lib.core.common import goGoodSamaritan from lib.core.common import getPartRun from lib.core.common import hashDBRetrieve from lib.core.common import hashDBWrite from lib.core.common import incrementCounter -from lib.core.common import randomInt from lib.core.common import safeStringFormat from lib.core.common import singleTimeWarnMessage from lib.core.data import conf @@ -44,7 +40,6 @@ from lib.core.settings import INFERENCE_UNKNOWN_CHAR from lib.core.settings import INFERENCE_GREATER_CHAR from lib.core.settings import INFERENCE_EQUALS_CHAR from lib.core.settings import INFERENCE_NOT_EQUALS_CHAR -from lib.core.settings import MIN_TIME_RESPONSES from lib.core.settings import MAX_BISECTION_LENGTH from lib.core.settings import MAX_TIME_REVALIDATION_STEPS from lib.core.settings import NULL diff --git a/lib/utils/search.py b/lib/utils/search.py index 116b3cb01..1f54deac1 100644 --- a/lib/utils/search.py +++ b/lib/utils/search.py @@ -5,7 +5,6 @@ Copyright (c) 2006-2016 sqlmap developers (http://sqlmap.org/) See the file 'doc/COPYING' for copying permission """ -import cookielib import httplib import re import socket @@ -26,7 +25,6 @@ from lib.core.enums import HTTP_HEADER from lib.core.enums import REDIRECTION from lib.core.exception import SqlmapBaseException from lib.core.exception import SqlmapConnectionException -from lib.core.exception import SqlmapGenericException from lib.core.exception import SqlmapUserQuitException from lib.core.settings import DUMMY_SEARCH_USER_AGENT from lib.core.settings import DUCKDUCKGO_REGEX @@ -35,7 +33,6 @@ from lib.core.settings import GOOGLE_REGEX from lib.core.settings import HTTP_ACCEPT_ENCODING_HEADER_VALUE from lib.core.settings import UNICODE_ENCODING from lib.request.basic import decodePage -from lib.request.httpshandler import HTTPSHandler from thirdparty.socks import socks diff --git a/plugins/generic/databases.py b/plugins/generic/databases.py index d35ff8b7a..a242463a4 100644 --- a/plugins/generic/databases.py +++ b/plugins/generic/databases.py @@ -572,7 +572,11 @@ class Databases: query = _.query % (unsafeSQLIdentificatorNaming(conf.db.upper()), unsafeSQLIdentificatorNaming(tbl.upper()), unsafeSQLIdentificatorNaming(name.upper())) else: query = _.query % (unsafeSQLIdentificatorNaming(conf.db), unsafeSQLIdentificatorNaming(tbl), unsafeSQLIdentificatorNaming(name)) + comment = unArrayizeValue(inject.getValue(query, blind=False, time=False)) + if not isNoneValue(comment): + infoMsg = "retrieved comment '%s' for column '%s'" % (comment, name) + logger.info(infoMsg) else: warnMsg = "on %s it is not " % Backend.getIdentifiedDbms() warnMsg += "possible to get column comments" @@ -702,7 +706,11 @@ class Databases: query = _.query % (unsafeSQLIdentificatorNaming(conf.db.upper()), unsafeSQLIdentificatorNaming(tbl.upper()), unsafeSQLIdentificatorNaming(column.upper())) else: query = _.query % (unsafeSQLIdentificatorNaming(conf.db), unsafeSQLIdentificatorNaming(tbl), unsafeSQLIdentificatorNaming(column)) + comment = unArrayizeValue(inject.getValue(query, union=False, error=False)) + if not isNoneValue(comment): + infoMsg = "retrieved comment '%s' for column '%s'" % (comment, column) + logger.info(infoMsg) else: warnMsg = "on %s it is not " % Backend.getIdentifiedDbms() warnMsg += "possible to get column comments" diff --git a/tamper/commalesslimit.py b/tamper/commalesslimit.py index 570c2ebdf..5f3e60411 100644 --- a/tamper/commalesslimit.py +++ b/tamper/commalesslimit.py @@ -5,10 +5,8 @@ Copyright (c) 2006-2016 sqlmap developers (http://sqlmap.org/) See the file 'doc/COPYING' for copying permission """ -import os import re -from lib.core.common import singleTimeWarnMessage from lib.core.enums import PRIORITY __priority__ = PRIORITY.HIGH diff --git a/tamper/escapequotes.py b/tamper/escapequotes.py index 5a3acadfb..714c34ccd 100644 --- a/tamper/escapequotes.py +++ b/tamper/escapequotes.py @@ -5,10 +5,7 @@ Copyright (c) 2006-2016 sqlmap developers (http://sqlmap.org/) See the file 'doc/COPYING' for copying permission """ -import base64 - from lib.core.enums import PRIORITY -from lib.core.settings import UNICODE_ENCODING __priority__ = PRIORITY.LOWEST