Course contentsShow
← Security
Lesson 576 of 3,05213. Web Security - Injection AttacksFree lesson

Time-Based Blind SQLi

Using database delay functions to infer information when no visible output changes occur.

Time-Based Blind SQLi

What you'll learn: How attackers force databases to delay responses to extract data when the application shows no visible difference between true and false conditions.

The Core Idea

In Time-Based Blind SQL Injection, you've hit a wall: the application looks exactly the same whether your injected condition is true or false. No error messages, no content changes, nothing. Your only tool left is time itself.

You inject SQL commands that make the database pause (sleep) when a condition is true. By measuring whether the response arrives instantly or after a delay, you can extract information one bit at a time.

Analogy: Imagine asking someone a yes/no question, but they can only respond by either answering immediately (no) or waiting 5 seconds before answering (yes). You'd learn their answer by timing their response.

How It Works

Most databases have built-in delay functions:

  • MySQL: SLEEP(5) pauses for 5 seconds
  • PostgreSQL: pg_sleep(5)
  • SQL Server: WAITFOR DELAY '00:00:05'

You inject these conditionally: "If the first character of the admin password is 'a', sleep for 5 seconds."

If the response takes 5+ seconds, you know the condition was true. If it's instant, it was false. Repeat for every character, every piece of data you want.

Why This Matters

When Boolean-Based Blind SQLi fails because the application is too uniform, time-based techniques remain viable. They're slower (extracting one database byte-by-byte using delays takes time), but they work even when you have zero visible feedback.

Key Takeaway: Time-Based Blind SQL Injection uses database delay functions to turn response time into a covert communication channel, allowing attackers to extract data even from completely uniform-looking applications.