Michael BestMan Osemudiamen
Posted: February 23, 2026 • 3 min read
Many times, the root for a successful attack begins with an attacker testing a hypothesis. If the specific condition is true, will the system behave differently? If it returns as true, then a vulnerability has been successfully verified. SQL injection, for instance, uses the same logic. As one of the OWASP Top 10 threats to web applications, it involves exploiting improper input validation to manipulate backend database queries.
While this post documents a successful proof-of-concept (PoC) involvingTime-Based Blind SQLi from manually verifying to a point of exfiltration using SQLmap, it is important to note that “blind” means the database responds by behaviour rather than text. .
To ensure a controlled testing environment, the following was utilized:
Also, there are two main phases in the lab demonstration:
Note: To show the timing or HTTP headers, navigate to your preferred web browser’s menu. Find “more tools”, click Developer Tools and click the “Network Tab”. Also ensure you practise in a sandboxed environment as it is illegal to perform this on real systems without authorised permission. The screenshot below is for the Firefox browser. Interfaces for other browsers may differ.
In this phase, we confirm the response of the application and identify anomalies. First we navigate to the SQL Injection Blind module in the DVWA. Then, begin by using a valid User Id.
In the screenshot below, the ID is set to 1, which outputs: “the user ID exists in the database”. If we check the time of response via the Network Tab, we notice the response time is less than 100 milliseconds. This means the response from the server was instant.
However, when we inject the payload 1 AND (SELECT 1 FROM (SELECT (SLEEP(5)))a)-- into the input, it induces a latency. This confirms the application is vulnerable or shows its susceptibility to the blind injection attack.
Code breakdown:
In this case,'Miles' is the string literal. That is, the database treats “Miles” as a name to look up, not a command to execute. So when codes are written, templates like this are used by developers to define the boundary:
But when an attacker inputs1 'OR '1'='1 the database logically receives SELECT * FROM products WHERE id = '1' OR '1'='1'; which closes the boundary quite earlier, makes the database assume the string literal is finished and interprets everything after the quote as an active SQL logic or command.
This part of the command is what triggers a delay.
Once the above commands are injected into the input field, the page takes 5 secs to load. This confirms the site is vulnerable to SQL injection. By simply asking the database questions, using Boolean values, sensitive data like passwords can be extracted. This means the SLEEP command was executed.
As a mechanism, the SLEEP(5) function instructs the MariaDB backend to pause for 5 seconds if the statement is true. And the result showed the browser tab loads exactly 5.01 seconds. This confirms that the database executed the injected code.
In the initial phase, our first strike was confirming the vulnerability. To extract the contents from the database, we utilize SQLmap. However, three methods were executed:
PHPSESSID = PHP Session ID
Security = low
Once we have the session ID and security, we move into enumeration where we scan the database by automating the detection and exploitation of the SQLi vulnerabilities:
Code Breakdown
Adding the -D dvwa -T users --dump we say: locate the specific database, find the
table named users, and extract all the data. This will output:
From the screenshot above, we can see the list of users, their password hashes and even imagesattached to them
From this lab, it is clear that with a blind SQLi, where data is not visible on the screen, a database can be successfully compromised. As exemplified by the OWASP Top 10, the best way to secure an organisations defense against these injection attacks is to use Prepared Statements or Parameterized Queries. This separates the query logic from the data by ensuring the input is never interpreted as a command. This can be secured with PHP Data Objects Implementation
Secure PDO Implementation:
To break this down:
user_id matches the provided value.With this, the database reads the command logic and treats the entire input as a single, harmless text.
As is evident from the demonstration, even a 'blind' vulnerability can result in a full-scale breach. Time-based SQL injection is a highly dangerous form of attack because it doesn't reveal any error, allowing an attacker to steal critical user information, hashes, and even credentials behind the scenes. This is not merely a problem from a technological standpoint; it is a problem from a legal, customer trust, and brand reputation standpoint.
Manual verification and tools such as SQLmap are great tools to detect vulnerabilities. However, true security is achieved through a proactive approach. This is where Reinvent Security gives a resounding advantage through: