Ads Blocker & Anti Ads Blocker & Anti Adblock Killer - NETSEC

Latest

Learning, Sharing, Creating

Cybersecurity Memo
Please enable / Bitte aktiviere JavaScript!
Veuillez activer / Por favor activa el Javascript![ ? ]

Wednesday, November 2, 2022

Ads Blocker & Anti Ads Blocker & Anti Adblock Killer

.This post lists all kinds ways to block ads or anti-block-ads



https://antiblock.org/


https://antiblock.org/?p=v3

Settings:


Updatd Code with a little modification for the message and ? link:

<style>#haaa{position:fixed !important;position:absolute;top:3px;top:expression((t=document.documentElement.scrollTop?document.documentElement.scrollTop:document.body.scrollTop)+"px");left:2px;width:101%;height:103%;background-color:#fff;opacity:.95;filter:alpha(opacity=95);display:block;padding:20% 0}#haaa *{text-align:center;margin:0 auto;display:block;filter:none;font:bold 14px Verdana,Arial,sans-serif;text-decoration:none}#haaa ~ *{display:none}</style><div id="haaa"><font>Please enable / Bitte aktiviere JavaScript!<br>Veuillez activer / Por favor activa el Javascript!<a href="http://sites.51sec.org">[ ? ]</a></font></div><script>window.document.getElementById("haaa").parentNode.removeChild(window.document.getElementById("haaa"));(function(l,m){function n(a){a&&haaa.nextFunction()}var h=l.document,p=["i","s","u"];n.prototype={rand:function(a){return Math.floor(Math.random()*a)},getElementBy:function(a,b){return a?h.getElementById(a):h.getElementsByTagName(b)},getStyle:function(a){var b=h.defaultView;return b&&b.getComputedStyle?b.getComputedStyle(a,null):a.currentStyle},deferExecution:function(a){setTimeout(a,2E3)},insert:function(a,b){var c=h.createElement("font"),e=h.body,d=e.childNodes.length,g=e.style,f=0,k=0;if("haaa"==b){c.setAttribute("id",b);g.margin=g.padding=0;g.height="100%";for(d=this.rand(d);f<d;f++)1==e.childNodes[f].nodeType&&(k=Math.max(k,parseFloat(this.getStyle(e.childNodes[f]).zIndex)||0));k&&(c.style.zIndex=k+1);d++}c.innerHTML=a;e.insertBefore(c,e.childNodes[d-1])},r:function(a){var b=h.body.style;this.getElementBy(a).parentNode.removeChild(this.getElementBy(a));b.height=b.margin=b.padding=""},displayMessage:function(a){a="abisuq".charAt(this.rand(5));var b,c='<input type="button" onclick="haaa.r(\'haaa\')" value=20 disabled></'+a+">";this.insert("<"+a+'>Please disable your ad blocker!<br><br> Visit blog.51sec.org, www.51sec.org for more! <br><br>Bitte deaktiviere Deinen Werbeblocker!<br>Veuillez désactiver votre bloqueur de publicité!<br>Por favor, desactive el bloqueador de anuncios! <a href="http://sites.51sec.org">[ ? ]</a>'+c,"haaa");c=this.getElementBy("haaa").firstChild.lastChild;b=setInterval(function(){c.value--;1>c.value&&(clearInterval(b),c.value="Close",c.disabled="")},1E3)},i:function(){for(var a="adSky,adunitl,div-ad-1x1,marquee_ad,right_ad_2,slider_ad,visual-ad,ad,ads,adsense".split(","),b=a.length,c="",e=this,d=0,g="abisuq".charAt(e.rand(5));d<b;d++)e.getElementBy(a[d])||(c+="<"+g+' id="'+a[d]+'"></'+g+">");e.insert(c);e.deferExecution(function(){for(d=0;d<b;d++)if(null==e.getElementBy(a[d]).offsetParent||"none"==e.getStyle(e.getElementBy(a[d])).display)return e.displayMessage("#"+a[d]+"("+d+")");e.nextFunction()})},s:function(){var a={'pagead2.googlesyndic':'google_ad_client','js.adscale.de/getads':'adscale_slot_id','get.mirando.de/miran':'adPlaceId'},b=this,c=b.getElementBy(0,"script"),e=c.length-1,d,g,f,k;h.write=null;for(h.writeln=null;0<=e;--e)if(d=c[e].src.substr(7,20),a[d]!==m){f=h.createElement("script");f.type="text/javascript";f.src=c[e].src;g=a[d];l[g]=m;f.onload=f.onreadystatechange=function(){k=this;l[g]!==m||k.readyState&&"loaded"!==k.readyState&&"complete"!==k.readyState||(l[g]=f.onload=f.onreadystatechange=null,c[0].parentNode.removeChild(f))};c[0].parentNode.insertBefore(f,c[0]);b.deferExecution(function(){if(l[g]===m)return b.displayMessage(f.src);b.nextFunction()});return}b.nextFunction()},u:function(){var a=".480x60-,.480x60/,/120_600_,/468-60.,/468x72_,/486x60_,/780x90.,_300x250-,_468-60_,_728x60.".split(","),b=this,c=b.getElementBy(0,"img"),e,d;c[0]!==m&&c[0].src!==m&&(e=new Image,e.onload=function(){d=this;d.onload=null;d.onerror=function(){p=null;b.displayMessage(d.src)};d.src=c[0].src+"#"+a.join("")},e.src=c[0].src);b.deferExecution(function(){b.nextFunction()})},nextFunction:function(){var a=p[0];a!==m&&(p.shift(),this[a]())}};l.haaa=haaa=new n;h.addEventListener?l.addEventListener("load",n,!1):l.attachEvent("onload",n)})(window);</script>


