Skip to content
SQL injection Write-up Advanced

Sqli Next Level

A SQL injection existed in the Sort and Order parameters of a search filter, but the Filter parameter was obfuscated client-side. The author bypassed the obfuscation by modifying the JavaScript encryption function in the browser's developer tools, then automated exploitation by using a Burp extension to re-encrypt SQLMap payloads.

Rend Follow

Published on infosecwriteups.com

There are some SQL injections that exploiting them are not as straightforward as what you see in the ethical hacking courses. like when the value of the vulnerable parameter is base64 encoded. what do you do in that cases?

Rend, on infosecwriteups.com

The full write-up lives on its author's site

It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely the application relied on client-side obfuscation of the SQL query without any server-side validation or parameterisation, and the Sort and Order parameters were directly concatenated into the SQL query.

Impact

An attacker could read data from the database, as demonstrated by the successful boolean-based injection.

What the attacker needed

Access to the application; ability to intercept and modify requests

The fix

The application should use parameterised queries and not rely on client-side obfuscation for security.

How it was found

  1. Observe that the Filter parameter is base64-encoded and encrypted, and that the Sort and Order parameters are injectable.
  2. Confirm injection by commenting out part of the query using /* and */ in the Sort and Order parameters.
  3. Search for the encrypted value in the server's response; not finding it indicates client-side encryption.
  4. Use Chrome DevTools to set a breakpoint in the encryption function and replace the argument with a custom SQL payload.
  5. Use a boolean-based injection to confirm the vulnerability and determine the DBMS is SQL Server.
  6. Automate with SQLMap by using a Burp extension to re-encrypt payloads on the fly.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

A SQL injection lets an attacker insert database commands into a web form. Here, the application tried to hide the database query by scrambling it in the browser, but the attacker found the scrambling code and used it to send their own malicious queries. This allowed them to read data from the database.

What is SQL injection?

Input reaches a database query as code, letting an attacker read or change data the application never meant to expose.

More by Rend

View all

2 more disclosed reports, best first.

Similar reports

View all

Same bug class and techniques, clearest first.

SQL injection

The lesson behind this report.

Input reaches a database query as code, letting an attacker read or change data the application never meant to expose.