I am studiying SQLInjection in some training webpages (so I don't know what is the backend). I am triying next injection to get de DB type.
(1) http://url/?departamento=1 union select user()
By this way, if the DB is MySQL, I should get some results. However, I don't see any results. If I change the injection to this new sentence, the data is returned correctly, so the DB is MySQL (Even I can see the DB name with this new injection):
(2) http://url/?departamento=1 union select 1,user()
Nevertheless, If I change again the injection to one of these the results change.
(3) http://url/?departamento=1 union select 1,2,user() (I don't see any data)
(4) http://url/?departamento=1 union select user(),2 (Here I don't see the DB name)
I don't understand why should I add (in the 2nd select statement) more columns to see the data. Why is this happening?
Thanks!