Page 1 of 1
dealing with hosts files etc
Posted: Sun Oct 25, 2015 6:18 pm
by Vegan
I have now developed some strong countermeasures to ad block users, this is a growing problem that is best described as pervasive
I used a google custom job to show the use of ad blockers, it was not pretty
one angle that comes to mind is the growing use of HOSTS files to block domains etc
so I was wondering if there is any easy way to identify if the URL is not working with PHP which can then echo the result
I was also pondering using hard coded IP addresses as well
Re: dealing with hosts files etc
Posted: Mon Oct 26, 2015 3:00 pm
by requinix
PHP can't do anything about this - the problem is entirely client-side.
With a hosts file entry, pretty much any request to a blacklisted domain will fail. You can have Javascript check for that. Or check if a referenced variable in an ad script was defined. But your options are limited as you can't use Javascript to hit up another domain unless they've specifically allowed it.
Re: dealing with hosts files etc
Posted: Fri Oct 30, 2015 11:17 am
by Vegan
can PHP find the IP address of a given URL so I can use that to assemble ads by hard coded IP address to circumvent the HOSTS
Re: dealing with hosts files etc
Posted: Fri Oct 30, 2015 8:29 pm
by requinix
That wouldn't help: an IP address corresponds to a server, not to a website, and nowadays most servers provide more than one site at a time. When the browser requests //ads.example.com/ad.js it will send two pieces of information to the server: the path (/ad.js) and the hostname (ads.example.com). The server needs the right hostname to know the right site to use. If the hostname is just an IP address then the server doesn't know which of the number of sites it has configured that the request should go to.
For example,
http://www.devnetwork.net and forums.devnetwork.net go to the same server, 68.168.223.237, and if you
go there then the server won't know what to do and will give you a generic error message. (Another possibility is that it would just pick the "first" site it has configured, but that would be a poorly configured web server.)
Re: dealing with hosts files etc
Posted: Sat Oct 31, 2015 3:49 pm
by Vegan
i suspect Amazon has a dedicated server for their ad host
Re: dealing with hosts files etc
Posted: Sat Oct 31, 2015 7:41 pm
by requinix
Which domain name? It's pretty easy to check.
Re: dealing with hosts files etc
Posted: Sun Nov 01, 2015 7:13 am
by Vegan
ws-na.amazon-adsystem.com
Re: dealing with hosts files etc
Posted: Sun Nov 01, 2015 9:29 am
by requinix
So I can't confirm whether the server hosts multiple sites, but I can try finding some random URL online and seeing if that works with an IP address.
And it isn't.
Code: Select all
http://ws-na.amazon-adsystem.com/widgets/q?ServiceVersion=20070822&Operation=GetAdHtml&ID=OneJS&OneJS=1&source=ss&ref=ss_til&ad_type=product_link&tracking_id=woodandshop-20&marketplace=amazon®ion=US&placement=B001ONHUAA&asins=B001ONHUAA&show_border=true&link_opens_in_new_window=true&MarketPlace=US
Code: Select all
http://176.32.100.230/widgets/q?ServiceVersion=20070822&Operation=GetAdHtml&ID=OneJS&OneJS=1&source=ss&ref=ss_til&ad_type=product_link&tracking_id=woodandshop-20&marketplace=amazon®ion=US&placement=B001ONHUAA&asins=B001ONHUAA&show_border=true&link_opens_in_new_window=true&MarketPlace=US
Try the same with one of your URLs to see if the IP address works.
Re: dealing with hosts files etc
Posted: Sun Nov 01, 2015 10:55 am
by Vegan
It looks like the IP address does not work as desired
so much for that idea
any other suggestions to get around blocking with HOSTS
Re: dealing with hosts files etc
Posted: Sun Nov 01, 2015 7:15 pm
by requinix
Not really. You can still do the Javascript detection and present a message about allowing ads on your site.
Re: dealing with hosts files etc
Posted: Tue Nov 03, 2015 4:06 pm
by Vegan
Unfortunately it does seem that all I can do is use JS, other ideas have come up short
I am using this idea now, send miscreants to Chilling effects where DCMA is taken more seriously
Code: Select all
if(window.isAdsDisplayed === undefined ) {
// AdBlock is enabled. Show message or track custom data here
busted = document.cookie; // check for an existing cookie
if (busted) {
href = "https://www.chillingeffects.org/";
else {
document.cookie("adblock=true");
alert("An ad blocker has been detected. Please remove the program to use this site. This is an ad supported small business.\n Ad blocking destroys web content which needs a revenue source to survive.\n Adblockers and click fraud have cause so much economic damage that many sites have been forced to close.\n Your webmaster needs to eat too, let alone the cost of web hosting etc. \n\n This site cannot afford to to use a higher service level when traffic is heavy.");
}
}
Recently 275,000 requests on a single day makes me wonder what is wrong? That happened on October 26, 2015
Re: dealing with hosts files etc
Posted: Tue Nov 03, 2015 5:06 pm
by requinix
Yeah... That's definitely the best way to make sure I
remove your site from my search results and never go back to it again.
Re: dealing with hosts files etc
Posted: Sun Nov 08, 2015 9:33 am
by Vegan
I have seen a sharp increase in page views, looks like this is working properly with the desired effect
Page views are now up more than 2x and I am tracking the use of adblock against my ads to see how its working