文件/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); } } } 当输入用户名和email之后就会发送新密码到email 然后新密码是6位纯数字: $arr['password']=rand(100000,999999); 所以导致在知道用户名和email的情况下课爆破处用户的新密码。 再者就是,对于用户名和email,因为这是人才系统,在用户简历中存在用户名和email信息 只要注册企业用户就能看到用户的用户名和email等信息,为重置密码提供便捷。如图: 最后就是剩下的,来爆破重置之后的密码了,因为此系统安装后默认是不开启登陆验证码的,就算开启验证码我们也可以进行爆破。 接口:http://localhost/74cms/wap/wap_login.php
找回用户111111的密码: 然后来爆破密码:
成功得到用户新密码 修复方案:加强用户的新密码负责度 |
-
上一篇: 大汉版通jvideo系统SQL注射 - 网站安全 - 自学php
下一篇: 一种全新的黑客攻击方法-Java Web表达式注入 - 网
还没有人抢沙发呢~