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

Skip to content

Commit f1dbe9e

Browse files
committed
Minor bug fix
1 parent 3977be9 commit f1dbe9e

2 files changed

Lines changed: 12 additions & 10 deletions

File tree

lib/core/settings.py

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

2222
# sqlmap version (<major>.<minor>.<month>.<monthly commit>)
23-
VERSION = "1.5.8.3"
23+
VERSION = "1.5.8.4"
2424
TYPE = "dev" if VERSION.count('.') > 2 and VERSION.split('.')[-1] != '0' else "stable"
2525
TYPE_COLORS = {"dev": 33, "stable": 90, "pip": 34}
2626
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: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -363,18 +363,20 @@ def getTables(self, bruteForce=None):
363363
singleTimeLogMessage(infoMsg)
364364
continue
365365

366-
for query, count in ((rootQuery.blind.query, rootQuery.blind.count), (getattr(rootQuery.blind, "query2", None), getattr(rootQuery.blind, "count2", None))):
367-
if query is None:
366+
for _query, _count in ((rootQuery.blind.query, rootQuery.blind.count), (getattr(rootQuery.blind, "query2", None), getattr(rootQuery.blind, "count2", None))):
367+
if _query is None:
368368
break
369369

370370
infoMsg = "fetching number of tables for "
371371
infoMsg += "database '%s'" % unsafeSQLIdentificatorNaming(db)
372372
logger.info(infoMsg)
373373

374374
if Backend.getIdentifiedDbms() not in (DBMS.SQLITE, DBMS.FIREBIRD, DBMS.MAXDB, DBMS.ACCESS, DBMS.MCKOI, DBMS.EXTREMEDB):
375-
count = count % unsafeSQLIdentificatorNaming(db)
375+
query = _count % unsafeSQLIdentificatorNaming(db)
376+
else:
377+
query = _count
376378

377-
count = inject.getValue(count, union=False, error=False, expected=EXPECTED.INT, charsetType=CHARSET_TYPE.DIGITS)
379+
count = inject.getValue(query, union=False, error=False, expected=EXPECTED.INT, charsetType=CHARSET_TYPE.DIGITS)
378380

379381
if count == 0:
380382
warnMsg = "database '%s' " % unsafeSQLIdentificatorNaming(db)
@@ -395,15 +397,15 @@ def getTables(self, bruteForce=None):
395397

396398
for index in indexRange:
397399
if Backend.isDbms(DBMS.SYBASE):
398-
query = query % (db, (kb.data.cachedTables[-1] if kb.data.cachedTables else " "))
400+
query = _query % (db, (kb.data.cachedTables[-1] if kb.data.cachedTables else " "))
399401
elif Backend.getIdentifiedDbms() in (DBMS.MAXDB, DBMS.ACCESS, DBMS.MCKOI, DBMS.EXTREMEDB):
400-
query = query % (kb.data.cachedTables[-1] if kb.data.cachedTables else " ")
402+
query = _query % (kb.data.cachedTables[-1] if kb.data.cachedTables else " ")
401403
elif Backend.getIdentifiedDbms() in (DBMS.SQLITE, DBMS.FIREBIRD):
402-
query = query % index
404+
query = _query % index
403405
elif Backend.getIdentifiedDbms() in (DBMS.HSQLDB, DBMS.INFORMIX, DBMS.FRONTBASE, DBMS.VIRTUOSO):
404-
query = query % (index, unsafeSQLIdentificatorNaming(db))
406+
query = _query % (index, unsafeSQLIdentificatorNaming(db))
405407
else:
406-
query = query % (unsafeSQLIdentificatorNaming(db), index)
408+
query = _query % (unsafeSQLIdentificatorNaming(db), index)
407409

408410
table = unArrayizeValue(inject.getValue(query, union=False, error=False))
409411

0 commit comments

Comments
 (0)