A03 - Injection
Last updated
Last updated
Injection vulnerabilities allow attackers to execute malicious code within a web application, affecting databases, scripts, or other parts of the application. In this example, we have both an SQL Injection and a Cross-Site Scripting (XSS) vulnerability on a specific page. Here’s how each can be exploited.
For XSS, we can test by inputting <script>alert(1)</script>
in the search field, and it triggers successfully. Other payloads, such as the following SVG payload or a polyglot, can also be used to test for XSS:
Polyglot XSS example:
Reference for polyglot payloads:
We can also use tools like to automate XSS testing:
To test for SQL Injection, we can use SQLmap (or Ghauri ofc 😉) to automate the detection and exploitation of SQLi vulnerabilities:
For a manual SQL Injection test, try this URL to extract data from the database:
This payload attempts to perform a SQL UNION-based injection to retrieve sensitive data from the users
table.