OpenWrt Forum Archive

Topic: adblock package, release 2.x

The content of this topic has been archived between 22 Mar 2018 and 4 May 2018. Unfortunately there are posts – most likely complete pages – missing.

Very good release, i can use the AP-Mode, no firewall issues and very comfortable setup. Thank you, this is my new favorite plugin of openwrt :-)

@sok: thanks, you're welcome! smile

@all windows users: If you receive a yellow exclamation mark on your internet connection icon (which wrongly means connected, but no internet), you can fix this by changing the following registry key/value from "1" to "0" ... hope this helps!

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\NlaSvc\Parameters\Internet\EnableActiveProbing

Tested successfully on Windows 8.1 & Windows 10.

(Last edited by dibdot on 17 May 2016, 09:37)

What list blocks ads from creative.wwwpromoter.com? Seems to be the only one showing up...

Given that this might change any time, I'd suggest to check it yourself:

# grep YOURDOMAIN /tmp/dnsmasq.d/adb_list.*

I am having problem watching the Grimm episodes on nbc.com/grimm without turning off adblock on my router.  What is the best way to find the domains/IPs that's blocked by adblock?  Will enabling logging for iptables adb-fwd and adb-out filter rule show me the domain/IP being blocked when I try to play a video from my desktop browser?  If so, what is the correct rule I need to add to the adblock-helper.sh script to achieve this? Is there a better way to whitelist nbc.com for watching video without shutting off adblock?

fatboy wrote:

I am having problem watching the Grimm episodes on nbc.com/grimm without turning off adblock on my router.  What is the best way to find the domains/IPs that's blocked by adblock?  Will enabling logging for iptables adb-fwd and adb-out filter rule show me the domain/IP being blocked when I try to play a video from my desktop browser?  If so, what is the correct rule I need to add to the adblock-helper.sh script to achieve this? Is there a better way to whitelist nbc.com for watching video without shutting off adblock?

No, please enable 'Log queries' in dnsmasq (via LuCI Network => DHCP/DNS) and after that ssh to your router and start tracing ...

logread -f -e "dnsmasq" -e "<NULL-IP>"

=> NULL-IP is '192.0.2.1' by default

... now switch to your client and access the nbc site ... you will see all domains that are blocked ... put them in your whitelist (/etc/adblock/adblock.whitelist). Finally restart the adblock service (/etc/init.d/adblock restart) and check again.

dibdot wrote:

BTW, the url for winspy has been slightly changed, the new url:

kind of boring, but the winspy url has been slightly changed again ... please revise the winspy config entry like that:

option adb_src 'https://raw.githubusercontent.com/crazy-max/WindowsSpyBlocker/master/hosts/windows10_spy.txt'

I want to install your application.

1. I use "Linux Mint" and "PuTTY SSH client" to connect to my router.

2. I wrote "opkg install luci-app-adblock"
Unknown package  luci-app-adblock'
Collected errors:
opkg_install_cmd: Cannot install package luci_app_adblock

How can I change this?
(I have OpenWrt Chaos Calmer 15.05.1 / LuCI 15.05-149-g0d8bbd2 Release (git-15.363.78009-956be55))

I wrote "opkg install adblock", and I have the same error.

(Last edited by vjg on 23 May 2016, 11:55)

@vjg

Did you read the documentation:

You can find the link in post 1

Chaos Calmer installation notes

    'adblock' and 'luci-app-adblock' are not available as .ipk packages in the Chaos Calmer download repository
    download both packages from a development snapshot package directory:
        for 'adblock' look here  (See the online documentation for the link)
        for 'luci-app-adblock' look here
    manually transfer the packages to your routers temp directory (with tools like sshfs or winscp)
    install the packages with opkg install <...> as described above

zandhaas, thank you for your post. I installed this  and I see 'add block' in Service (Luci).

Can I block with this adblock for example google.com?

I know that I can find /etc/hosts and to add something but it's interesting can I block something with this thing.

I wrote:

cd /etc/adblock
vi adblock.blacklist

I added "google.ru" and saved file but I can open google.ru anyway. Why?

And I have see sometimes "you are offline" and then I online again. I mean my internet connection is not very stable. But my internet was very good before I added this adblock. Why? Maybe I have too many blocked domains? (Total count of blocked domains 130471)

(Last edited by vjg on 24 May 2016, 20:17)

vjg wrote:

Can I block with this adblock for example google.com?

I added "google.ru" and saved file but I can open google.ru anyway. Why?

did you (re-)start adblock afterwards? If not, please start adblock service again (/etc/init.d/adblock start)

Hi,
Is it possible to temporally disable the blocking? Like toggling it on/off?
To be clear, I want to toggle the action of blocking on & off, and not the action of updating the list.

