modify a 3rd part script

HI

I am curious if there is anything that can be done about this script:

it’s a 3rd part adblock


https://www.micu.eu/adblock/adblock_script.txt

and what it does it puls the list from https://www.micu.eu/adblock/adblock.php


the problem is I would like to whitelist a few google dns entries but I don’t know why

thank you

If it s just to remove an entry from the DNS list, add this to the bottom of the script.

ip dns static remove [find where name="aarki.com"]

Take care, this script will remove all DNS you have added your self with IP 127.0.0.1

Cleaned up the original script some (better tabs, removed not needed :wink: and added example to remove stuff from the list.

# Script to download adblock list	
# https://www.micu.eu/adblock/adblock.php
#
:log warning "starting adblock update"
:delay 2
:log warning "downloading adblock"
:local hostScriptUrl "https://www.micu.eu/adblock/adblock.php"
:local scriptName "adblock"
do {
	/tool fetch mode=http url=$hostScriptUrl dst-path=("./".$scriptName)
	:delay 20
	:if ([:len [/file find name=$scriptName]] > 0) do={
		:log warning "removing old adblock list"
		/ip dns static remove [find address=127.0.0.1]
		:log warning "importing new adblock list"
		/import file-name=$scriptName
		/file remove $scriptName
		:log warning "adblock list imported"
	} else={
		:log warning "adblock list not downloaded, script stopped"
	}
} on-error={
	:log warning "adblock list download FAILED"
}
#  These I would like to white list
ip dns static remove [find where name="aarki.com"] 
ip dns static remove [find where name="www.google.com"] 

#  To remove list complete, use this command:
# /ip dns static remove [find address=127.0.0.1]

Thank you very much!

You are welcome.

PS no need to quote the post above you. Use the Post Reply button under det post

Here is how it looks like after 15 hours of use. 445 blocked access on 124 different sites. (Using Splunk see my signature)
block.jpg
Top blocked site:

site	count
settings-win.data.microsoft.com	44
www.google-analytics.com	22
adservice.google.com	20
googleads.g.doubleclick.net	19
www.googletagmanager.com	19
app-measurement.com	13
sb.scorecardresearch.com	12
acdn.adnxs.com	11
ib.adnxs.com	11
cdn.adnxs.com	10
js-agent.newrelic.com	10
secure.adnxs.com	9
ssl.google-analytics.com	8
telemetry.dropbox.com	8
firebase-settings.crashlytics.com	7
pagead2.googlesyndication.com	7
scdn.cxense.com	7
api.mixpanel.com	6
fastlane.rubiconproject.com	6
securepubads.g.doubleclick.net	6
adx.adform.net	5
api2.branch.io

If you like to remove a group of DNS you could add a linke like this:

ip dns static remove [find where name~“googleadservices”]

See complete script.

# Script to download adblock list	
# https://www.micu.eu/adblock/adblock.php
#
:log warning "starting adblock update"
:delay 2
:log warning "downloading adblock"
:local hostScriptUrl "https://www.micu.eu/adblock/adblock.php"
:local scriptName "adblock"
do {
	/tool fetch mode=http url=$hostScriptUrl dst-path=("./".$scriptName)
	:delay 20
	:if ([:len [/file find name=$scriptName]] > 0) do={
		:log warning "removing old adblock list"
		/ip dns static remove [find address=127.0.0.1]
		:log warning "importing new adblock list"
		/import file-name=$scriptName
		/file remove $scriptName
		# List of what you like to remove from filter
		ip dns static remove [find where name~"googleadservices"]
		:log warning "adblock list imported"

	} else={
		:log warning "adblock list not downloaded, script stopped"
	}
} on-error={
	:log warning "adblock list download FAILED"
}

At my home, this list do block around 4500 sites a week.

Can you explain that a bit better jotne…
So you access a list from the internet eu something something.

Then I get lost, you import this list to somewhere
Then you remove parts of the list ???
Then somehow the list doesnt work right

Very confusing what you are doing.

And how does this block anything??

Its not my script, just cleaned it up some.

Script do download from internet a list of around 17000 DNS pointers that are added to your router.

Example this list likes to block CNN, it will add your your router www.cnn.com with an ip of 127.0.0.1
So if you do visit at site that like to open at 3rd party url to www.cnn.com, it will not reach it.

This is just a huge list of DNS that are used by advertising company that your will then block.

Static DNS on the Tik can act like a hosts file does under a PC OS.
Tiks with low memory will have issues loading this type of list so if one has tiks like hEX memory can be exhausted quickly.

I have no problem with this list with 17000 DNS host on my hEX
At the same time I have a fw rule that block all IP that tries any blocked port on my router for 24 hour. This list has between 7000 and 15000 IP at the same time as the DNS block list.

What did eat my memory is the DoH that has a memory bug, so disabled at the moment.

PS also have configuration like a medium large company with VPN, 30+ filter, 15+ NAT rules +++ and running fine.

I consider a true security breach import any file downloaded from 3rd party site with /import file-name=$scriptName command.

If some hacker or the author itself put some commands inside the downloaded file, can do anything he want with the RouterBOARD…

See my reply on this in other post.

My reply to your reply :wink: