来源:自学PHP网 时间:2015-04-15 15:00 作者: 阅读:次
[导读] TinyShop Sql Injection 1(无视GPC)详细说明:后台登陆界面存在检查功能,不安全取值导致的SQL注入。 controller controller_class php public function check() {...
|
后台登陆界面存在检查功能,不安全取值导致的SQL注入。
/controller/controller_class.php
public function check()
{
$this->safebox = Safebox::getInstance();
$this->title='后台登录';
$code = $this->safebox->get($this->captchaKey);
if($code != strtolower(Req::args($this->captchaKey)))
{
$this->msg='验证码错误!';
$this->layout = "";
$this->redirect('login',false);
}
else
{
$manager = new Manager(Req::args('name'),Req::args('password'));
$this->msg='验证码错误!';
if($manager->getStatus() == 'online')
{
$back = Req::args('callback');
$model = new Model("manager");
$model->data(array('last_ip'=>Chips::getIP(),'last_login'=>date("Y-m-d H:i:s")))->where("id=".$manager->id)->update();
//这里有一个getIP函数,跟入。
if($back === null) $back = $this->defaultAction;
$this->redirect($back,true);
}
else
{
$this->msg='用户名或者密码错误';
$this->layout = "";
$this->redirect('login',false);
}
}
}
修复方案:获取转义 |
自学PHP网专注网站建设学习,PHP程序学习,平面设计学习,以及操作系统学习
京ICP备14009008号-1@版权所有www.zixuephp.com
网站声明:本站所有视频,教程都由网友上传,站长收集和分享给大家学习使用,如由牵扯版权问题请联系站长邮箱904561283@qq.com