### 简要描述: LebiShop商城系统最新版多处SQL注入七 ### 详细说明: LebiShop商城系统最新版多处SQL注入 这里也是需要有商家账号权限 首先注册普通用户账户,然后申请注册商家账户 申请商家用户是默认开发注册的 第一个地方我们来看:Shop.Supplier.Ajax.ajax_order文件 下面依次列举出存在SQL注入的方法 Bank_Del方法 ``` // Shop.Supplier.Ajax.ajax_order public void Bank_Del() { if (!base.Power("supplier_bank_list", "付款账号")) { base.AjaxNoPower(); return; } string id = RequestTool.RequestString("Fid"); if (id == "") { base.Response.Write("{\"msg\":\"" + base.Tag("请选择要删除的信息") + "\"}"); return; } B_Lebi_Supplier_Bank.Delete(string.Concat(new object[] { "id in (", id, ") and Supplier_id = ", this.CurrentSupplier.id })); Log.Add("删除付款方式", "Bank", id.ToString(), this.CurrentSupplier, id.ToString()); base.Response.Write("{\"msg\":\"OK\"}"); } ``` BillType_Del方法 ``` // Shop.Supplier.Ajax.ajax_order public void BillType_Del() { if (!base.Power("supplier_billtype_list", "发票管理")) { base.AjaxNoPower(); return; } string id = RequestTool.RequestString("Fid"); if (id == "") { base.Response.Write("{\"msg\":\"" +...
### 简要描述: LebiShop商城系统最新版多处SQL注入七 ### 详细说明: LebiShop商城系统最新版多处SQL注入 这里也是需要有商家账号权限 首先注册普通用户账户,然后申请注册商家账户 申请商家用户是默认开发注册的 第一个地方我们来看:Shop.Supplier.Ajax.ajax_order文件 下面依次列举出存在SQL注入的方法 Bank_Del方法 ``` // Shop.Supplier.Ajax.ajax_order public void Bank_Del() { if (!base.Power("supplier_bank_list", "付款账号")) { base.AjaxNoPower(); return; } string id = RequestTool.RequestString("Fid"); if (id == "") { base.Response.Write("{\"msg\":\"" + base.Tag("请选择要删除的信息") + "\"}"); return; } B_Lebi_Supplier_Bank.Delete(string.Concat(new object[] { "id in (", id, ") and Supplier_id = ", this.CurrentSupplier.id })); Log.Add("删除付款方式", "Bank", id.ToString(), this.CurrentSupplier, id.ToString()); base.Response.Write("{\"msg\":\"OK\"}"); } ``` BillType_Del方法 ``` // Shop.Supplier.Ajax.ajax_order public void BillType_Del() { if (!base.Power("supplier_billtype_list", "发票管理")) { base.AjaxNoPower(); return; } string id = RequestTool.RequestString("Fid"); if (id == "") { base.Response.Write("{\"msg\":\"" + base.Tag("请选择要删除的信息") + "\"}"); return; } B_Lebi_Supplier_BillType.Delete(string.Concat(new object[] { "id in (", id, ") and Supplier_id = ", this.CurrentSupplier.id })); Log.Add("删除发票类型", "BillType", id.ToString(), this.CurrentSupplier, id.ToString()); base.Response.Write("{\"msg\":\"OK\"}"); } ``` Comment_Del方法 ``` // Shop.Supplier.Ajax.ajax_order public void Comment_Del() { if (!base.Power("supplier_order_comment_del", "删除订单留言")) { base.AjaxNoPower(); return; } string ids = RequestTool.RequestString("commid"); if (ids != "") { B_Lebi_Comment.Delete(string.Concat(new object[] { "Supplier_id = ", this.CurrentSupplier.id, " and id in (", ids, ")" })); } Log.Add("删除订单留言", "Comments", ids.ToString(), this.CurrentSupplier, ""); base.Response.Write("{\"msg\":\"OK\"}"); } ``` Express_Log_Add方法 ``` // Shop.Supplier.Ajax.ajax_order public void Express_Log_Add() { if (!base.Power("supplier_express_print", "打印清单")) { base.AjaxNoPower(); return; } string id = RequestTool.RequestString("ids"); if (id == "") { base.Response.Write("{\"msg\":\"请先选择订单\"}"); return; } List<Lebi_Order> orders = B_Lebi_Order.GetList(string.Concat(new object[] { "Supplier_id = ", this.CurrentSupplier.id, " and id in (", id, ")" }), ""); ``` Express_Log_Del方法 这里存在两处SQL注入 ``` // Shop.Supplier.Ajax.ajax_order public void Express_Log_Del() { if (!base.Power("supplier_express_print", "打印清单")) { base.AjaxNoPower(); return; } string id = RequestTool.RequestString("ids"); if (id == "") { base.Response.Write("{\"msg\":\"请选择要删除的打印清单\"}"); return; } B_Lebi_Express_Log.Delete(string.Concat(new object[] { "Supplier_id = ", this.CurrentSupplier.id, " and id in (", id, ")" })); B_Lebi_Express_LogList.Delete(string.Concat(new object[] { "Supplier_id = ", this.CurrentSupplier.id, " and Express_Log_Id in (", id, ")" })); Log.Add("删除打印清单", "Express_Log", id.ToString(), this.CurrentSupplier, ""); base.Response.Write("{\"msg\":\"OK\"}"); } ``` 其余存在SQL注入漏洞的方法还有 ``` Express_Log_Update方法 Express_LogList_Del方法 Express_Print方法 Express_Shipper_Del方法 Express_Shipper_Update方法 OrderPro_Del方法两处SQL注入 OrderPro_Edit方法 ``` 这些就不在依依列举代码实例 第二个地方我们来看:Shop.Supplier.Ajax.ajax_supplier文件 Group_Del方法 ``` // Shop.Supplier.Ajax.ajax_supplier public void Group_Del() { string id = RequestTool.RequestString("id"); if (!base.Power("supplier_group_del", "删除用户分组")) { base.AjaxNoPower(); return; } if (id != "") { List<Lebi_Supplier_UserGroup> models = B_Lebi_Supplier_UserGroup.GetList("id in (" + id + ")", ""); ``` User_Del方法 ``` // Shop.Supplier.Ajax.ajax_supplier public void User_Del() { string ids = RequestTool.RequestString("ids"); if (!base.Power("supplier_user_del", "删除用户分组")) { base.AjaxNoPower(); return; } if (ids != "") { B_Lebi_Supplier_User.Delete(string.Concat(new object[] { "id in (", ids, ") and User_id!=", this.CurrentSupplier.User_id })); Log.Add("删除用户", "Supplier_User", ids, this.CurrentSupplier, "用户:" + this.CurrentUser.UserName); } base.Response.Write("{\"msg\":\"OK\"}"); } ``` 上述SQL注入都是在通过RequestTool.RequestString方法获取参数值 这里只是进行了单引号的转义 然后参数值进入了数据库执行的in条件SQL语句 在in条件语句中没有单引号保护,导致RequestTool.RequestString的处理无效 导致恶意sql语句进入sql条件语句中,最终导致SQL注入产生 ### 漏洞证明: 官方demo证明 第一个地方以Express_Shipper_Update方法证明 [<img src="https://images.seebug.org/upload/201501/201758316dabf1456388834c67da61eb2197a025.png" alt="1.png" width="600" onerror="javascript:errimg(this);">](https://images.seebug.org/upload/201501/201758316dabf1456388834c67da61eb2197a025.png) 成功爆出version信息 第二个地方我们使用User_Del方法证明 [<img src="https://images.seebug.org/upload/201501/201758582b2a5c74ac3ce01f5dbe1c8eb66ad311.png" alt="2.png" width="600" onerror="javascript:errimg(this);">](https://images.seebug.org/upload/201501/201758582b2a5c74ac3ce01f5dbe1c8eb66ad311.png) 成功爆出当前数据库信息