pikachu-暴力破解

1、验证码绕过(on-server)

 

 

 先看看提示,提示说验证码好像一直有效,那么这个验证码可能只需要验证一次之后可以重复利用

查看一下后端代码:

if(isset($_POST['submit'])) {
    if (empty($_POST['username'])) {
        $html .= "<p class='notice'>用户名不能为空</p>";
    } else {
        if (empty($_POST['password'])) {
            $html .= "<p class='notice'>密码不能为空</p>";
        } else {
            if (empty($_POST['vcode'])) {
                $html .= "<p class='notice'>验证码不能为空哦!</p>";
            } else {
//              验证验证码是否正确
                if (strtolower($_POST['vcode']) != strtolower($_SESSION['vcode'])) {
                    $html .= "<p class='notice'>验证码输入错误哦!</p>";
                    //应该在验证完成后,销毁该$_SESSION['vcode']
                }else{

                    $username = $_POST['username'];
                    $password = $_POST['password'];
                    $vcode = $_POST['vcode'];

                    $sql = "select * from users where username=? and password=md5(?)";
                    $line_pre = $link->prepare($sql);

                    $line_pre->bind_param('ss',$username,$password);

                    if($line_pre->execute()){
                        $line_pre->store_result();
                        //虽然前面做了为空判断,但最后,却没有验证验证码!!!
                        if($line_pre->num_rows()==1){
                            $html.='<p> login success</p>';
                        }else{
                            $html.= '<p> username or password is not exists~</p>';
                        }
                    }else{
                        $html.= '<p>执行错误:'.$line_pre->errno.'错误信息:'.$line_pre->error.'</p>';
                    }
                }
            }
        }
    }
}

给了一些提示,发现验证完验证码之后$_SESSION['vcode']的验证码值并没有得到销毁,

所以在验证码还没有刷新的时候可以一直利用第一次的验证码,只要对网页中的验证码进行了刷新之前的验证码就会失效

 

 

 

 2、验证码绕过(on-client)

看到on-client就知道是通过前端验证验证码,直接抓包爆破即可绕过

3、token防爆破

和之前DVWA的暴力破解High难度一样,抓取token参数即可爆破

posted @ 2021-01-26 00:05  1jzz  阅读(121)  评论(0编辑  收藏  举报