Coder Social home page Coder Social logo

psvnlsaikumar / hblock Goto Github PK

View Code? Open in Web Editor NEW

This project forked from hectorm/hblock

0.0 2.0 0.0 2.98 MB

Improve your security and privacy by blocking ads, tracking and malware domains.

Home Page: https://hblock.molinero.dev

License: MIT License

Shell 88.47% Batchfile 1.12% Makefile 10.41%

hblock's Introduction

Build Website License


Improve your security and privacy by blocking ads, tracking and malware domains.

Table of contents

What is this for?

This POSIX-compliant shell script, designed for Unix-like systems, gets a list of domains that serve ads, tracking scripts and malware from multiple sources and creates a hosts file (alternative formats are also supported) that prevents your system from connecting to them.

Is it safe to use?

Absolutely, this script selects only the domain names for each source, so if a domain name is redirected to a rogue server your system will not be affected. In the worst scenario you can lose access to a legitimate domain name due a false positive, but you can reverse it by adding that domain to the whitelist.

Nightly builds

I provide nightly builds of the hosts file and other formats, including installers for Windows (batch file) and Android (flashable zip).

https://hblock.molinero.dev

Installation

Manual

curl -o /tmp/hblock 'https://raw.githubusercontent.com/hectorm/hblock/v2.1.7/hblock' \
  && echo 'e357fc9439d7b79036c7939f976aab9cbd25878c4651e5a757e30ff96452edc2  /tmp/hblock' | shasum -c \
  && sudo mv /tmp/hblock /usr/local/bin/hblock \
  && sudo chown root:root /usr/local/bin/hblock \
  && sudo chmod 755 /usr/local/bin/hblock

Note: you can use this Systemd timer to regularly update the hosts file for new additions.

Optionally, it is possible to use NPX to run hBlock without installation

npx hblock

Gentoo

Add the src_prepare overlay with the help of the official repository.

Unmask the net-firewall/hblock package with the help of the Gentoo wiki.

Run:

emerge --verbose net-firewall/hblock

Usage

Script arguments

You can also change the default behavior using these options:

Usage: hblock [options...]
 -O, --output <FILE>
        Output file location
        (default: "/etc/hosts" file)
 -H, --header <FILE>
        Content to be included at the beginning of the output file
        (default: HBLOCK_HEADER environment variable,
        "/etc/hblock.d/header" file or builtin value)
 -F, --footer <FILE>
        Content to be included at the end of the output file
        (default: HBLOCK_FOOTER environment variable,
        "/etc/hblock.d/footer" file or builtin value)
 -S, --sources <FILE>
        Newline separated URLs used to generate the blocklist
        (default: HBLOCK_SOURCES environment variable,
        "/etc/hblock.d/sources.list" file or builtin value)
 -W, --whitelist <FILE>
        Newline separated domains to be removed from the blocklist
        (default: HBLOCK_WHITELIST environment variable,
        "/etc/hblock.d/whitelist.list" file or builtin value)
 -B, --blacklist <FILE>
        Newline separated domains to be added to the blocklist
        (default: HBLOCK_BLACKLIST environment variable,
        "/etc/hblock.d/blacklist.list" file or builtin value)
 -R, --redirection <REDIRECTION>
        Redirection for all entries in the blocklist
        (default: 0.0.0.0)
 -T, --template <TEMPLATE>
        POSIX BREs replacement applied to each entry
        \1 = <DOMAIN>, \2 = <REDIRECTION>
        (default: \2 \1)
 -C, --comment <COMMENT>
        Character used for comments
        (default: #)
 -b, --backup [DIRECTORY]
        Make a time-stamped backup in <DIRECTORY>
        (default: output file directory)
 -l, --lenient
        Match all entries from sources, regardless of their IP
        (default: 0.0.0.0, 127.0.0.1 or none)
 -r, --enable-whitelist-regex
        Use POSIX BREs instead of fixed strings
 -i, --ignore-download-error
        Do not abort if a download error occurs
 -c, --color <auto|true|false>
        Colorize the output
        (default: auto)
 -q, --quiet
        Suppress non-error messages
 -v, --version
        Show version number and quit
 -h, --help
        Show this help and quit

Run preview

asciicast

Sources

Name Primary Mirror
adaway.org URL URL
AdBlock NoCoin List URL URL
AdGuard - Simplified URL URL
AntiPopads URL URL
disconnect.me - Ad URL URL
disconnect.me - Malvertising URL URL
disconnect.me - Malware URL URL
disconnect.me - Tracking URL URL
DShield.org - High URL URL
EasyList URL URL
EasyPrivacy URL URL
ETH Phishing Detect URL URL
FadeMind - add.2o7Net URL URL
FadeMind - add.Dead URL URL
FadeMind - add.Risk URL URL
FadeMind - add.Spam URL URL
Geoffrey Frogeye - First-party trackers URL URL
hostsVN URL URL
KADhosts URL URL
lightswitch05 - Ads & Tracking URL URL
malwaredomainlist.com URL URL
malwaredomains.com - Immortal domains URL URL
malwaredomains.com - Just domains URL URL
matomo.org - Spammers URL URL
mitchellkrogza - Badd-Boyz-Hosts URL URL
pgl.yoyo.org URL URL
Phishing Army URL URL
someonewhocares.org URL URL
spam404.com URL URL
StevenBlack URL URL
uBlock URL URL
uBlock - Badware URL URL
uBlock - Privacy URL URL
winhelp2002.mvps.org URL URL
ZeroDot1 - CoinBlockerLists URL URL

Disclaimer

This script, by default, replaces the /etc/hosts file of your system. I am not responsible for any damage or loss, always make backups.

License

See the license file.

hblock's People

Contributors

dlford avatar hectorm avatar lightswitch05 avatar theevilskeleton avatar tobaloidee avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.