From c0820679026c88d9894eaaafbec0137fbc65e2a6 Mon Sep 17 00:00:00 2001 From: Miroslav Stampar Date: Fri, 10 Jan 2020 11:44:24 +0100 Subject: [PATCH] Removing some dead code (vulture) --- lib/controller/checks.py | 2 -- lib/core/common.py | 11 ----------- lib/core/dump.py | 3 --- lib/core/settings.py | 2 +- lib/utils/hash.py | 12 ------------ plugins/generic/enumeration.py | 1 - 6 files changed, 1 insertion(+), 30 deletions(-) diff --git a/lib/controller/checks.py b/lib/controller/checks.py index dab1609ff..a26a2e652 100644 --- a/lib/controller/checks.py +++ b/lib/controller/checks.py @@ -519,8 +519,6 @@ def checkSqlInjection(place, parameter, value): except (MemoryError, OverflowError): pass - kb.prevFalsePage = falsePage - # Perform the test's True request trueResult = Request.queryPage(reqPayload, place, raise404=False) truePage, trueHeaders, trueCode = threadData.lastComparisonPage or "", threadData.lastComparisonHeaders, threadData.lastComparisonCode diff --git a/lib/core/common.py b/lib/core/common.py index 1c7e98f1d..8517f47f8 100644 --- a/lib/core/common.py +++ b/lib/core/common.py @@ -1377,7 +1377,6 @@ def setPaths(rootPath): paths.SQLMAP_EXTRAS_PATH = os.path.join(paths.SQLMAP_ROOT_PATH, "extra") paths.SQLMAP_SETTINGS_PATH = os.path.join(paths.SQLMAP_ROOT_PATH, "lib", "core", "settings.py") paths.SQLMAP_TAMPER_PATH = os.path.join(paths.SQLMAP_ROOT_PATH, "tamper") - paths.SQLMAP_WAF_PATH = os.path.join(paths.SQLMAP_ROOT_PATH, "waf") paths.SQLMAP_PROCS_PATH = os.path.join(paths.SQLMAP_DATA_PATH, "procs") paths.SQLMAP_SHELL_PATH = os.path.join(paths.SQLMAP_DATA_PATH, "shell") @@ -2319,16 +2318,6 @@ def readCachedFileContent(filename, mode="rb"): return kb.cache.content[filename] -def readXmlFile(xmlFile): - """ - Reads XML file content and returns its DOM representation - """ - - checkFile(xmlFile) - retVal = minidom.parse(xmlFile).documentElement - - return retVal - def average(values): """ Computes the arithmetic mean of a list of numbers. diff --git a/lib/core/dump.py b/lib/core/dump.py index e76b60c67..986e8be79 100644 --- a/lib/core/dump.py +++ b/lib/core/dump.py @@ -107,9 +107,6 @@ class Dump(object): errMsg = "error occurred while opening log file ('%s')" % getSafeExString(ex) raise SqlmapGenericException(errMsg) - def getOutputFile(self): - return self._outputFile - def singleString(self, data, content_type=None): self._write(data, content_type=content_type) diff --git a/lib/core/settings.py b/lib/core/settings.py index c4cdb368f..fa0bb63a3 100644 --- a/lib/core/settings.py +++ b/lib/core/settings.py @@ -18,7 +18,7 @@ from lib.core.enums import OS from thirdparty.six import unichr as _unichr # sqlmap version (...) -VERSION = "1.4.1.22" +VERSION = "1.4.1.23" 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/hash.py b/lib/utils/hash.py index 0779d6ca7..19b6b021a 100644 --- a/lib/utils/hash.py +++ b/lib/utils/hash.py @@ -248,18 +248,6 @@ def oracle_old_passwd(password, username, uppercase=True): # prior to version ' return retVal.upper() if uppercase else retVal.lower() -def md4_generic_passwd(password, uppercase=False): - """ - >>> md4_generic_passwd(password='testpass', uppercase=False) - '5b4d300688f19c8fd65b8d6ccf98e0ae' - """ - - password = getBytes(password) - - retVal = hashlib.new("md4", password).hexdigest() - - return retVal.upper() if uppercase else retVal.lower() - def md5_generic_passwd(password, uppercase=False): """ >>> md5_generic_passwd(password='testpass', uppercase=False) diff --git a/plugins/generic/enumeration.py b/plugins/generic/enumeration.py index d5b35b7e0..affeb3f3e 100644 --- a/plugins/generic/enumeration.py +++ b/plugins/generic/enumeration.py @@ -31,7 +31,6 @@ class Enumeration(Custom, Databases, Entries, Search, Users): kb.data.banner = None kb.data.hostname = "" kb.data.processChar = None - kb.data.characterSet = None Custom.__init__(self) Databases.__init__(self)