From c0e75fa98d8480391db5b01d7f7bbeff4182bdb6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miroslav=20=C5=A0tampar?= Date: Thu, 12 Nov 2026 17:31:14 +0100 Subject: [PATCH] Fix for --tables/--count displaying (and sorting by) escaped table names --- lib/core/dump.py | 8 ++++---- lib/core/settings.py | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/core/dump.py b/lib/core/dump.py index 4bbe1c431..d761f7008 100644 --- a/lib/core/dump.py +++ b/lib/core/dump.py @@ -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 "") @@ -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 "") @@ -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)) diff --git a/lib/core/settings.py b/lib/core/settings.py index b91609851..065d18241 100644 --- a/lib/core/settings.py +++ b/lib/core/settings.py @@ -19,7 +19,7 @@ from lib.core.enums import OS from thirdparty import six # sqlmap version (...) -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)