8.Injecting Code in Data Driven Applications SQL Injection
8.Injecting Code in Data Driven Applications SQL Injection
10. Exit the shell and in meterpreter mode try to take screenshot of target machine.
PRACTICAL-08
AIM:- Practical on Injecting Code in Data Driven Applications: SQL Injection
THEORY
SQL injection is a code injection technique that might destroy your database. SQL injection is
one of the most common web hacking techniques. SQL injection is the placement of
malicious code in SQL statements, via web page input.
1. Run metasploitable2 and Kali Linux and check the ipaddress of metasploitable2
2. Type the metasploitable2 ip address on the browser to display all the vulnerable web
applications. Make sure your metasploitable2 network is bridged and matches the
subnet of kali Linux.
4. Enter the name and password click on view account button as follow the steps
shown in picture.
5. Now copy the link of the login page and run SQLMap in kali
6. Open Kali Linux terminal and type sqlmap –h
SQLMap is a powerful tool for identifying and exploiting SQL injection vulnerabilities
in web applications
7. Paste the link with the sqlmap command in kali terminal or type the following.
8. Type Y in all the Questions
9. It will take quite a while for the process to complete as it’s checking the
vulnerabilities
10. To solve the error below modify the config file of metasploitable2
11. Change the dbname from metasploit Follow the step in picture.
12. Change dbname metasploit to owasp10.
13. Save the changes with Ctrl + O and then exit.
14. After making changes in metasploitable2 you should be able to fix the login page on
the website, which will show proper error messages shown below.
15. Now retry the command and test the issue should be resolved.
16. You should now be able to view all the databases hosted on the server
17. Now find the users table for the accounts.
21. You should now be able to view all the databases hosted on the server.
22. Enter the cracked username and passwords on DVWA Website and you will be able
to log in.