当前位置:网站首页>[JS 100 examples of reverse] anti climbing practice platform for net Luozhe question 5: console anti debugging

[JS 100 examples of reverse] anti climbing practice platform for net Luozhe question 5: console anti debugging

2022-06-23 21:28:00 Brother K reptile

Statement

All contents in this article are for learning and communication only , The content of the package 、 Sensitive website 、 All data interfaces have been desensitized , It is strictly prohibited to use for commercial and illegal purposes , Otherwise, all the consequences have nothing to do with the author , If there is infringement , Please contact me to delete !

Reverse target

  • The goal is : Question 5 of the web crawler anti crawler practice platform : Console de debugging
  • link :http://spider.wangluozhe.com/challenge/5
  • brief introduction : Open the browser console , Console Console Position output bbbb0 Visible answer , Fill in the answer and submit it .
01.png

Reverse process

Let's just open the console , Found that the right button cannot be used , direct F12, The page will jump directly to the home page , No big problem , Start a new page , To open the first F12 Then enter the page , At this point, you can see that the console is crazy output div label , As shown in the figure below :

02.png

What's embarrassing here is , Although the console is constantly brushing div, But it doesn't have much impact on our input , Direct input bbbb[0], Look up , You can see the answer , Or just type in copy(bbbb[0]) Just copy the answer directly to the pasteboard . As shown in the figure below :

03.png

I don't know why , It's possible that the problem is not standardized, so let's directly exploit the loophole , The author's original intention should be to let us get rid of this infinite brush div The situation of , Then go to get the answer , So let's analyze the source code , You can see the output div All the ways 5.js in , Just click in , It's a setInterval Timer method :

04.png

There are many ways to deal with :

  1. Hook Timer , Will output div Delete ;
  2. Replace JS Code , Direct timer or output div Delete ;
  3. Direct console Hook, Set the timer method to null .

This time we are directly on the console Hook, Set the timer to empty , Note here , If the program has entered the timer , Again Hook It is no use , So the right thing to do is in front of the timer , such as let div The next breakpoint , Refresh web page , Input again at the console setInterval = function() {}; Set the timer to empty , Then release the breakpoint input bbbb[0] Get answers :

05.png
06.png

We noticed an error on the console Uncaught SyntaxError: Identifier 'div' has already been declared, This is because in the JS And page HTML Each of them made a statement in div As a result of , On page HTML An error will be reported when you make a statement again in , It has no effect on the acquisition of our results . thus , The analysis of this problem is finished . Answer submitted successfully :

07.png
原网站

版权声明
本文为[Brother K reptile]所创,转载请带上原文链接,感谢
https://yzsam.com/2021/12/202112241122317278.html