From ce5c3fd5ff52eb8168b7b998743dd6183ecfc5be Mon Sep 17 00:00:00 2001 From: tristan Date: Fri, 15 Mar 2019 11:40:09 +0100 Subject: adds first implementation of retrieve and build AdBlocklists --- adfilelist.txt | 7 +++++++ adlists/README | 1 + buildAdBlocklist.sh | 6 ++++++ retrieveAdBlocklists.sh | 4 ++++ 4 files changed, 18 insertions(+) create mode 100644 adfilelist.txt create mode 100644 adlists/README create mode 100755 buildAdBlocklist.sh create mode 100755 retrieveAdBlocklists.sh 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 -- cgit v1.2.3