This commit is contained in:
Miroslav Stampar 2020-12-25 23:24:59 +01:00
parent 99e6d56f09
commit 8c8aae9170
4 changed files with 9 additions and 6 deletions

View File

@ -12,6 +12,7 @@ import codecs
import collections
import contextlib
import copy
import distutils.version
import functools
import getpass
import hashlib
@ -586,7 +587,7 @@ class Backend(object):
@staticmethod
def isVersionGreaterOrEqualThan(version):
return Backend.getVersion() is not None and str(Backend.getVersion()) >= str(version)
return Backend.getVersion() is not None and version is not None and distutils.version.LooseVersion(str(Backend.getVersion()) or ' ') >= distutils.version.LooseVersion(str(version) or ' ')
@staticmethod
def isOs(os):

View File

@ -18,7 +18,7 @@ from lib.core.enums import OS
from thirdparty.six import unichr as _unichr
# sqlmap version (<major>.<minor>.<month>.<monthly commit>)
VERSION = "1.4.12.34"
VERSION = "1.4.12.35"
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)

View File

@ -5,6 +5,7 @@ Copyright (c) 2006-2020 sqlmap developers (http://sqlmap.org/)
See the file 'LICENSE' for copying permission
"""
import distutils.version
import os
from lib.core.agent import agent
@ -37,13 +38,13 @@ class Takeover(GenericTakeover):
banVer = kb.bannerFp["dbmsVersion"]
if banVer >= "5.0.67":
if distutils.version.LooseVersion(banVer) >= distutils.version.LooseVersion("5.0.67"):
if self.__plugindir is None:
logger.info("retrieving MySQL plugin directory absolute path")
self.__plugindir = unArrayizeValue(inject.getValue("SELECT @@plugin_dir"))
# On MySQL 5.1 >= 5.1.19 and on any version of MySQL 6.0
if self.__plugindir is None and banVer >= "5.1.19":
if self.__plugindir is None and distutils.version.LooseVersion(banVer) >= distutils.version.LooseVersion("5.1.19"):
logger.info("retrieving MySQL base directory absolute path")
# Reference: http://dev.mysql.com/doc/refman/5.1/en/server-options.html#option_mysqld_basedir

View File

@ -5,6 +5,7 @@ Copyright (c) 2006-2020 sqlmap developers (http://sqlmap.org/)
See the file 'LICENSE' for copying permission
"""
import distutils.version
import os
from lib.core.common import Backend
@ -50,9 +51,9 @@ class Takeover(GenericTakeover):
banVer = kb.bannerFp["dbmsVersion"]
if banVer >= "10":
if distutils.version.LooseVersion(banVer) >= distutils.version.LooseVersion("10"):
majorVer = banVer.split('.')[0]
elif banVer >= "8.2" and '.' in banVer:
elif distutils.version.LooseVersion(banVer) >= distutils.version.LooseVersion("8.2") and '.' in banVer:
majorVer = '.'.join(banVer.split('.')[:2])
else:
errMsg = "unsupported feature on versions of PostgreSQL before 8.2"