ad-blocking with DD-WRT revisited (simple)

Post new topic   Reply to topic    DD-WRT Forum Index -> Broadcom SoC based Hardware
Goto page Previous  1, 2, 3 ... 5, 6, 7 ... 12, 13, 14  Next
Author Message
frater
DD-WRT Guru


Joined: 07 Jun 2006
Posts: 2777

PostPosted: Wed Apr 29, 2009 19:45    Post subject: Reply with quote
Homer on purpose only listens to 127.0.0.1.
Why don't you install perl on your windows system and download pixelserv?

_________________
Asus RT16N + OTRW
Kingston 4GB USB-disk 128 MB swap + 1.4GB ext3 on /opt + 2 GB ext3 on /mnt
Copperjet 1616 modem in ZipB-config
Asterisk, pixelserv & Pound running on router
Another Asus RT16N as WDS-bridge

DD-WRT v24-sp2 vpn (c) 2010 NewMedia-NET GmbH
Release: 12/16/10 (SVN revision: 15758M)
Sponsor
RCShadows
DD-WRT User


Joined: 17 Aug 2008
Posts: 437

PostPosted: Wed Apr 29, 2009 20:29    Post subject: Reply with quote
frater wrote:
Homer on purpose only listens to 127.0.0.1.
Why don't you install perl on your windows system and download pixelserv?


I was afraid of that...thanks for checking.

I have AdServer running and it works fine. I like Homer because you can select what image to send in the response. Nothing big, just a "nice to have".

Thanks again.
dieselboy27
DD-WRT Novice


Joined: 01 Apr 2007
Posts: 11

PostPosted: Fri May 08, 2009 17:17    Post subject: not working for me Reply with quote
I had the old ad block script which worked fine for quite some time. Then about a month ago, my itunes podcasts wouldn't download and many video sites wouldn't work for some reason. When I removed the script everything went back to normal.

Then I saw this updated thread and it got my hopes up that I could get rid of all those crappy ads in my porn Razz But alas it didn't work for me. The iTunes podcasts were screwed up again, giving me a dreaded "!".

I guess there is going to be negative effects when trying to implement this script. I would love to go back to the ad less pages, but the functionality has been too badly damaged for my use. Perhaps there will be a breakthrough in the future and I will give it another go.
RCShadows
DD-WRT User


Joined: 17 Aug 2008
Posts: 437

PostPosted: Fri May 08, 2009 17:23    Post subject: Reply with quote
I think its more of the ad providers wising up. I have had a few pages that didn't want to display correctly and/or the response was very slow.

To that end, I bet your iPod is timing-out maybe?

Just a thought.
dieselboy27
DD-WRT Novice


Joined: 01 Apr 2007
Posts: 11

PostPosted: Fri May 08, 2009 18:23    Post subject: Reply with quote
It's not the iPod it's iTunes. I think there is some conflict with these advertisers like you mentioned wising up. Just like Cnet video's will not play.
Kag
DD-WRT Novice


Joined: 09 May 2009
Posts: 7

PostPosted: Mon May 11, 2009 6:33    Post subject: Reply with quote
It is just a redirector problem.
Some ads act as redirector especially doubleclick

For example
ads.someadsite.com/redirector=www.google.com

will redirect you to www.google.com but your router blocks all ads.someadsite.com causing the link to fail immediately.

Usually at the status bar of your browser when it tries to load blocked sites/videos usually you will see the advertiser's site there in the status bar as it retries a couple of times before failing.

Likewise if you're able to obtain the full link you might be able to obtain the website itself just note that some of them converts : / ? to hexadecimals so you might need to change them to a real link.

I'm not sure if it works but if i'm not wrong you can add the original adsite's ip to the hosts file so your host file will have an entry say
Code:
12.12.12.12 ad.somesite.com

Where 12.12.12.12 is the real ip address meaning ad.somesite.com is in your "allow" list
so once the browser requests for ad.somesite.com it no longer have to go through the router's DNS.
You can just google for ip lookup site to get the original IP addresses.
uncle bob
DD-WRT User


Joined: 31 Aug 2008
Posts: 148

PostPosted: Wed May 13, 2009 16:29    Post subject: Reply with quote
it won't work for most sites for example those who use token from redirection to adsuckers to decide if video can be played.

As I said on April 23rd and Frater ignored me the way to do this is not hosts file but filtering similar to adblocker on router
frater
DD-WRT Guru


Joined: 07 Jun 2006
Posts: 2777

PostPosted: Wed May 13, 2009 16:59    Post subject: Reply with quote
I didn't ignore you. It's just beyond the scope of this "solution".
Using DNS is a very effective method using little resources. It doesn't even need to resolve the DNS externally and no traffic is generated to the Internet.

More advanced measures should be taken on the more powerfull clients. Clients with those measures still benefit from this procedure.

_________________
Asus RT16N + OTRW
Kingston 4GB USB-disk 128 MB swap + 1.4GB ext3 on /opt + 2 GB ext3 on /mnt
Copperjet 1616 modem in ZipB-config
Asterisk, pixelserv & Pound running on router
Another Asus RT16N as WDS-bridge

DD-WRT v24-sp2 vpn (c) 2010 NewMedia-NET GmbH
Release: 12/16/10 (SVN revision: 15758M)
araknis
DD-WRT Novice


Joined: 22 Mar 2009
Posts: 10

PostPosted: Mon Jun 08, 2009 2:47    Post subject: Reply with quote
is there an easy way to modify the dlhosts file? i can only access my router via telnet (no ftp). i want to delete some of the blocked domains. adding the domains to my local hosts file is not very convenient since i have multiple computers. thanks.
frater
DD-WRT Guru


Joined: 07 Jun 2006
Posts: 2777

