来源:自学PHP网 时间:2015-04-15 15:00 作者: 阅读:次
[导读] 文件 user user_getpass php 找回密码第2步elseif ($act== 39;get_pass 39;){$captcha=get_cache( 39;captcha 39;);$postcaptcha = trim($_POST[ 39;postcaptcha 39;]);if($captcha[ 39;verify_getpw...
文件/user/user_getpass.php //找回密码第2步 elseif ($act=='get_pass') { $captcha=get_cache('captcha'); $postcaptcha = trim($_POST['postcaptcha']); if($captcha['verify_getpwd']=='1' && empty($postcaptcha)) { showmsg("请填写验证码",1); } if ($captcha['verify_getpwd']=='1' && strcasecmp($_SESSION['imageCaptcha_content'],$postcaptcha)!=0) { showmsg("验证码错误",1); } $postusername=trim($_POST['username'])?trim($_POST['username']):showmsg('请输入用户名!',1); if (empty($_POST['email']) || !preg_match("/^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/",$_POST['email'])) { showmsg('电子邮箱格式错误!',1); } require_once(QISHI_ROOT_PATH.'include/fun_user.php'); $userinfo=get_user_inusername($postusername); if (empty($userinfo) || $userinfo['email']<>$_POST['email']) { showmsg('用户名或注册邮箱填写错误',1); } else { $mailconfig=get_cache('mailconfig'); $arr['username']=$userinfo['username']; $arr['password']=rand(100000,999999); if (smtp_mail($userinfo['email'],"找回密码","您的新密码为:".$arr['password'])) { $md5password=md5(md5($arr['password']).$userinfo['pwd_hash'].$QS_pwdhash); if (!$db->query( "UPDATE ".table('members')." SET password = '$md5password' WHERE uid='{$userinfo['uid']}'")) { showmsg('密码修改失败',1); } $smarty->assign('step',"2"); $smarty->assign('email',$userinfo['email']); $smarty->assign('title','找回密码 - '.$_CFG['site_name']); $smarty->display('user/getpass.htm'); } else { showmsg('邮件发送失败,请联系网站管理员',0); } } }
最后就是剩下的,来爆破重置之后的密码了,因为此系统安装后默认是不开启登陆验证码的,就算开启验证码我们也可以进行爆破。
找回用户111111的密码: 然后来爆破密码:
成功得到用户新密码 修复方案:加强用户的新密码负责度 |
自学PHP网专注网站建设学习,PHP程序学习,平面设计学习,以及操作系统学习
京ICP备14009008号-1@版权所有www.zixuephp.com
网站声明:本站所有视频,教程都由网友上传,站长收集和分享给大家学习使用,如由牵扯版权问题请联系站长邮箱904561283@qq.com