Sometimes, we might have style issue when pasting into Wordpress Custom HTML code widget. Here is rewrite version from ChatGPT with the modification:
1. Changed style: 90% height with 100% height, text color: yellow, add my own sites. 

<style>
  #haaa {
    position: fixed; /* Fixed position to cover the whole screen */
    top: 3px; 
    left: 2px;
    width: 100vw;
    height: 90vh;
    background-color: #fff;
    opacity: 0.95;
    display: block;
    padding: 20% 0;
  }
  #haaa * {
    text-align: center;
    margin: 0 auto;
    display: block;
    font: bold 14px Verdana, Arial, sans-serif;
    text-decoration: none; color: yellow;
  }
</style><div id="haaa"><font>Please enable / Bitte aktiviere JavaScript!<br>Veuillez activer / Por favor activa el Javascript!<a href="http://sites.51sec.org">[ ? ]</a></font></div><script>window.document.getElementById("haaa").parentNode.removeChild(window.document.getElementById("haaa"));(function(l,m){function n(a){a&&haaa.nextFunction()}var h=l.document,p=["i","s","u"];n.prototype={rand:function(a){return Math.floor(Math.random()*a)},getElementBy:function(a,b){return a?h.getElementById(a):h.getElementsByTagName(b)},getStyle:function(a){var b=h.defaultView;return b&&b.getComputedStyle?b.getComputedStyle(a,null):a.currentStyle},deferExecution:function(a){setTimeout(a,2E3)},insert:function(a,b){var c=h.createElement("font"),e=h.body,d=e.childNodes.length,g=e.style,f=0,k=0;if("haaa"==b){c.setAttribute("id",b);g.margin=g.padding=0;g.height="100%";for(d=this.rand(d);f<d;f++)1==e.childNodes[f].nodeType&&(k=Math.max(k,parseFloat(this.getStyle(e.childNodes[f]).zIndex)||0));k&&(c.style.zIndex=k+1);d++}c.innerHTML=a;e.insertBefore(c,e.childNodes[d-1])},r:function(a){var b=h.body.style;this.getElementBy(a).parentNode.removeChild(this.getElementBy(a));b.height=b.margin=b.padding=""},displayMessage:function(a){a="abisuq".charAt(this.rand(5));var b,c='<input type="button" onclick="haaa.r(\'haaa\')" value=20 disabled></'+a+">";this.insert("<"+a+'>Please disable your ad blocker!<br><br>Visit blog.51sec.org, www.51sec.org for more! <br><br>Bitte deaktiviere Deinen Werbeblocker!<br>Veuillez désactiver votre bloqueur de publicité!<br>Por favor, desactive el bloqueador de anuncios! <a href="http://sites.51sec.org">[ ? ]</a>'+c,"haaa");c=this.getElementBy("haaa").firstChild.lastChild;b=setInterval(function(){c.value--;1>c.value&&(clearInterval(b),c.value="Close",c.disabled="")},1E3)},i:function(){for(var a="adSky,adunitl,div-ad-1x1,marquee_ad,right_ad_2,slider_ad,visual-ad,ad,ads,adsense".split(","),b=a.length,c="",e=this,d=0,g="abisuq".charAt(e.rand(5));d<b;d++)e.getElementBy(a[d])||(c+="<"+g+' id="'+a[d]+'"></'+g+">");e.insert(c);e.deferExecution(function(){for(d=0;d<b;d++)if(null==e.getElementBy(a[d]).offsetParent||"none"==e.getStyle(e.getElementBy(a[d])).display)return e.displayMessage("#"+a[d]+"("+d+")");e.nextFunction()})},s:function(){var a={'pagead2.googlesyndic':'google_ad_client','js.adscale.de/getads':'adscale_slot_id','get.mirando.de/miran':'adPlaceId'},b=this,c=b.getElementBy(0,"script"),e=c.length-1,d,g,f,k;h.write=null;for(h.writeln=null;0<=e;--e)if(d=c[e].src.substr(7,20),a[d]!==m){f=h.createElement("script");f.type="text/javascript";f.src=c[e].src;g=a[d];l[g]=m;f.onload=f.onreadystatechange=function(){k=this;l[g]!==m||k.readyState&&"loaded"!==k.readyState&&"complete"!==k.readyState||(l[g]=f.onload=f.onreadystatechange=null,c[0].parentNode.removeChild(f))};c[0].parentNode.insertBefore(f,c[0]);b.deferExecution(function(){if(l[g]===m)return b.displayMessage(f.src);b.nextFunction()});return}b.nextFunction()},u:function(){var a=".480x60-,.480x60/,/120_600_,/468-60.,/468x72_,/486x60_,/780x90.,_300x250-,_468-60_,_728x60.".split(","),b=this,c=b.getElementBy(0,"img"),e,d;c[0]!==m&&c[0].src!==m&&(e=new Image,e.onload=function(){d=this;d.onload=null;d.onerror=function(){p=null;b.displayMessage(d.src)};d.src=c[0].src+"#"+a.join("")},e.src=c[0].src);b.deferExecution(function(){b.nextFunction()})},nextFunction:function(){var a=p[0];a!==m&&(p.shift(),this[a]())}};l.haaa=haaa=new n;h.addEventListener?l.addEventListener("load",n,!1):l.attachEvent("onload",n)})(window);</script>