PostPosted: Mon Jun 08, 2009 9:14    Post subject: Reply with quote
I will, if I can find time, enhance the script so you can make a file with "whitelisted" domains which will subsequently get deleted in the dlhosts.

For now, you could do it with "vi".

_________________
Asus RT16N + OTRW
Kingston 4GB USB-disk 128 MB swap + 1.4GB ext3 on /opt + 2 GB ext3 on /mnt
Copperjet 1616 modem in ZipB-config
Asterisk, pixelserv & Pound running on router
Another Asus RT16N as WDS-bridge

DD-WRT v24-sp2 vpn (c) 2010 NewMedia-NET GmbH
Release: 12/16/10 (SVN revision: 15758M)
frater
DD-WRT Guru


Joined: 07 Jun 2006
Posts: 2777

PostPosted: Mon Jun 08, 2009 12:02    Post subject: Reply with quote
With this script you can exclude some hosts and include others...

This is the script on MY router.
I have an USB-stick, so I prefer to have my "dlhosts" on there....

If you have only jffs as permanent storage, you should change
Code:
_f=/opt/dlhosts

into
Code:
_f=/tmp/dlhosts


In /opt/etc/ I have a file called "hosts" its contents will be blindly added.
In /opt/etc I als have a file called "dlhosts.exclude" in which I have the domains which should be stripped.

If you want to place them in /jffs you should change:
Code:
stor=/opt/etc

into
Code:
stor=/jffs


Code:
_rogue=192.168.10.5
wr=/tmp/write_dlhosts
echo -e "#!/bin/sh\nstor=/opt/etc\nxcl=\$stor/dlhosts.exclude\n_f=/opt/dlhosts\nn=1\nwhile sleep 60\ndo\n\twget -q -O - http://www.mvps.org/winhelp2002/hosts.txt | grep \"^127.0.0.1\" | grep -v localhost | awk '{print \"$_rogue\\\t\"\$2}' | tr -d '\\\015' >\$_f\n" >$wr
echo -e "\t[ \`grep -il doubleclick \$_f\` ] && break\n\t[ \$n -gt 5 ] && break\n\tlet n+=1\ndone\n[ -e \$stor/hosts ] && cat \$stor/hosts >>\$_f" >>$wr
echo -e "if [ -e \$xcl ] ; then\n\twhile read khost ; do\n\t\tsed -i -e \"s/$_rogue\\\t\${khost}/#/\" \$_f\n\tdone < \$xcl\nfi\nkillall -HUP dnsmasq" >>$wr
chmod +x $wr
$wr &


It will create a script called write_dlhosts in /tmp
If you want to look at the code in a more readable form you should look at that one first

Happy testing...

_________________
Asus RT16N + OTRW
Kingston 4GB USB-disk 128 MB swap + 1.4GB ext3 on /opt + 2 GB ext3 on /mnt
Copperjet 1616 modem in ZipB-config
Asterisk, pixelserv & Pound running on router
Another Asus RT16N as WDS-bridge

DD-WRT v24-sp2 vpn (c) 2010 NewMedia-NET GmbH
Release: 12/16/10 (SVN revision: 15758M)
araknis
DD-WRT Novice


Joined: 22 Mar 2009
Posts: 10

PostPosted: Tue Jun 09, 2009 5:27    Post subject: Reply with quote
Is there something else that needs to be done after modifying the file? I removed a few domains and they are still blocked (I verified that file was updated and saved). Do I need to manually "refresh" something?

frater wrote:
I will, if I can find time, enhance the script so you can make a file with "whitelisted" domains which will subsequently get deleted in the dlhosts.

For now, you could do it with "vi".
frater
DD-WRT Guru


Joined: 07 Jun 2006
Posts: 2777

PostPosted: Tue Jun 09, 2009 5:47    Post subject: Reply with quote
Quote:
Do I need to manually "refresh" something?

Yes...
Code:
killall -HUP dnsmasq


Just like in the script...
Do you need some help using the new script??

_________________
Asus RT16N + OTRW
Kingston 4GB USB-disk 128 MB swap + 1.4GB ext3 on /opt + 2 GB ext3 on /mnt
Copperjet 1616 modem in ZipB-config
Asterisk, pixelserv & Pound running on router
Another Asus RT16N as WDS-bridge

DD-WRT v24-sp2 vpn (c) 2010 NewMedia-NET GmbH
Release: 12/16/10 (SVN revision: 15758M)
frater
DD-WRT Guru


Joined: 07 Jun 2006
Posts: 2777

PostPosted: Wed Jun 10, 2009 11:41    Post subject: Reply with quote
No-one interested in this latest script?
Mmmm, I didn't need it myself.
I thought it was needed by some of you...

To clarify..

The enhanced script lets you take out some domains you don't want to get 'blacklisted'

_________________
Asus RT16N + OTRW
Kingston 4GB USB-disk 128 MB swap + 1.4GB ext3 on /opt + 2 GB ext3 on /mnt
Copperjet 1616 modem in ZipB-config
Asterisk, pixelserv & Pound running on router
Another Asus RT16N as WDS-bridge

DD-WRT v24-sp2 vpn (c) 2010 NewMedia-NET GmbH
Release: 12/16/10 (SVN revision: 15758M)
RCShadows
DD-WRT User


Joined: 17 Aug 2008
Posts: 437

PostPosted: Wed Jun 10, 2009 21:31    Post subject: Reply with quote
Frater,

I have a question...is there any way to have the two files (white-list, black-list) on a hard drive and the merged file loaded onto the router?
Goto page Previous  1, 2, 3 ... 5, 6, 7 ... 12, 13, 14  Next Display posts from previous:    Page 6 of 14
Post new topic   Reply to topic    DD-WRT Forum Index -> Broadcom SoC based Hardware All times are GMT

Navigation

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum