bugku 点击一百万次

点击一百万次

80

http://120.24.86.145:9001/test/

hints:JavaScript

查看源代码


<!DOCTYPE html>
<html>
  <style>
    h1{
      color: white;
      text-align: center;
    }
    body{
      background-color: black;
    }
    img{
      display: block;
      margin: 0 auto;
    }
    #flag{
    	color: white;
      text-align: center;
      display: block;
    }
  </style>
  <head>
    <meta charset="utf-8"
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <script src="jquery-3.2.1.min.js"></script>
    <title>点击一百万次</title>
  </head>
  <body>
    <h1 id="goal">Goal: <span id="clickcount">0</span>/1000000</h1>
    <img id="cookie" src="cookie.png">
    <span id="flag"></span>
  </body>
  <script>
    var clicks=0
    $(function() {
      $("#cookie")
        .mousedown(function() {
          $(this).width('350px').height('350px');
        })
        .mouseup(function() {
          $(this).width('375px').height('375px');
          clicks++;
          $("#clickcount").text(clicks);
          if(clicks >= 1000000){
          	var form = $('<form action="" method="post">' +
						'<input type="text" name="clicks" value="' + clicks + '" hidden/>' +
						'</form>');
						$('body').append(form);
						form.submit();
          }
        });
    });
  </script>
</html>

观察到点击1000000次后会执行

var form = $('<form action="" method="post">' +
						'<input type="text" name="clicks" value="' + clicks + '" hidden/>' +
						'</form>');
						$('body').append(form);
						form.submit();

也就是向当前url以post方法发送clicks的次数,直接用hackbar以post方法发送clicks=10000000,即可

猜你喜欢

转载自blog.csdn.net/Ruhe_king/article/details/82503448