Skip to content

Error-based SQLi not found due to use of LIKE statement #4221

@mrnfrancesco

Description

@mrnfrancesco

During a penetration test sqlmap (version 1.4.5#stable) failed at finding an error-based SQLi.

In the screenshot below you can see a MSSQL error due to incorrect syntax using a single quote in the "Ticket" input field.

sql-injection

From the correct output (I'm sorry, but I cannot show you it), it is clear the query is using LIKE statement to search for a valid ticket.

Using a payload like whatever' AND 1=@@version AND 'a%'='a I correctly see the MSSQL banner (note the % in the last condition):

sql-injection-exploited

It seems sqlmap is not able to find this because when testing for "AND error-based" SQLi it uses a payload like ' AND <payload> AND 'Ctxm'='Ctxm, but this fails because the app is not just adding a single quote to the query, but a %' (percent sign, single quote) sequence.

Metadata

Metadata

Assignees

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions