/Netfilter-Adblock

Use kernel module to block ads

Primary LanguageCGNU General Public License v3.0GPL-3.0

Netfilter-Adblocker

using netfilter to block ads hosts

Usage

Download dependencies

$ sudo apt-get install libelf-dev gperf clang llvm linux-tools-`uname -r`

For userspace program, you need to download libnetfilter first.

$ sudo apt-get install libnetfilter-dev
$ make user
$ ./adblock

To run as kernel module

$ make kernel

For BPF program, you need to download bpftool and clang to compile. And make sure you have cloned the libbpf submodule

$ make ssl_sniff

The full functionality need both kernel module and bpf program. If you just want to block host then you can just load module. The BPF program is to handle TLS connection

$ make

Update Host Block List

Just append the host you want to block to the file hosts

Make sure there isn't any blank line in your list