Database Assessmentmysqlinjectiontakeoverperlsql

sqlsus

sqlsus is an open source MySQL injection and takeover tool written in Perl. It allows retrieving database structure, injecting SQL queries, downloading files, and controlling backdoors via a command line interface.

Description

sqlsus is designed for MySQL injection and database takeover scenarios. It provides a command line interface that mimics a MySQL console output where relevant, enabling users to interact with vulnerable MySQL databases. The tool supports complex SQL query injection, database structure retrieval, and cloning databases.

Use cases include penetration testing of web applications backed by MySQL, where SQL injection vulnerabilities are suspected. Testers can generate a configuration file, edit it with target details, and launch scans to explore and exploit the database. Additional features like crawling for writable directories, file downloads from the web server, and backdoor uploads make it versatile for deeper exploitation.

The tool requires a configuration file specifying the target, after which an interactive session is started for further commands.

How It Works

sqlsus operates via a Perl-based command line interface that connects to vulnerable MySQL databases over HTTP or similar web interfaces. It generates a configuration file for target specification, then creates an interactive session mimicking MySQL console output. Techniques include SQL injection for structure dumping, query execution, file operations via LOAD_FILE or similar, directory crawling for writable paths, backdoor deployment, and database cloning through injected queries.

Installation

bash
sudo apt install sqlsus

Flags

-g sqlsus.cfgGenerate a configuration file for the scan

Examples

Generate a configuration file named sqlsus.cfg
sqlsus -g sqlsus.cfg
Edit the generated configuration file
nano sqlsus.cfg
Load the configuration file and start an interactive session
sqlsus sqlsus.cfg
Initiate the scan or session within the sqlsus interactive prompt
start
Load config and immediately start the session
sqlsus sqlsus.cfg; start
Full root command to generate config file as shown in usage example
root@kali:~# sqlsus -g sqlsus.cfg
Updated 2026-04-16kali.org ↗