Thank you for this adblock, it works great.

Hi!
I have troubles with updates for some lists. In my case it's seem that not work malwarelist and voyo.
Here is output from startup:

adblock[3341] info : => processing adblock source 'disconnect'
adblock[3341] info :    source download finished (5703 entries)
adblock[3341] info :    domain merging finished
adblock[3341] info : => processing adblock source 'malwarelist'
adblock[3341] info :    no online timestamp received, current date will be used
adblock[3341] info :    source download failed
adblock[3341] info : => processing adblock source 'rolist'
adblock[3341] info :    source download finished (608 entries)
adblock[3341] info :    domain merging finished
adblock[3341] info : => processing adblock source 'yoyo'
adblock[3341] info :    no online timestamp received, current date will be used
adblock[3341] info :    source download failed

Direct acces using browser for these lists work ok.

inakiregister wrote:

Hi,
Is it possible to temporally disable the blocking? Like toggling it on/off?
To be clear, I want to toggle the action of blocking on & off, and not the action of updating the list.

cool idea - I'll add this feature with the next release. wink

vlad2005 wrote:

Hi!
I have troubles with updates for some lists. In my case it's seem that not work malwarelist and voyo.
Direct acces using browser for these lists work ok.

both sites worksforme, maybe a (temporary) weak internet connection!? Please try to raise the timeout counters:

change line 240 in /usr/bin/adblock-helper.sh ...
  fetch_parm="--no-config --quiet --tries=1 --no-cache --no-cookies --max-redirect=0 --dns-timeout=5 --connect-timeout=5 --read-timeout=5"
to ...
  fetch_parm="--no-config --quiet --tries=1 --no-cache --no-cookies --max-redirect=0 --dns-timeout=10 --connect-timeout=10 --read-timeout=10"

and try again

if this helps, I'll made this timeout configurable with the next release.

I see something more strange. I have an openwrt router  at school (Tplink wr4300), and work ok with these lists.
But at my home (tp-link 1043nd v.1) i have problems. Both routers are connected with modems on same provider (TELEKOM Romania). Maybe, router at home is less powerfull.
Anyway, your suggestion solved my issue.

Thanks!

(Last edited by vlad2005 on 26 May 2016, 14:48)

dibdot wrote:
inakiregister wrote:

Hi,
Is it possible to temporally disable the blocking? Like toggling it on/off?
To be clear, I want to toggle the action of blocking on & off, and not the action of updating the list.

cool idea - I'll add this feature with the next release. wink

adblock 1.1.15 (released today) includes this new feature ...

[...]
adblock[2508] info : adblock lists with overall 101578 domains loaded
adblock[2508] info : new adblock list backups generated
adblock[2508] info : firewall statistics (IPv4/IPv6): 0/0 ad related packets blocked
adblock[2508] info : domain adblock processing finished successfully (1.1.15, r412, 26.05.2016 18:40:23)

root@blackhole:/etc/init.d$ /etc/init.d/adblock toggle
adblock[3222] info : toggle for adblocking switched 'off'

root@blackhole:/etc/init.d$ nslookup doubleclick.net
Name:      doubleclick.net
Address 1: 172.217.21.174 fra07s64-in-f14.1e100.net
Address 2: 2a00:1450:4001:80f::200e fra07s64-in-x0e.1e100.net

root@blackhole:/etc/init.d$ /etc/init.d/adblock toggle
adblock[3274] info : toggle for adblocking switched 'on'

root@blackhole:/etc/init.d$ nslookup doubleclick.net
Name:      doubleclick.net
Address 1: 192.168.254.250 blackhole.linuxad.lan
vlad2005 wrote:

I see something more strange. I have an openwrt router  at school (Tplink wr4300), and work ok with these lists.
But at my home (tp-link 1043nd v.1) i have problems. Both routers are connected with modems on same provider (TELEKOM Romania). Maybe, router at home is less powerfull.
Anyway, your suggestion solved my issue.

Thanks!

adblock 1.1.15 (released today) includes the new option 'adb_fetchttl' to set the download timeout in seconds (default 5).

vlad2005 wrote:

I see something more strange. I have an openwrt router  at school (Tplink wr4300), and work ok with these lists.
But at my home (tp-link 1043nd v.1) i have problems.

The TL-WR1043NDv1 has only 32 MB RAM, depending on how many adblock sources you have activated, you might run out of free RAM (in particular while adblock refreshes the lists and elliminates duplicate entries).

dibdot wrote:
fatboy wrote:

I am having problem watching the Grimm episodes on nbc.com/grimm without turning off adblock on my router.  What is the best way to find the domains/IPs that's blocked by adblock?  Will enabling logging for iptables adb-fwd and adb-out filter rule show me the domain/IP being blocked when I try to play a video from my desktop browser?  If so, what is the correct rule I need to add to the adblock-helper.sh script to achieve this? Is there a better way to whitelist nbc.com for watching video without shutting off adblock?

