A03 - Injection
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.
Cross-Site Scripting (XSS)
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: HackVault XSS Polyglot
We can also use tools like dalfox to automate XSS testing:
SQL Injection (SQLi)
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.
Last updated