# 08CMS小说搜索型注入

**URL:** <https://forum.90sec.com/t/topic/3121>\
**Category:** 代码审计\
**Created:** [2011 年12 月 30 日 17:27 UTC](https://forum.90sec.com/t/topic/3121 "2011-12-30T17:27:20Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

作者： ![568241256](https://forum.90sec.com/letter_avatar_proxy/v4/letter/5/c6cbf5/32.png) [@568241256](https://forum.90sec.com/u/568241256)\
发布日期： [2011 年12 月 30 日 17:27 UTC](https://forum.90sec.com/t/topic/3121/1 "2011-12-30T17:27:20Z")

</div>

Vul Code:  
//搜索词预处理  
$searchword = empty($searchword) ? ” : cutstr(trim($searchword),50,”);  
$\_da['searchword'] = $searchword;  
if($searchword){  
$filterstr .= ($filterstr ? ‘&’ : ”).’searchword=’.rawurlencode(stripslashes($searchword));  
}  
//预处理搜索模式：标题subject、关键词keywords、内容fulltxt、会员mname  
$searchmode = empty($searchmode) ? ‘subject’ : trim($searchmode);  
if(!in\_array($searchmode,array(‘subject’,'keywords’,'fulltxt’,'mname’))) $searchmode = ‘subject’;

08CMS小说搜索型注入  
if(!$chid){  
$nochids = empty($nochids) ? ” : trim($nochids);  
if($nochids){//排除的模型  
$\_da['nochids'] = $nochids;  
$filterstr .= ($filterstr ? ‘&’ : ”).”nochids=”.$nochids;  
$nochids = explode(‘,’,$nochids);  
if($nochids) $wherestr .= ” AND a.chid “.multi\_str($nochids,1);  
}  
POC:  
出现搜索型注入。

08CMS小说搜索型注入  
[http://localhost/search.php?searchmode=subject&searchword=[%]&caid=0&chid=0&ccid4=0&indays=0&orderby=createdate&searchsubmit=1](http://localhost/search.php?searchmode=subject&searchword=%5B%25%5D&caid=0&chid=0&ccid4=0&indays=0&orderby=createdate&searchsubmit=1)

08CMS小说搜索型注入  
在searchword这出现问题

08CMS小说搜索型注入

---

<div class="post-metadata">

作者： ![wugui](https://forum.90sec.com/user_avatar/forum.90sec.com/wugui/32/11351_2.png) [@wugui](https://forum.90sec.com/u/wugui)\
发布日期： [2011 年12 月 31 日 04:16 UTC](https://forum.90sec.com/t/topic/3121/2 "2011-12-31T04:16:47Z")

</div>

这写转来的早看过了

---

<div class="post-metadata">

作者： ![network](https://forum.90sec.com/user_avatar/forum.90sec.com/network/32/11349_2.png) [@network](https://forum.90sec.com/u/network)\
发布日期： [2011 年12 月 31 日 04:24 UTC](https://forum.90sec.com/t/topic/3121/3 "2011-12-31T04:24:41Z")

</div>

我也早就看过了 呵呵！！！！！！！！！

---

<div class="post-metadata">

作者： ![user\_deleted](https://forum.90sec.com/letter_avatar_proxy/v4/letter/u/35a633/32.png) [@user\_deleted](https://forum.90sec.com/u/user_deleted)\
发布日期： [2012 年2 月 6 日 10:30 UTC](https://forum.90sec.com/t/topic/3121/4 "2012-02-06T10:30:51Z")

</div>

最近看代码都看到自己怕了
