summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortristan <steckbrief@geekmail.de>2019-03-15 11:40:09 +0100
committertristan <steckbrief@geekmail.de>2019-03-15 11:40:09 +0100
commitce5c3fd5ff52eb8168b7b998743dd6183ecfc5be (patch)
tree05de8323781e973f5968bf83a7212e465d0db55e
parent3dc24e89b876888cdfac9e3c52d58799fba0e4de (diff)
adds first implementation of retrieve and build AdBlocklists
-rw-r--r--adfilelist.txt7
-rw-r--r--adlists/README1
-rwxr-xr-xbuildAdBlocklist.sh6
-rwxr-xr-xretrieveAdBlocklists.sh4
4 files changed, 18 insertions, 0 deletions
diff --git a/adfilelist.txt b/adfilelist.txt
new file mode 100644
index 0000000..a029429
--- /dev/null
+++ b/adfilelist.txt
@@ -0,0 +1,7 @@
+StevenBlack|https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts
+MalwareDomains|https://mirror1.malwaredomains.com/files/justdomains
+SysCtl|http://sysctl.org/cameleon/hosts
+Zeus|https://zeustracker.abuse.ch/blocklist.php?download=domainblocklist
+DisconnectSimple|https://s3.amazonaws.com/lists.disconnect.me/simple_tracking.txt
+DisconnectAd|https://s3.amazonaws.com/lists.disconnect.me/simple_ad.txt
+HostsFile|https://hosts-file.net/ad_servers.txt
diff --git a/adlists/README b/adlists/README
new file mode 100644
index 0000000..77fa04a
--- /dev/null
+++ b/adlists/README
@@ -0,0 +1 @@
+This directory is for the downloaded source ad block lists
diff --git a/buildAdBlocklist.sh b/buildAdBlocklist.sh
new file mode 100755
index 0000000..c12d2a6
--- /dev/null
+++ b/buildAdBlocklist.sh
@@ -0,0 +1,6 @@
+#°/bin/bash
+ADLISTDIR=adlists
+for adfile in $(ls $ADLISTDIR); do
+ grep -v '^#' < $ADLISTDIR/$adfile | grep -v '^$' | awk '{if (0 < match($0, "\t") || 0 < index($0, " ")) {split($0,b," "); print b[2]} else print $0}' | grep -v '^localhost$' | grep -v '^local$' | grep -v '^localhost.localdomain$' | grep -v '^ip6-localnet$' | grep -v '^ip6-localhost$' >> block.list
+done
+
diff --git a/retrieveAdBlocklists.sh b/retrieveAdBlocklists.sh
new file mode 100755
index 0000000..a56c73e
--- /dev/null
+++ b/retrieveAdBlocklists.sh
@@ -0,0 +1,4 @@
+#!/bin/bash
+while read p; do
+ echo "$p" | awk '{split($0,a,"|"); system("wget -O adlists/"a[1] " " a[2])}'
+done < adfilelist.txt