In the previous recipe, we detected an SQLi. In this recipe, we will exploit that vulnerability and use it to extract information from the database.
Step-by-step error-based SQL injections
How to do it...
We already know that DVWA is vulnerable to SQLi, so let's log in and browse to http://192.168.56.11/dvwa/vulnerabilities/sqli/. Then, follow the following steps:
- After detecting that an SQLi exists, the next step is to get to know the internal query, or, more precisely, the number of columns its result has. Enter any number in the User ID box and click Submit.
- Now, open the HackBar (hit F9) and click Load URL. The URL in the address bar should now appear in the HackBar.
- In the HackBar, we replace the value of the id...