2014-08-07: 细节已通知厂商并且等待厂商处理中 2014-08-08: 厂商已经确认,细节仅向厂商公开 2014-08-11: 细节向第三方安全合作伙伴开放 2014-10-02: 细节向核心白帽子及相关领域专家公开 2014-10-12: 细节向普通白帽子公开 2014-10-22: 细节向实习白帽子公开 2014-11-05: 细节向公众公开
绕过过滤再来一发。。
问题页面:发表文章news.php :
$news['cs_content']=$this->CsdjSkins->uhtml($this->input->post('cs_content')); //内容
过滤代码:
function uhtml($str) { $farr = array( "/\\s+/", //过滤多余的空白 "/<(\\/?)(script|i?frame|style|html|body|title|link|meta|\\?|\\%)([^>]*?)>/isU", //过滤 <script 等可能引入恶意内容或恶意改变显示布局的代码,如果不需要插入flash等,还可以加入<object的过滤 "/(<[^>]*)on[a-zA-Z]+\\s*=([^>]*>)/isU", //过滤javascrīpt的on事件 ); $tarr = array( " ", " ", "\1\2", ); $str = preg_replace( $farr,$tarr,$str); return remove_xss($str); } //xss过滤函数 function remove_xss($string) { $string = preg_replace('/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F]+/S', '', $string); $parm1 = Array('javascript', 'vbscript', 'expression', 'applet', 'meta', 'xml', 'blink', 'link', 'script', 'embed', 'object', 'iframe', 'frame', 'frameset', 'ilayer', 'layer', 'bgsound', 'title', 'base'); $parm2 = Array('onabort', 'onactivate', 'onafterprint', 'onafterupdate', 'onbeforeactivate', 'onbeforecopy', 'onbeforecut', 'onbeforedeactivate', 'onbeforeeditfocus', 'onbeforepaste', 'onbeforeprint', 'onbeforeunload', 'onbeforeupdate', 'onblur', 'onbounce', 'oncellchange', 'onchange', 'onclick', 'oncontextmenu', 'oncontrolselect', 'oncopy', 'oncut', 'ondataavailable', 'ondatasetchanged', 'ondatasetcomplete', 'ondblclick', 'ondeactivate', 'ondrag', 'ondragend', 'ondragenter', 'ondragleave', 'ondragover', 'ondragstart', 'ondrop', 'onerror', 'onerrorupdate', 'onfilterchange', 'onfinish', 'onfocus', 'onfocusin', 'onfocusout', 'onhelp', 'onkeydown', 'onkeypress', 'onkeyup', 'onlayoutcomplete', 'onload', 'onlosecapture', 'onmousedown', 'onmouseenter', 'onmouseleave', 'onmousemove', 'onmouseout', 'onmouseover', 'onmouseup', 'onmousewheel', 'onmove', 'onmoveend', 'onmovestart', 'onpaste', 'onpropertychange', 'onreadystatechange', 'onreset', 'onresize', 'onresizeend', 'onresizestart', 'onrowenter', 'onrowexit', 'onrowsdelete', 'onrowsinserted', 'onscroll', 'onselect', 'onselectionchange', 'onselectstart', 'onstart', 'onstop', 'onsubmit', 'onunload', 'onprogress', 'alert'); $parm = array_merge($parm1, $parm2); for ($i = 0; $i < sizeof($parm); $i++) { $pattern = '/'; for ($j = 0; $j < strlen($parm[$i]); $j++) { if ($j > 0) { $pattern .= '('; $pattern .= '(&#[x|X]0([9][a][b]);?)?'; $pattern .= '|(�([9][10][13]);?)?'; $pattern .= ')?'; } $pattern .= $parm[$i][$j]; } $pattern .= '/i'; $string = preg_replace($pattern, '', $string); } return $string; }
可以看出,只是将字符串中script、alert等关键字去掉。绕过字符串:
<scrscriptipt>aleralertt(/UncleJim/)</scriscriptpt>UncleJim
在script中再嵌一个script即可绕过~
客户端的编辑器会编码一次,所以通过抓包修改即可:
贵公司招安全么?
危害等级:高
漏洞Rank:20
确认时间:2014-08-08 10:01
感谢感谢,已经修复~!
暂无