hackingtool/tools/sql_tools.py
Hardik Zinzuvadiya 2ad5587517 Phase 4+5: Core architecture + shared console across all tool files
Phase 4 (core.py — largely done in Phase 1, completed here):
- HackingTool: add ARCHIVED, ARCHIVED_REASON, SUPPORTED_OS, REQUIRES_* fields
- HackingTool: remove INSTALLATION_DIR (unused)
- HackingToolsCollection: add _active_tools(), _archived_tools(), _incompatible_tools()
- HackingToolsCollection: add _show_archived_tools() (option 98 sub-menu)
- HackingToolsCollection.show_options(): filter by OS and ARCHIVED flag
- OS-incompatible tools show count but are hidden from menu
- Archived tools accessible via option 98 with reason displayed

Phase 5 (all 22 remaining tool files):
- Remove local console = Console() and _theme = Theme() from all 22 files
- Remove P_COLOR and PURPLE_STYLE local constants
- Add `from core import HackingTool, HackingToolsCollection, console` everywhere
- Remove show_options() overrides from all collection classes (500+ lines deleted)
- Remove pretty_print() overrides from all collection classes
- Remove _get_attr() / _get_attr_fallback() helpers from all collection classes
- Replace super(ClassName, self).__init__() → super().__init__() in all files
- Remove # coding=utf-8 headers from all files
- Fix remaining PURPLE_STYLE usages → "bold magenta" literal

All 28 tool modules import cleanly. Zero local console instances remain.
2026-03-15 13:55:04 +05:30

86 lines
3.9 KiB
Python

from core import HackingTool, HackingToolsCollection, console
from rich.panel import Panel
from rich.prompt import Prompt
class Sqlmap(HackingTool):
TITLE = "Sqlmap tool"
DESCRIPTION = "sqlmap is an open source penetration testing tool that " \
"automates the process of detecting and exploiting SQL injection flaws " \
"and taking over database servers. [!] python3 sqlmap.py -u [http://example.com] --batch --banner. More usage: https://github.com/sqlmapproject/sqlmap/wiki/Usage"
INSTALL_COMMANDS = ["sudo git clone --depth 1 https://github.com/sqlmapproject/sqlmap.git sqlmap-dev"]
RUN_COMMANDS = ["cd sqlmap-dev;python3 sqlmap.py --wizard"]
PROJECT_URL = "https://github.com/sqlmapproject/sqlmap"
class NoSqlMap(HackingTool):
TITLE = "NoSqlMap"
DESCRIPTION = "NoSQLMap is an open source Python tool designed to audit and automate injection attacks. [*] Please install MongoDB."
INSTALL_COMMANDS = [
"git clone https://github.com/codingo/NoSQLMap.git",
# Bug 25 fix: was "python setup.py install" (Python 2) and "python NoSQLMap"
"cd NoSQLMap && pip install --user .",
]
# Bug 25 fix: "python" → "python3"
RUN_COMMANDS = ["python3 -m nosqlmap"]
PROJECT_URL = "https://github.com/codingo/NoSQLMap"
class SQLiScanner(HackingTool):
TITLE = "Damn Small SQLi Scanner"
DESCRIPTION = "DSSS is a fully functional SQL injection vulnerability scanner also supporting GET and POST parameters. Usage: python3 dsss.py -h | -u [URL]"
INSTALL_COMMANDS = ["git clone https://github.com/stamparm/DSSS.git"]
PROJECT_URL = "https://github.com/stamparm/DSSS"
def __init__(self):
super().__init__(runnable=False)
class Explo(HackingTool):
TITLE = "Explo"
DESCRIPTION = "Explo is a simple tool to describe web security issues in human and machine readable format. Usage: explo [--verbose|-v] testcase.yaml | explo [--verbose|-v] examples/*.yaml"
INSTALL_COMMANDS = ["git clone https://github.com/dtag-dev-sec/explo.git",
"cd explo;sudo python setup.py install"]
PROJECT_URL = "https://github.com/dtag-dev-sec/explo"
def __init__(self):
super().__init__(runnable=False)
class Blisqy(HackingTool):
TITLE = "Blisqy - Exploit Time-based blind-SQL injection"
DESCRIPTION = "Blisqy helps web security researchers find time-based blind SQL injections on HTTP headers and exploit them."
INSTALL_COMMANDS = ["git clone https://github.com/JohnTroony/Blisqy.git"]
PROJECT_URL = "https://github.com/JohnTroony/Blisqy"
def __init__(self):
super().__init__(runnable=False)
class Leviathan(HackingTool):
TITLE = "Leviathan - Wide Range Mass Audit Toolkit"
DESCRIPTION = "Leviathan is a mass audit toolkit with service discovery, brute force, SQL injection detection, and custom exploit capabilities. Requires API keys."
INSTALL_COMMANDS = ["git clone https://github.com/leviathan-framework/leviathan.git",
"cd leviathan;sudo pip install -r requirements.txt"]
RUN_COMMANDS = ["cd leviathan;python leviathan.py"]
PROJECT_URL = "https://github.com/leviathan-framework/leviathan"
class SQLScan(HackingTool):
TITLE = "SQLScan"
DESCRIPTION = "SQLScan is a quick web scanner to find SQL injection points. Not for educational purposes."
INSTALL_COMMANDS = ["sudo apt install php php-bz2 php-curl php-mbstring curl",
"sudo curl https://raw.githubusercontent.com/Cvar1984/sqlscan/dev/build/main.phar --output /usr/local/bin/sqlscan",
"chmod +x /usr/local/bin/sqlscan"]
RUN_COMMANDS = ["sudo sqlscan"]
PROJECT_URL = "https://github.com/Cvar1984/sqlscan"
class SqlInjectionTools(HackingToolsCollection):
TITLE = "SQL Injection Tools"
TOOLS = [Sqlmap(), NoSqlMap(), SQLiScanner(), Explo(), Blisqy(), Leviathan(), SQLScan()]
if __name__ == "__main__":
tools = SqlInjectionTools()
tools.show_options()