A Quite Rare MSSQL Injection
A parameter was vulnerable to blind SQL injection, but standard tools like SQLMap did not work. The author found that comparing built-in Transact-SQL integer variables (such as @@TEXTSIZE and @@LANGID) produced a true/false difference, allowing a working proof of concept.
Few ways tried but none were successful in order for me to provide a working POC to the program. Further analysis I noticed that, the application was actually only able to response integervalue with the user's privilege in used.
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 concatenated user input directly into a SQL query without proper parameterisation, and the database user could read built-in integer variables.
Impact
An attacker could confirm a blind SQL injection and potentially extract information, though the report only demonstrates a true/false oracle.
What the attacker needed
Access to the vulnerable parameter
How it was found
- Send a request with a true condition using LIKE to see the page load normally.
- Send a request with a false condition using LIKE to see a blank page.
- Try comparing two built-in integer variables to get a true/false difference.
- Confirm with another built-in variable to avoid a false positive.
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 blind SQL injection is when an attacker can ask the database true/false questions through a web page, even though the page does not show database output. Here, normal tools failed, but comparing two built-in numbers that SQL Server always provides made the page load normally or go blank, proving the injection.
What is SQL injection?
Input reaches a database query as code, letting an attacker read or change data the application never meant to expose.