Tag: sql injection


Blind SQL Injection with Conditional Errors (and Oracle's `dual` Table)

Posted in Security

permalink

Part 5 of our PortSwigger Web Security Academy series. This is the meaty one. We already covered blind SQLi with conditional responses, where the page renders differently depending on the truth of an injected boolean. This post covers what to do when the page doesn't render differently - but you can still smuggle information out by deliberately causing SQL errors.

The example is PortSwigger's Lab 12, which is Oracle-flavored. Full notes: SQL Injection/Blind.

The Six Steps

The full attack has six steps:

  1. Prove the parameter is injectable
  2. Fingerprint the database
  3. Confirm a users table exists
  4. Confirm the administrator user exists …


Tags:    security    sql injection    sqli    blind sqli    oracle    burp suite    portswigger   


Blind SQL Injection with Conditional Responses

Posted in Security

permalink

Part 4 of our PortSwigger Web Security Academy series. This one covers blind SQL injection with conditional responses, which is the easier of the two blind SQLi flavors we work through in this series.

Wiki notes: SQL Injection/Blind.

The Setup

Some SQL injection vulnerabilities never give you a direct channel back for the query results. The application runs a SQL query with your input, but the response doesn't render the result or leak database errors. The canonical example is a cookie tracking ID: the ID gets used in a SQL query on every request, but the query output is …



Tags:    security    sql injection    sqli    blind sqli    portswigger    burp suite   


SQL Injection UNION Attacks: Turning a Product Listing Into a User Dump

Posted in Security

permalink

Part 3 of our PortSwigger Web Security Academy series. Part 2 sketched the four SQL injection shapes at a bird's-eye view. This post drills into one of them: the UNION attack. It is one of the most useful shapes to understand because it converts a small SQLi foothold into an "I can read anything in the database" primitive.

Wiki reference: SQL Injection/UNION Attack.

The Idea

Say a page runs

SELECT name, description FROM products WHERE category = 'Gifts'

The columns you can see in the response are name and description, because that is what the query is selecting. UNION lets …



Tags:    security    sql injection    sqli    union    portswigger    burp suite   


SQL Injection Fundamentals: Four Attack Shapes

Posted in Security

permalink

This is part 2 of our series on working through the PortSwigger Web Security Academy. This one covers SQL injection at a bird's-eye view - the four main attack shapes that show up over and over, with the smallest possible example of each. Later posts will drill into specific attack types.

Full notes on our wiki: SQL Injection.

What SQL Injection Is

SQL injection is a web security bug that lets attackers execute their own SQL against your database, by taking advantage of user inputs that are not sanitized before being pasted into a SQL query.

The reason it is worth …



Tags:    security    sql injection    sqli    portswigger    web security    owasp