mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2024-11-25 11:03:47 +03:00
Fixes #4492
This commit is contained in:
parent
99e6d56f09
commit
8c8aae9170
|
@ -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):
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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"
|
||||
|
|
Loading…
Reference in New Issue
Block a user