Anti-plug-in and cracking of iframe

Source: Internet
Author: User
Tags sleep function

The soul of an empty prodigal soul

Read Monyer's article:

Iframe anti-plug and strong plug (2): The http://www.bkjia.com/Article/200902/31888.html code is as follows: JavaScript code
  1. <Script>
  2. Window. onload =Function(){
  3. If(Top! = Self ){
  4. VarF = document. createElement ("Form");
  5. F. action = location;
  6. F.tar get ="_ Parent";
  7. Document. body. appendChild (f );
  8. F. submit ();
  9. }
  10. };
  11. </Script>

Forced submission. I carefully read this article and then practiced it. I found that the two onloads will overwrite the previous onload.

And the protection code is in the "body" operation ".

Therefore, this code must be applied to the bottom of the page.

Look at the previous

Iframe protection plug and strong plug: http://www.bkjia.com/Article/200902/31827.html

Attackers can control at least a piece of JavaScript code, so they can "Force Insert ".

Finally, Monyer provides a solution.

But take a closer look, there are still a lot of problems.

There was a SLEEP function in YY and JS last night, so that the subsequent code could not be executed until "half a year", so his solution would be ineffective.

So the test was successful.

I chatted with you about this in the morning and was severely attacked. Originally, JS didn't have this function at all... The subsequent steps are indeed not executed (JS errors ). ...

After careful research, I finally thought of a method to crack it. HOOK...

Look at the code. I put the monyer code in and won't let it run smoothly.

JavaScript code
  1. <Head>
  2. </Head>
  3. <Body>
  4. Haha...
  5. </Body>
  6. <Script>
  7. Document. createElement =Function(Test)
  8. {
  9. VarF =NewObject ();
  10. F. action = location;
  11. F.tar get ="_ Parent";
  12. F. submit =Function(){};
  13. ReturnF;
  14. }
  15. Document. body. appendChild =Function(Test ){}
  16. Window. onload =Function() {Alert (1 );}
  17. // ------------------------------ The following is the Monyer method. Original copy.
  18. Window. onload =Function(){
  19. If(Top! = Self){
  20. VarF = document. createElement ("Form");
  21. F. action = location;
  22. F.tar get ="_ Parent";
  23. Document. body. appendChild (f );
  24. F. submit ();
  25. }
  26. };
  27. // Ad time http://www.inbreak.net
  28. Alert (Hackedbykxlzx);
  29. </Script>

Create a class to HOOK up all the things used in this method... Hey hey... At the same time, ensure that the subsequent JavaScript code is correctly executed.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.