From e1a509ebb732abc6d3a7c9544af8425417767fba Mon Sep 17 00:00:00 2001 From: Miroslav Stampar Date: Wed, 31 Dec 2025 14:53:59 +0100 Subject: [PATCH] Minor refactoring (#5965) --- data/txt/sha256sums.txt | 8 ++++---- lib/core/settings.py | 2 +- lib/parse/cmdline.py | 10 +++++----- lib/{core => utils}/gui.py | 0 lib/{core => utils}/ncgui.py | 9 ++++----- 5 files changed, 14 insertions(+), 15 deletions(-) rename lib/{core => utils}/gui.py (100%) rename lib/{core => utils}/ncgui.py (99%) diff --git a/data/txt/sha256sums.txt b/data/txt/sha256sums.txt index 08df46b0b..8ae65fe9e 100644 --- a/data/txt/sha256sums.txt +++ b/data/txt/sha256sums.txt @@ -179,10 +179,8 @@ a8b398601dae3318d255f936f5bb6acd25ffdc8ef6d6b713ad89ee7136d1c736 lib/core/dicts 20a6edda1d57a7564869e366f57ed7b2ab068dd8716cf7a10ef4a02d154d6c80 lib/core/dump.py 20ea31bb52785900d6bba5e9f2f560a4ed064cb95add75015de105959aa9c4d4 lib/core/enums.py 00a9b29caa81fe4a5ef145202f9c92e6081f90b2a85cd76c878d520d900ad856 lib/core/exception.py -1c48804c10b94da696d3470efbd25d2fff0f0bbf2af0101aaac8f8c097fce02b lib/core/gui.py 4608f21a4333c162ab3c266c903fda4793cc5834de30d06affe9b7566dd09811 lib/core/__init__.py 3d308440fb01d04b5d363bfbe0f337756b098532e5bb7a1c91d5213157ec2c35 lib/core/log.py -3c6702f14ecd14f12fdab02c8b28fa4d9fdc477b7fa743e743728b56b89d4db4 lib/core/ncgui.py 2a06dc9b5c17a1efdcdb903545729809399f1ee96f7352cc19b9aaa227394ff3 lib/core/optiondict.py 114396f3b11372afc47451b4fbfd79e567ebdcaa926a3cff9ac12cab4db02d8b lib/core/option.py fd449fe2c707ce06c929fc164cbabb3342f3e4e2b86c06f3efc1fc09ac98a25a lib/core/patch.py @@ -191,7 +189,7 @@ c4bfb493a03caf84dd362aec7c248097841de804b7413d0e1ecb8a90c8550bc0 lib/core/readl d1bd70c1a55858495c727fbec91e30af267459c8f64d50fabf9e4ee2c007e920 lib/core/replication.py 1d0f80b0193ac5204527bfab4bde1a7aee0f693fd008e86b4b29f606d1ef94f3 lib/core/revision.py d2eb8e4b05ac93551272b3d4abfaf5b9f2d3ac92499a7704c16ed0b4f200db38 lib/core/session.py -38a9c666b8f2e3586d6b34f2fd4d690153aa6df5ca10d0a8c23a6e998a67078e lib/core/settings.py +6e5aea3ec3c64aa280017ef3610f612f1b4a66d685e00427f944cb3bad7cde92 lib/core/settings.py 1c5eab9494eb969bc9ce118a2ea6954690c6851cbe54c18373c723b99734bf09 lib/core/shell.py 4eea6dcf023e41e3c64b210cb5c2efc7ca893b727f5e49d9c924f076bb224053 lib/core/subprocessng.py cdd352e1331c6b535e780f6edea79465cb55af53aa2114dcea0e8bf382e56d1a lib/core/target.py @@ -202,7 +200,7 @@ a9b3dca1c17f56bed8e07973c7f8603932012931947633781f7523c05cb2bed2 lib/core/testi cba481f8c79f4a75bd147b9eb5a1e6e61d70422fceadd12494b1dbaa4f1d27f4 lib/core/wordlist.py 4608f21a4333c162ab3c266c903fda4793cc5834de30d06affe9b7566dd09811 lib/__init__.py 7d1d3e07a1f088428d155c0e1b28e67ecbf5f62775bdeeeb11b4388369dce0f7 lib/parse/banner.py -380881c528f70290b0d3ca888d1d306e6aa19eff3fe22ebf10fe3248bec01044 lib/parse/cmdline.py +5d0de42823d3db6484bcdd3888052c7b32b3be92cf334047dd8825f4064dd76c lib/parse/cmdline.py f1ad73b6368730b8b8bc2e28b3305445d2b954041717619bede421ccc4381625 lib/parse/configfile.py a96b7093f30b3bf774f5cc7a622867472d64a2ae8b374b43786d155cf6203093 lib/parse/handler.py cfd4857ce17e0a2da312c18dcff28aefaa411f419b4e383b202601c42de40eec lib/parse/headers.py @@ -249,11 +247,13 @@ af67d25e8c16b429a5b471d3c629dc1da262262320bf7cd68465d151c02def16 lib/utils/brut 828940a8eefda29c9eb271c21f29e2c4d1d428ccf0dcc6380e7ee6740300ec55 lib/utils/crawler.py 56b93ba38f127929346f54aa75af0db5f46f9502b16acfe0d674a209de6cad2d lib/utils/deps.py 3aca7632d53ab2569ddef876a1b90f244640a53e19b304c77745f8ddb15e6437 lib/utils/getch.py +1c48804c10b94da696d3470efbd25d2fff0f0bbf2af0101aaac8f8c097fce02b lib/utils/gui.py 4979120bbbc030eaef97147ee9d7d564d9683989059b59be317153cdaa23d85b lib/utils/har.py af047a6efc1719a3d166fac0b7ff98ab3d29af7b676ff977e98c31c80e9e883e lib/utils/hashdb.py 8c9caffbd821ad9547c27095c8e55c398ea743b2e44d04b3572e2670389ccf5b lib/utils/hash.py ba862f0c96b1d39797fb21974599e09690d312b17a85e6639bee9d1db510f543 lib/utils/httpd.py 4608f21a4333c162ab3c266c903fda4793cc5834de30d06affe9b7566dd09811 lib/utils/__init__.py +bb5b586044804d40630880dedb3aa7eadc9b81bd44f2511de6a642178a4984be lib/utils/ncgui.py f1d84b1b99ce64c1ccb64aaa35f5231cf094b3dac739f29f76843f23ee10b990 lib/utils/pivotdumptable.py d0643f8fa5ea2991cda35817154f692f1948910e4506cb56827d87bc0b5540b7 lib/utils/progress.py e0bf9d7c069bc6b1ba45e1ddeb1eb94dac14676a1474a05c9af4dcbd9e89cc74 lib/utils/purge.py diff --git a/lib/core/settings.py b/lib/core/settings.py index cf7b77555..b9f57359e 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.9.12.56" +VERSION = "1.9.12.57" 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) diff --git a/lib/parse/cmdline.py b/lib/parse/cmdline.py index b8f7c4ce7..0c81c27ca 100644 --- a/lib/parse/cmdline.py +++ b/lib/parse/cmdline.py @@ -860,7 +860,7 @@ def cmdLineParser(argv=None): parser.add_argument("--gui", dest="gui", action="store_true", help=SUPPRESS) - parser.add_argument("--ncgui", dest="ncgui", action="store_true", + parser.add_argument("--tui", dest="tui", action="store_true", help=SUPPRESS) parser.add_argument("--smoke-test", dest="smokeTest", action="store_true", @@ -936,16 +936,16 @@ def cmdLineParser(argv=None): checkOldOptions(argv) if "--gui" in argv: - from lib.core.gui import runGui + from lib.utils.gui import runGui runGui(parser) raise SqlmapSilentQuitException - elif "--ncgui" in argv: - from lib.core.ncgui import runNcGui + elif "--tui" in argv: + from lib.utils.tui import runTui - runNcGui(parser) + runTui(parser) raise SqlmapSilentQuitException diff --git a/lib/core/gui.py b/lib/utils/gui.py similarity index 100% rename from lib/core/gui.py rename to lib/utils/gui.py diff --git a/lib/core/ncgui.py b/lib/utils/ncgui.py similarity index 99% rename from lib/core/ncgui.py rename to lib/utils/ncgui.py index e050931a9..f1fee8bab 100644 --- a/lib/core/ncgui.py +++ b/lib/utils/ncgui.py @@ -91,7 +91,7 @@ class NcursesUI: def _draw_header(self): """Draw the header bar""" height, width = self.stdscr.getmaxyx() - header = " sqlmap - Ncurses GUI " + header = " sqlmap - Ncurses TUI " self.stdscr.attron(curses.color_pair(1) | curses.A_BOLD) self.stdscr.addstr(0, 0, header.center(width)) self.stdscr.attroff(curses.color_pair(1) | curses.A_BOLD) @@ -750,12 +750,11 @@ class NcursesUI: if option['type'] == 'bool': option['value'] = not option['value'] -def runNcGui(parser): - """Main entry point for ncurses GUI""" +def runTui(parser): + """Main entry point for ncurses TUI""" # Check if ncurses is available if curses is None: - raise SqlmapMissingDependence("missing 'curses' module (try installing 'windows-curses' on Windows)") - + raise SqlmapMissingDependence("missing 'curses' module (optional Python module). Use a Python build that includes curses/ncurses, or install the platform-provided equivalent (e.g. for Windows: pip install windows-curses)") try: # Initialize and run def main(stdscr):