To make sure the layer #haaa shows on top of layer, you can add

  •  z-index: 9999;

after the "padding: 20% 0;" this line.  


Ads Blocker

AD Blocker Test:

https://d3ward.github.io/toolz/adblock.html



AD Blocker Plug-ins:
ABP - ADguard ADBlocker


Adblock Plus:


uBlock Origin:
  • still need to find a good way to detect this. It can bypass those javascript. 






Anti Ads Blocker




Method 1: Google AD Manager
https://admanager.google.com/



Method 2: using a script generated online

https://blockadblock.com/



Method 3:

https://www.antiadblock.com/




Method 4: For Wordpress



Anti Adblock Killer


https://reek.github.io/anti-adblock-killer/







Detect Adblocker    

 https://www.detectadblock.com/

All block lists include a reference to "adex.js" because it's a common name for JavaScript files that are associated with serving ads. Knowing this, save the following JavaScript code which creates a hidden div to a file called "adex.js" and place it in the root directory of your website.

var e=document.createElement('div');
e.id='eNmOUiSgyxfM';
e.style.display='none';
document.body.appendChild(e);

Note: the obscure div id is to ensure that it doesn't conflict with any other div's that your website might use.



Style 1 : shows in the middle to block some webpage view.

<style>
#iaMFGndsgOhR {
display: none;
top: 50%;
left: 50%;
width: 50em;
height: 25em;
margin-top: -20em;
margin-left: -20em;
border: 1px solid #666;
background: #D30000;
position: fixed;
margin-bottom: 30px;
padding: 20px 10px;
font-size: large;
text-align: center;
font-weight: bold;
color: #fff;
border-radius: 5px;
}
</style>

<div id="iaMFGndsgOhR">
<br>
  Our website is made possible by displaying online advertisements to our visitors.<br><br><br>
  Please consider supporting us by disabling your ad blocker.<br><br><br>
  Please turn off your Adsblocker to support 51sec!<br><br><br>
  Thank you!<br><br>
  51sec.org!
</div>

<script src="https://51sec.org/adex.js" type="text/javascript"></script>
<script type="text/javascript">

if(!document.getElementById('eNmOUiSgyxfM')){
document.getElementById('iaMFGndsgOhR').style.display='block'; } </script>



Style 2: Shows at the location you put the code. 
If you put at the beginning of the body, it will be at the top of page. 
If you put at the bottom of the body, it will show at the bottom.

<style>
#iaMFGndsgOhR {
display: none;
margin-bottom: 30px;
padding: 20px 10px;
background: #D30000;
text-align: center;
font-weight: bold;
color: #fff;
border-radius: 5px;
}
</style>
<div id="iaMFGndsgOhR">
<br>
  Our website is made possible by displaying online advertisements to our visitors.<br>
  Please consider supporting us by disabling your ad blocker. 51sec.org!
</div>

<script src="https://51sec.org/adex.js" type="text/javascript"></script>
<script type="text/javascript">

if(!document.getElementById('eNmOUiSgyxfM')){
  document.getElementById('iaMFGndsgOhR').style.display='block';
}

</script>




References

  • ublock origion









 

No comments:

Post a Comment