Explore our new Cybersecurity Terms Glossary, explained by our experts.

View the Glossary View the Glossary
PRIVIA

Cybersecurity Terms Glossary

What Is sqlmap?

sqlmap automates the detection and exploitation of SQL injection flaws, confirming whether a parameter is vulnerable and demonstrating what an attacker could reach through it.

Illustration for the cybersecurity term sqlmap
Home / Blog / Cybersecurity Terms / What Is sqlmap?
17 November 2026

What Is sqlmap?

What Is sqlmap?

sqlmap is an open-source tool that finds and exploits SQL injection. Point it at a request with a parameter, and it will work out whether that parameter reaches a database query, which database engine sits behind it, which injection technique works, and what can be extracted as a result. It has been in development since 2006 and remains the reference implementation for this class of testing.

Injection has been on the OWASP Top 10 since the list began, and despite twenty years of warnings it keeps appearing. The ICO fined TalkTalk £400,000 in October 2016 after an attack in which SQL injection against inherited web pages exposed the personal data of 156,959 customers, including bank details for a subset of them. The underlying vulnerability was in software that had not been patched since 2009.

The Techniques It Tries

TechniqueHow it extracts data
Boolean-based blindAsks true or false questions and reads the answer from how the page changes
Time-based blindAsks the database to pause when a condition is true, and times the response
Error-basedProvokes a database error message that carries data inside it
UNION queryAppends a second query whose results appear in the page output
Stacked queriesExecutes an additional statement entirely, where the driver allows it
Out-of-bandCauses the database to make a DNS or HTTP request carrying the data

Blind techniques matter because they work when the application shows nothing useful. A page that returns the same response whether a query succeeds or fails still leaks data one bit at a time if the timing differs, which is why “the error messages are suppressed” is not a fix.

How It Is Used in Testing

A tester normally captures the request in an intercepting proxy, saves it to a file, and gives that file to sqlmap so that cookies, headers, and the exact body are preserved. Risk and level settings control how aggressive the testing is and how many injection points are probed, and tamper scripts transform payloads to get past filtering.

Once injection is confirmed, the tool enumerates databases, tables, and columns, and can retrieve rows. On a professional engagement this stops early and deliberately: the finding is proven by retrieving the database version and a count of rows, not by dumping a customer table. Extracting personal data that the client has not asked you to touch creates a UK GDPR problem for everyone involved, which is why the rules of engagement should state exactly how far proof of concept may go.

The tool also supports privilege-dependent features such as reading files from the database server and obtaining an interactive shell. These are usually out of scope on production systems because of the potential for damage.

What It Tells a Defender

Every sqlmap finding has the same root cause: user input reaching a query as code rather than as data. The fix is also the same.

Detecting It in Your Logs

Automated injection testing is loud. The signature pattern is a large number of requests to one endpoint with systematically varied parameter values, often within seconds. Look for SQL keywords and comment markers in parameters, repeated requests whose response times cluster around a round number of seconds, which indicates time-based probing, and spikes in database error rates.

Default scanner user agents are trivially changed, so do not rely on them. Request volume per parameter, response time anomalies, and unusual DNS lookups originating from the database server are more durable signals. Feed web server and application logs into a SIEM with rules for these patterns, and the next attempt will be visible while it is happening.

Our Web Application Security Services test injection paths manually as well as with automation, because the cases that scanners miss are usually the ones that matter.

FAQ – Frequently Asked Questions

Does a Web Application Firewall Stop sqlmap?

It raises the effort rather than removing the risk. Generic filters block obvious payloads, which stops opportunistic scanning, but sqlmap ships with tamper scripts designed to evade exactly those rules through encoding, comment insertion, and case variation. Treat a firewall as a layer that buys time and generates alerts, and fix the underlying query construction.

Is It Legal to Run sqlmap?

Running it against your own systems, or against a client’s with written authorisation, is lawful. Running it against anybody else’s application is unauthorised access under the Computer Misuse Act 1990, and extracting data compounds the offence. The tool makes no distinction, so the authorisation paperwork is what separates a penetration test from a crime.

How Do Parameterised Queries Prevent Injection?

The database receives the query structure and the user-supplied values separately. The statement is compiled before any value is bound, so input can never alter the query’s logic no matter what characters it contains. This removes the vulnerability class entirely, which is why it is preferred over filtering, escaping, or blocklisting dangerous strings.

Can sqlmap Find Every Injection Flaw?

No. It excels at parameters it is pointed at in requests it can replay, but it will miss injection reachable only through multi-step business logic, second-order injection where input is stored and used later, and flaws in parameters it never sees. Manual testing by someone who understands the application remains necessary.

Related Terms

You May Be Interested In These

What Is DMARC?

Cybersecurity Terms

17 November 2026

What Is DMARC?

Read More
What Is Heartbleed?

Cybersecurity Terms

17 November 2026

What Is Heartbleed?

Read More
What Is Attribution in Cybersecurity?

Cybersecurity Terms

17 November 2026

What Is Attribution in Cybersecurity?

Read More