Reading columns and their data
In this section, lets see whether we can select
and have a look at all the details that exist within the accounts
table. Let's see whether we can query the database and read the information stored in the accounts
table. To do that, we need to know the names of the columns that exist within the accounts
table because, if we look at the way we're using our statement, we're performing union select table_name from information_schema.tables
, so we still don't know what columns exist in the accounts
table. We can guess that there is a username and a password, but sometimes they could have different names, so we're going to see how we can select
the columns for a certain table.
The command is going to be very similar to the tables
command we used in the preceding section, the only difference is instead of table_name
, we're going to type column_name
, and instead of selecting it from information_schema.tables
, we're going to select it from information_schema.columns
...