Build blacklist #38
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
name: "Build blacklist" | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: "0 0 * * 6" | |
jobs: | |
blacklist: | |
name: Build Blacklist | |
runs-on: ubuntu-latest | |
steps: | |
- name: Generate Token | |
uses: tibdex/github-app-token@3beb63f4bd073e61482598c45c71c1019b59b73a # v2.1.0 | |
id: generate-token | |
with: | |
app_id: "${{ secrets.BOT_APP_ID }}" | |
private_key: "${{ secrets.BOT_APP_PRIVATE_KEY }}" | |
- name: Download blacklist source | |
run: | | |
HOSTS_FILE="/tmp/hosts.blacklist" | |
destination="hosts.blacklist" | |
HOSTS_FILES="$HOSTS_FILE.d" | |
mkdir -p "${HOSTS_FILES}" | |
download() { | |
echo "download($1)" | |
curl \ | |
--location --max-redirs 3 \ | |
--max-time 20 --retry 3 --retry-delay 0 --retry-max-time 60 \ | |
"$1" > "$(mktemp "${HOSTS_FILES}"/XXXXXX)" | |
} | |
# https://firebog.net/ | |
## suspicious domains | |
# download "https://hosts-file.net/grm.txt" | |
download "https://reddestdream.github.io/Projects/MinimalHosts/etc/MinimalHostsBlocker/minimalhosts" | |
download "https://raw.githubusercontent.com/StevenBlack/hosts/master/data/KADhosts/hosts" | |
download "https://raw.githubusercontent.com/StevenBlack/hosts/master/data/add.Spam/hosts" | |
download "https://v.firebog.net/hosts/static/w3kbl.txt" | |
## advertising domains | |
download "https://adaway.org/hosts.txt" | |
download "https://v.firebog.net/hosts/AdguardDNS.txt" | |
download "https://raw.githubusercontent.com/anudeepND/blacklist/master/adservers.txt" | |
download "https://s3.amazonaws.com/lists.disconnect.me/simple_ad.txt" | |
# download "https://hosts-file.net/ad_servers.txt" | |
download "https://v.firebog.net/hosts/Easylist.txt" | |
download "https://pgl.yoyo.org/adservers/serverlist.php?hostformat=hosts;showintro=0" | |
download "https://raw.githubusercontent.com/StevenBlack/hosts/master/data/UncheckyAds/hosts" | |
## tracking & telemetry domains | |
download "https://v.firebog.net/hosts/Easyprivacy.txt" | |
download "https://v.firebog.net/hosts/Prigent-Ads.txt" | |
download "https://gitlab.com/quidsup/notrack-blocklists/raw/master/notrack-blocklist.txt" | |
download "https://raw.githubusercontent.com/StevenBlack/hosts/master/data/add.2o7Net/hosts" | |
download "https://raw.githubusercontent.com/crazy-max/WindowsSpyBlocker/master/data/hosts/spy.txt" | |
## malicious domains | |
download "https://s3.amazonaws.com/lists.disconnect.me/simple_malvertising.txt" | |
download "https://mirror1.malwaredomains.com/files/justdomains" | |
download "https://hosts-file.net/exp.txt" | |
download "https://hosts-file.net/emd.txt" | |
download "https://hosts-file.net/psh.txt" | |
download "https://mirror.cedia.org.ec/malwaredomains/immortal_domains.txt" | |
# download "https://www.malwaredomainlist.com/hostslist/hosts.txt" | |
download "https://bitbucket.org/ethanr/dns-blacklists/raw/8575c9f96e5b4a1308f2f12394abd86d0927a4a0/bad_lists/Mandiant_APT1_Report_Appendix_D.txt" | |
download "https://v.firebog.net/hosts/Prigent-Malware.txt" | |
download "https://v.firebog.net/hosts/Prigent-Phishing.txt" | |
download "https://phishing.army/download/phishing_army_blocklist_extended.txt" | |
download "https://gitlab.com/quidsup/notrack-blocklists/raw/master/notrack-malware.txt" | |
download "https://v.firebog.net/hosts/Shalla-mal.txt" | |
download "https://raw.githubusercontent.com/StevenBlack/hosts/master/data/add.Risk/hosts" | |
cat "${HOSTS_FILES}"/* | \ | |
sed \ | |
-e 's/0.0.0.0//g' \ | |
-e 's/127.0.0.1//g' \ | |
-e '/255.255.255.255/d' \ | |
-e '/::/d' \ | |
-e '/#/d' \ | |
-e 's/\s//g' \ | |
-e '/</d' \ | |
-e '/^.com$/d' \ | |
-e '/^localhost$/d' \ | |
-e '/^MalvertisinglistbyDisconnect$/d' \ | |
-e '/^$/d' \ | |
-e 's/^/0.0.0.0 /g' | \ | |
awk '!a[$0]++' | sort -u > "${HOSTS_FILE}" | |
rm -rf "${HOSTS_FILES}" | |
mv "${HOSTS_FILE}" "${destination}" | |
ls -l ${destination} | |
- name: Upload blacklist | |
uses: svenstaro/upload-release-action@1beeb572c19a9242f4361f4cee78f8e0d9aec5df # v2 | |
with: | |
release_name: "Pi-Hole Blacklist" | |
repo_token: ${{ steps.generate-token.outputs.token }} | |
file: hosts.blacklist | |
asset_name: hosts.blacklist | |
tag: pi-hole | |
overwrite: true | |
body: "Current blacklisted sites" |