
In a vulnerable application, SQL queries are typically created by concatenating strings with the different parts of the query. So, how can we exploit our vulnerable application? A very good example is this classic XKCD comic strip:įundamentally: applications vulnerable to SQL Injection attacks don’t properly sanitize their inputs, so an attacker can introduce new conditions and/or queries.īefore using SQL injection to drop the students table, let’s play with it a bit. Exploit a Simple SQL Injection Vulnerability Also, it is possible to insert, update, or delete records. Using this access, an attacker can retrieve information from the database in an unauthorized way (especially from those tables that aren’t typically accessible by users).

What is a SQL Injection?Ī SQL injection is a type of vulnerability that gives users access to the database associated with an application, allowing them to execute SQL queries. This is for the sake of clarity in this tutorial-I honestly hope you don’t ever design a database or an app this way. For example, it uses the HTTP method GET for all transactions (although usually forms would be sent using methods POST or PUT).Īlso, the database also includes some clear-text passwords.

The application is quite basic and designed to easily show the existing SQL injection vulnerabilities just by using the browser.

Now, visit the vulnerable app from your browser by navigating to Essentially, the application allows the user to search students by their first or last names, to add new students, and to edit or delete existing ones. Listening on Document root is /home/okta/sql-injection-in-php
