Skip to content

Latest commit

 

History

History
235 lines (161 loc) · 14 KB

README.md

File metadata and controls

235 lines (161 loc) · 14 KB

This project is still in beta! It currently works well, but some changes may be expected.

  ______              _____            _        _ _           _             
 |  ____|            / ____|          | |      (_) |         | |            
 | |__ _ __ ___  ___| |     ___  _ __ | |_ _ __ _| |__  _   _| |_ ___  _ __ 
 |  __| '__/ _ \/ _ \ |    / _ \| '_ \| __| '__| | '_ \| | | | __/ _ \| '__|
 | |  | | |  __/  __/ |___| (_) | | | | |_| |  | | |_) | |_| | || (_) | |   
 |_|  |_|  \___|\___|\_____\___/|_| |_|\__|_|  |_|_.__/ \__,_|\__\___/|_|   

Enjoy a safe and faster web experience

TL:DR cat domains-{ads,tracking,malware} > /dev/null

Intro

More and more people use "adblocker" plugins within their desktop browsers. FreeContributor is an alternative for "ad blocking extensions" in your browser.

FreeContributor intends to extract domains lists from various sources. It blocks ads, malware, trackers at DNS level.

Why

What the scripts does?

  • Backup the original configuration files.
  • Download and merge domains lists from various sources.

Benefits and Features

  • Low CPU and RAM usage.
  • Speeds up your Internet use since the local file is checked first, before send a DNS request.
  • Data savings since the ad content is never downloaded.
  • Stops ad tracking and protect your privacy.
  • Blocks spyware and malware. That increases the safety of your networking experience.
  • Not just for browsers, it blocks ads and malware across the entire operative system.

Requirements

Installation and Usage

git clone https://github.com/tbds/FreeContributor
cd FreeContributor
    USAGE: 

      $ ./FreeContributor.sh [-f format]  [-o out] [-t target]

       -f format: specify an output format:

          none        Extract domains only
          hosts       Use hosts format
          dnsmasq     dnsmasq as DNS resolver
          unbound     unbound as DNS resolver
          pdnsd       pdnsd as DNS resolver

       -o out: specify an output file

       -t target: specify the target
    
          default: 0.0.0.0
                   ::
                   NXDOMAIN
                   custom (e.g. 192.168.1.20)

       -help         Show this help


    EXAMPLES:

      $ ./FreeContributor.sh -f hosts -t 0.0.0.0

      $ ./FreeContributor.sh -f dnsmasq -t NXDOMAIN

FreeContributor comes with some scripts, such as exporting uBlock Origin/uMatrix rules to various formats: hosts, dnsmasq, pdnsd and unbound.

Sources

Inspired by jmdugan's blocklists project, FreeContributor project comes with a catalog of corporation domain names that people may want to block.

FreeContributor also downloads external files, each has its own license, detailed in the list below. Thanks to the people working hard to maintain the filter lists below that FreeContributor is using.

You can also contribute with your own lists, see CONTRIBUTING.

URL Details License
Adaway list Infrequent updates, approx. 400 entries CC Attribution 3.0
Disconnect Numerous updates on the same day, approx. 6.500 entries ?
MVPS Hosts Infrequent updates, approx. 15.000 entries CC Attribution-NonCommercial-ShareAlike 4.0
hpHosts’s ad and tracking servers‎ Read Terms of Use
Peter Lowe’s Ad server list Weekly updates, approx. 2.500 entries ?
Dan Pollock’s hosts file Weekly updates, approx. 12.000 entries non-commercial
CAMELEON Weekly updates, approx. 21.000 entries ?
StevenBlack/hosts ?
Quidsup/notrack ?
Gorhill's uMatrix Blocklist ?
Malware Domain List Daily updates, approx. 1.500 entries ?
AdBlock filter CC Attribution 3.0
Hostfile project LGPL as GPLv2
Airelle's host file CC Attribution 3.0
The Hosts File Project LGPL
Mahakala ?
Secure Mecca LGPL as GPLv2
Spam404scamlist Infrequent updates, approx. 5.000 entries CC Attribution-ShareAlike 4.0 International
Malwaredomains Daily updates, approx. 16.000 entries ?
Adzhosts ?
hosts.eladkarako.com ?
Malekal ?
dshield Daily updates, approx. 4.500 entries NonCommercial-ShareAlike 2.5 Generic
openphish Numerous updates on the same day, approx. 1.800 entries ?
Zeustracker Daily updates, approx. 440 entries ?
Feodotracker Daily updates, approx. 0-10 entries ?
Palevo tracker Daily updates, approx. 15 entries ?
Ransomware tracker Daily updates, approx. 150 entries ?
Shalla's Blacklists Daily updates, approx. 32.000 entries description ?
Windows Spy Blocker Infrequent updates, approx. 120 entries ?

DNS 101

Without an custom DNS Server

+----+      +------------+      +------------------+      +------------------------+
| PC | <==> | DNS Server | <==> | Other DNS Server | <==> | example.tld = ip adress|
+----+      +------------+      +------------------+      +------------------------+

+----+      +-------------------------- + 
| PC | <==> | ip adress of example.tld  |
+----+      +---------------------------+ 

With a local DNS resolver

+----+      +----------------+      +------------------+      +------------------+
| PC |      | DNS Server     | <==> | Other DNS Server | <==> | goodwebsite.tld  |
+----+      +----------------+      +------------------+      +------------------+
  ^^             ^^                                  +------------+    ||
  ||             ||                                  | DNS cache  |  <= / 
  vv             ||                                  +------------+
+--------------------+      +----------------------------------------------------+
| local DNS resolver | <==> | ads.example.tld = 127.0.0.1 or 0.0.0.0 or NXDOMAIN | 
+--------------------+      +----------------------------------------------------+

future requests of goodwebsite.tld

+----+      +--------------------+      +------------------------------------------+
| PC | <==> | local DNS resolver | <==> | DNS cache of goodwebsite.tld = ip adress |
+----+      +--------------------+      +------------------------------------------+

Hosts vs DNS resolver

The hosts blocking method can not use wildcards (*) and and therefore someone must keep track of each subdomain that should be blocked. Some DNS caching servers can block the domain and subdomains with just one rule. For example /etc/hosts

127.0.0.1 example.tld
0.0.0.0 example.tld

Will redirect example.tld to the localhost, but not ads.example.tld. With a dns caching server, such as Dnsmasq, for example /etc/dnsmasq.conf

address=/example.tld/127.0.0.1
address=/example.tld/0.0.0.0
server=/example.tld/

Will redirect example.tld and all subdomains to 127.0.0.1 or 0.0.0.0. Better yet, it can return NXDOMAIN.

Comparison

Program Language Adblocking Method
FreeContributor Bash DNS resolver (Dnsmasq, Unbound or Pdnsd)
Pi-Hole Bash, Php Dnsmasq
NoTrack Bash, Php Dnsmasq
Hostsblock Bash Hosts with Dnsmasq (for cache only)
hBlock Shell Hosts
dnsgate Python Hosts or Dnsmasq
StevenBlack hosts Python Hosts
adsuck C DNS server
dnswhisperer C DNS proxy
pfBlockerNG Shell, PHP DNS resolver: Unbound
Hosts Updater Ruby Hosts
Rescached C++ Hosts
OpenWRT package Shell Dnsmasq
grimd Go goDNS

Disclaimer

  • Read the script to make sure it is what you need.
  • This script needs acess to /etc directory of your system. I am not responsible for any damage or loss, always make backups.

License

FreeContributor is licensed under the General Public License (GPL) version 3

The ASCII art logo at the top was made using FIGlet.