Actually, I'm not sure if this would work without lots of extra modification because it compares whole lines, and those lines have to be identical. So I'd have to change both the whitelist file and the downloaded hosts files so that both contain either "0.0.0.0 blahblahblah.com" or "127.0.0.1 blahblahblah.com", with the same number of spaces / tabs between both.
For example, the first link ( http://winhelp2002.mvps.org/hosts.txt ) has two spaces between the terms:
The second link ( http://hosts-file.net/.%5Cad_servers.txt ) contains a tab:
Not sure which method would be most efficient considering all that. Plus the whitelist file would have to contain whole addresses - you couldn't simply put "google" in to whitelist everything with google in the name. Not sure if the comments after some of those entries would prevent a match either.
"nothing is ever easy".
Feathers
For example, the first link ( http://winhelp2002.mvps.org/hosts.txt ) has two spaces between the terms:
Code:
127.0.0.1 www.alwayson-network.com 127.0.0.1 adtools2.amakings.com 127.0.0.1 ad.amgdgt.com 127.0.0.1 vfdeprod.amobee.com 127.0.0.1 banners.amsterdamcash.com 127.0.0.1 widgets.amung.us 127.0.0.1 whos.amung.us #[WebBug] 127.0.0.1 gw.anametrix.net #[WebBug] 127.0.0.1 www.anastasiasaffiliate.com 127.0.0.1 advert.ananzi.co.za 127.0.0.1 advert2.ananzi.co.za 127.0.0.1 box.anchorfree.net 127.0.0.1 rpt.anchorfree.net 127.0.0.1 www.anticlown.com
Code:
127.0.0.1 a-ads.com 127.0.0.1 a-counter.kiev.ua 127.0.0.1 a.admob.com 127.0.0.1 a.adorika.net 127.0.0.1 a.adroll.com 127.0.0.1 a.adtwirl.com 127.0.0.1 a.alimama.cn 127.0.0.1 a.collective-media.net 127.0.0.1 a.consumer.net 127.0.0.1 a.ctasnet.com 127.0.0.1 a.facdn.net 127.0.0.1 a.fandango.com 127.0.0.1 a.networkworld.com 127.0.0.1 a.oix.net 127.0.0.1 a.playlistmag.com
"nothing is ever easy".Feathers







dmesg is the first and easiest place I could think of to store the output. I used logger initially but "cat /var/log/syslog" was too verbose for me just to see if it worked. I suppose the "correct" way would be to put the results into a local email but I'm too lazy for all that. Besides, I get too much email as it is!
Comment