Fix for --tables/--count displaying (and sorting by) escaped table names

This commit is contained in:
Miroslav Štampar 2026-11-12 17:31:14 +01:00
parent 2de056aa14
commit c0e75fa98d
2 changed files with 5 additions and 5 deletions

View file

@ -293,7 +293,7 @@ class Dump(object):
lines = "-" * (int(maxlength) + 2)
for db, tables in dbTables.items():
tables = sorted(filter(None, tables))
tables = sorted(filter(None, tables), key=lambda _: unsafeSQLIdentificatorNaming(getUnicode(_))) # Note: sorted by (displayed) unescaped names
self._write("Database: %s" % unsafeSQLIdentificatorNaming(db) if db and METADB_SUFFIX not in db else "<current>")
@ -408,7 +408,7 @@ class Dump(object):
for ctables in dbTables.values():
for tables in ctables.values():
for table in tables:
maxlength1 = max(maxlength1, getConsoleLength(getUnicode(table)))
maxlength1 = max(maxlength1, getConsoleLength(unsafeSQLIdentificatorNaming(getUnicode(table))))
for db, counts in dbTables.items():
self._write("Database: %s" % unsafeSQLIdentificatorNaming(db) if db and METADB_SUFFIX not in db else "<current>")
@ -431,10 +431,10 @@ class Dump(object):
if count is None:
count = "Unknown"
tables.sort(key=lambda _: _.lower() if hasattr(_, "lower") else _)
tables = sorted((unsafeSQLIdentificatorNaming(getUnicode(_)) for _ in tables), key=lambda _: _.lower())
for table in tables:
blank1 = " " * (maxlength1 - getConsoleLength(getUnicode(table)))
blank1 = " " * (maxlength1 - getConsoleLength(table))
blank2 = " " * (maxlength2 - len(str(count)))
self._write("| %s%s | %d%s |" % (table, blank1, count, blank2))

View file

@ -19,7 +19,7 @@ from lib.core.enums import OS
from thirdparty import six
# sqlmap version (<major>.<minor>.<month>.<monthly commit>)
VERSION = "1.10.11.68"
VERSION = "1.10.11.69"
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)