Skip to content

Commit 8c8aae9

Browse files
committed
Fixes #4492
1 parent 99e6d56 commit 8c8aae9

File tree

4 files changed

+9
-6
lines changed

4 files changed

+9
-6
lines changed

lib/core/common.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
import collections
1313
import contextlib
1414
import copy
15+
import distutils.version
1516
import functools
1617
import getpass
1718
import hashlib
@@ -586,7 +587,7 @@ def isVersionWithin(versionList):
586587

587588
@staticmethod
588589
def isVersionGreaterOrEqualThan(version):
589-
return Backend.getVersion() is not None and str(Backend.getVersion()) >= str(version)
590+
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 ' ')
590591

591592
@staticmethod
592593
def isOs(os):

lib/core/settings.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
from thirdparty.six import unichr as _unichr
1919

2020
# sqlmap version (<major>.<minor>.<month>.<monthly commit>)
21-
VERSION = "1.4.12.34"
21+
VERSION = "1.4.12.35"
2222
TYPE = "dev" if VERSION.count('.') > 2 and VERSION.split('.')[-1] != '0' else "stable"
2323
TYPE_COLORS = {"dev": 33, "stable": 90, "pip": 34}
2424
VERSION_STRING = "sqlmap/%s#%s" % ('.'.join(VERSION.split('.')[:-1]) if VERSION.count('.') > 2 and VERSION.split('.')[-1] == '0' else VERSION, TYPE)

plugins/dbms/mysql/takeover.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
See the file 'LICENSE' for copying permission
66
"""
77

8+
import distutils.version
89
import os
910

1011
from lib.core.agent import agent
@@ -37,13 +38,13 @@ def udfSetRemotePath(self):
3738

3839
banVer = kb.bannerFp["dbmsVersion"]
3940

40-
if banVer >= "5.0.67":
41+
if distutils.version.LooseVersion(banVer) >= distutils.version.LooseVersion("5.0.67"):
4142
if self.__plugindir is None:
4243
logger.info("retrieving MySQL plugin directory absolute path")
4344
self.__plugindir = unArrayizeValue(inject.getValue("SELECT @@plugin_dir"))
4445

4546
# On MySQL 5.1 >= 5.1.19 and on any version of MySQL 6.0
46-
if self.__plugindir is None and banVer >= "5.1.19":
47+
if self.__plugindir is None and distutils.version.LooseVersion(banVer) >= distutils.version.LooseVersion("5.1.19"):
4748
logger.info("retrieving MySQL base directory absolute path")
4849

4950
# Reference: http://dev.mysql.com/doc/refman/5.1/en/server-options.html#option_mysqld_basedir

plugins/dbms/postgresql/takeover.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
See the file 'LICENSE' for copying permission
66
"""
77

8+
import distutils.version
89
import os
910

1011
from lib.core.common import Backend
@@ -50,9 +51,9 @@ def udfSetLocalPaths(self):
5051

5152
banVer = kb.bannerFp["dbmsVersion"]
5253

53-
if banVer >= "10":
54+
if distutils.version.LooseVersion(banVer) >= distutils.version.LooseVersion("10"):
5455
majorVer = banVer.split('.')[0]
55-
elif banVer >= "8.2" and '.' in banVer:
56+
elif distutils.version.LooseVersion(banVer) >= distutils.version.LooseVersion("8.2") and '.' in banVer:
5657
majorVer = '.'.join(banVer.split('.')[:2])
5758
else:
5859
errMsg = "unsupported feature on versions of PostgreSQL before 8.2"

0 commit comments

Comments
 (0)