Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit f3e8039

Browse files
committed
Fixes #4549
1 parent e5086ef commit f3e8039

2 files changed

Lines changed: 7 additions & 17 deletions

File tree

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.5.1.35"
21+
VERSION = "1.5.1.36"
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/generic/misc.py

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
from lib.core.enums import HASHDB_KEYS
2626
from lib.core.enums import OS
2727
from lib.core.exception import SqlmapNoneDataException
28-
from lib.core.exception import SqlmapUnsupportedFeatureException
2928
from lib.request import inject
3029

3130
class Miscellaneous(object):
@@ -83,25 +82,16 @@ def getVersionFromBanner(self):
8382
infoMsg = "detecting back-end DBMS version from its banner"
8483
logger.info(infoMsg)
8584

86-
if Backend.isDbms(DBMS.MYSQL):
87-
first, last = 1, 6
88-
89-
elif Backend.isDbms(DBMS.PGSQL):
90-
first, last = 12, 6
91-
92-
elif Backend.isDbms(DBMS.MSSQL):
93-
first, last = 29, 9
94-
95-
else:
96-
raise SqlmapUnsupportedFeatureException("unsupported DBMS")
97-
98-
query = queries[Backend.getIdentifiedDbms()].substring.query % (queries[Backend.getIdentifiedDbms()].banner.query, first, last)
85+
query = queries[Backend.getIdentifiedDbms()].banner.query
9986

10087
if conf.direct:
10188
query = "SELECT %s" % query
10289

103-
kb.bannerFp["dbmsVersion"] = unArrayizeValue(inject.getValue(query))
104-
kb.bannerFp["dbmsVersion"] = (kb.bannerFp["dbmsVersion"] or "").replace(',', "").replace('-', "").replace(' ', "")
90+
kb.bannerFp["dbmsVersion"] = unArrayizeValue(inject.getValue(query)) or ""
91+
92+
match = re.search(r"\d[\d.-]*", kb.bannerFp["dbmsVersion"])
93+
if match:
94+
kb.bannerFp["dbmsVersion"] = match.group(0)
10595

10696
def delRemoteFile(self, filename):
10797
if not filename:

0 commit comments

Comments
 (0)