No, please enable 'Log queries' in dnsmasq (via LuCI Network => DHCP/DNS) and after that ssh to your router and start tracing ...

logread -f -e "dnsmasq" -e "<NULL-IP>"

=> NULL-IP is '192.0.2.1' by default

... now switch to your client and access the nbc site ... you will see all domains that are blocked ... put them in your whitelist (/etc/adblock/adblock.whitelist). Finally restart the adblock service (/etc/init.d/adblock restart) and check again.

@dibdot, thanks for the simple solution for identifying the domains to be added to the whitelist file.  I have whitelisted all the blocked domains and restart adblock but still not able to watch the video on nbc.com with adblock on.

If I turn off adblock, and let the initial video ad play, I am able to watch the Grimm episodes with an empty whitelist file with adblock on for a while (a day or so).  It's like the initial video ad set some sort of token or something after watching it.

Has anyone run into this issue or figure out how to watch shows on nbc.com with adblock on?

fatboy wrote:

@dibdot, thanks for the simple solution for identifying the domains to be added to the whitelist file.  I have whitelisted all the blocked domains and restart adblock but still not able to watch the video on nbc.com with adblock on.

If I turn off adblock, and let the initial video ad play, I am able to watch the Grimm episodes with an empty whitelist file with adblock on for a while (a day or so).  It's like the initial video ad set some sort of token or something after watching it.

Has anyone run into this issue or figure out how to watch shows on nbc.com with adblock on?

yesterday I've released adblock 1.1.15, which includes a simple command line function to toggle the adblocker 'on' or 'off' (without the need of downloading fresh lists afterwards) ... in your case please update to adblock 1.1.15, remove all nbc related whitelist entries and use the new toggle. For details see this post or the updated online documentation

Nevertheless this video is not available in europe/germany ... sad

(Last edited by dibdot on 27 May 2016, 06:35)

slh wrote:

The TL-WR1043NDv1 has only 32 MB RAM, depending on how many adblock sources you have activated, you might run out of free RAM (in particular while adblock refreshes the lists and elliminates duplicate entries).

just for info, memory intense overall duplicate removal will be automatically disabled on low memory systems (< 64 MB)

(Last edited by dibdot on 27 May 2016, 06:59)

@dibdot, I just wanted to mention that you are doing a fantastic job with regard to developing, supporting, and maintaining your Adblock script/package for OpenWrt, Dirk.  I am very thankful.

I have a suggestion that might be interesting.  This suggestion came to mind after you added the Total count of blocked domains section to Services - Adblock page in which you pull in the data count of total domains that are blacklisted.  So my idea/suggestion that comes from that concept is also about pulling in some data to represent within the Services - Adblock page.

Quite often, I find myself often going through SCP into my OpenWrt router just to run the /etc/init.d/adblock start command from the terminal and going back into OpenWrt/LuCI web interface and looking in the System Log to check the number of ad/tracker packets blocked based on your Adblock for OpenWrt.

My thought is, would it be possible to add a button within the Services - Adblock page that, when pressed, would simply run the /etc/init.d/adblock start command and pull in the number of blocked packets from the System Log from the line firewall statistics (IPv4/IPv6): 99/0 ad related packets blocked and strip that down to just the actual number, in this case 99 and have that number of blocked packets show up beside the button within the Services - Adblock page.

Anyway, I think that this would be interesting and useful information to have available and with the press of a button, if possible.

Thank you for your time.  Enjoy your weekend!


EDIT:  Added basic mockup image

http://i.imgur.com/7TT86KP.jpg

Link in case image does not load:  http://imgur.com/7TT86KP

In the example image, pressing the REFRESH button would essentially run the /etc/init.d/adblock start command and pull the stats of how many ad domains were blocked.  Although since I am not a programmer, I do not know if this is even technically feasible.  So just a concept idea at the moment.

(Last edited by WildByDesign on 27 May 2016, 15:13)

I had one other question/suggestion that I wanted to mention before I forget.  I have always manually increased my DNSmasq cachesize from the default (which I believe is 256) to 1000 or 2000.  I've done this for several years now after playing around with OpenWrt and DNS based blacklisting/blackholing in general.

When utilizing DNS based filtering such as this Adblock script or others which can use quite large domain lists at times, would there be any benefit to increasing DNSmasq cachesize?

If there was to be some benefit of increasing DNSmasq cachesize along with this Adblock script, would it be beneficial to add the ability to change your cachesize within the Services - Adblock page, perhaps on the Extra Options drop down menu?

Thanks.