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

Skip to content

Commit aa5645c

Browse files
committed
Fixes #3674
1 parent d815e6c commit aa5645c

2 files changed

Lines changed: 26 additions & 23 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.3.5.100"
21+
VERSION = "1.3.5.102"
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/databases.py

Lines changed: 25 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -293,31 +293,34 @@ def getTables(self, bruteForce=None):
293293
values = [(dbs[0], _) for _ in values]
294294

295295
for db, table in filterPairValues(values):
296-
db = safeSQLIdentificatorNaming(db)
297-
table = safeSQLIdentificatorNaming(unArrayizeValue(table), True)
298-
299-
if conf.getComments:
300-
_ = queries[Backend.getIdentifiedDbms()].table_comment
301-
if hasattr(_, "query"):
302-
if Backend.getIdentifiedDbms() in (DBMS.ORACLE, DBMS.DB2):
303-
query = _.query % (unsafeSQLIdentificatorNaming(db.upper()), unsafeSQLIdentificatorNaming(table.upper()))
296+
table = unArrayizeValue(table)
297+
298+
if not isNoneValue(table):
299+
db = safeSQLIdentificatorNaming(db)
300+
table = safeSQLIdentificatorNaming(table, True)
301+
302+
if conf.getComments:
303+
_ = queries[Backend.getIdentifiedDbms()].table_comment
304+
if hasattr(_, "query"):
305+
if Backend.getIdentifiedDbms() in (DBMS.ORACLE, DBMS.DB2):
306+
query = _.query % (unsafeSQLIdentificatorNaming(db.upper()), unsafeSQLIdentificatorNaming(table.upper()))
307+
else:
308+
query = _.query % (unsafeSQLIdentificatorNaming(db), unsafeSQLIdentificatorNaming(table))
309+
310+
comment = unArrayizeValue(inject.getValue(query, blind=False, time=False))
311+
if not isNoneValue(comment):
312+
infoMsg = "retrieved comment '%s' for table '%s' " % (comment, unsafeSQLIdentificatorNaming(table))
313+
infoMsg += "in database '%s'" % unsafeSQLIdentificatorNaming(db)
314+
logger.info(infoMsg)
304315
else:
305-
query = _.query % (unsafeSQLIdentificatorNaming(db), unsafeSQLIdentificatorNaming(table))
316+
warnMsg = "on %s it is not " % Backend.getIdentifiedDbms()
317+
warnMsg += "possible to get column comments"
318+
singleTimeWarnMessage(warnMsg)
306319

307-
comment = unArrayizeValue(inject.getValue(query, blind=False, time=False))
308-
if not isNoneValue(comment):
309-
infoMsg = "retrieved comment '%s' for table '%s' " % (comment, unsafeSQLIdentificatorNaming(table))
310-
infoMsg += "in database '%s'" % unsafeSQLIdentificatorNaming(db)
311-
logger.info(infoMsg)
320+
if db not in kb.data.cachedTables:
321+
kb.data.cachedTables[db] = [table]
312322
else:
313-
warnMsg = "on %s it is not " % Backend.getIdentifiedDbms()
314-
warnMsg += "possible to get column comments"
315-
singleTimeWarnMessage(warnMsg)
316-
317-
if db not in kb.data.cachedTables:
318-
kb.data.cachedTables[db] = [table]
319-
else:
320-
kb.data.cachedTables[db].append(table)
323+
kb.data.cachedTables[db].append(table)
321324

322325
if not kb.data.cachedTables and isInferenceAvailable() and not conf.direct:
323326
for db in dbs:

0 commit comments

Comments
 (0)