EBAF – eBPF Based Ad Firewall

原始链接: https://github.com/Kazedaa/eBAF

eBAF is an open-source adblocker designed to combat Spotify's intrusive advertising model. It argues that Spotify's "free" tier exploits users' time and underpays artists while maximizing profits. EBAF aims to provide an "elegant act of digital resistance" by blocking ads at the kernel level using eBPF technology, inspecting network packets and blocking connections to known ad servers. It differentiates itself from "sketchy mods" and "malware" by offering a clean, transparent solution. The software boasts dynamic blacklist updates, a user-friendly web dashboard for monitoring, and high-performance operation. Installation is simplified with one-line commands, along with options to integrate with Spotify. The project encourages users to edit blacklist files for customization. EBAF's creators view ad blocking not as theft, but as opting out of a system that commodifies attention and interrupts the listening experience. They see it as drawing a line against the underpayment of artists and the manipulative tactics employed by Spotify to push subscriptions.

Here's a summary of the Hacker News thread about "EBAF – eBPF Based Ad Firewall": The project, which aims to block ads using kernel-level packet filtering, received harsh criticism. Commenters questioned the need for such a complex solution when simpler methods like host files or DNS servers exist. Many suspected the project was AI-generated due to poor design choices, including modifying the sudoers file during installation, which poses a significant security risk by allowing execution of eBPF code without a password. Concerns were raised about the project's resource usage, such as frequent DNS re-resolution and a web dashboard listening on all interfaces instead of localhost. Furthermore, the thread delved into the ethics of ad-blocking, with some arguing that it constitutes piracy while others maintained it's a user's right to control their network. A debate arose about the role of TLS and DoH in protecting user privacy versus potentially hindering user control over their own systems.
相关文章

原文

eBAF - eBPF Ad Firewall Banner

"You Wouldn't Download an Ad"

Spotify has built an empire on a simple formula: monetize your attention, underpay the artists, and sell you back your own time as a premium feature. In their world, your listening experience is not yours. It’s a carefully curated marketplace — your ears are the product, your patience is the currency.

They like to call it a "free" tier. But let’s be honest: it’s not free if you’re paying with your time.

Meanwhile, the artists you love — the people whose work keeps the platform alive — often earn mere fractions of pennies per stream. Spotify profits handsomely, the advertisers get their exposure, and the creators? They get scraps.

This isn’t just about skipping a few annoying ads. It’s about refusing to participate in a system that profits from exploitation, distraction, and the commodification of your attention.

An elegant little act of digital resistance: a clean, open-source adblocker for Spotify that stops the noise — literally.

No sketchy mods, no cracked clients, no malware masquerading as freedom. Just one goal: let the music play without being held hostage by ads.

Spotify isn’t free — you pay with your patience.

They bombard you with the same grating ads, over and over, until you give up and subscribe. Not because you love Premium. But because you’ve been worn down. That’s not freemium — that’s psychological warfare with a playlist.

Meanwhile, the artists? Still underpaid. The ads? Louder. More frequent. Sometimes literally louder. You? Just trying to vibe.

They profit from your patience and their underpayment of creators, all while pretending it’s the only sustainable way. Spoiler: it isn’t. They had a choice — but they chose profit margins over people.

Spotify wants you to believe this is the cost of access. We believe that’s a lie.

We’re not pirates. We’re not criminals. We’re just people who think it's okay to draw a line.

This project isn’t about skipping a few ads. It’s about rejecting a system that says your silence can be sold, your experience can be interrupted, and your value begins only when you open your wallet.

Blocking ads is not theft.
Stealing your time is.
We’re not here to pirate. We’re here to opt out.

You wouldnt Download an Ad. But you would block one.

eBAF (eBPF Ad Firewall) leverages the power of eBPF (Extended Berkeley Packet Filter) to block unwanted advertisements at the kernel level. Here's a high-level overview of its functionality:

eBAF (eBPF Ad Firewall) leverages eBPF (Extended Berkeley Packet Filter) to block ads at the kernel level efficiently. Here's a simplified overview:

  1. Packet Filtering:

    • Inspects incoming network packets and blocks those matching a blacklist of IP addresses using XDP (eXpress Data Path).
  2. Dynamic Updates:

    • Resolves domain names into IP addresses and updates the blacklist dynamically to stay effective against changing ad servers.
  3. Web Dashboard:

    • Provides live statistics and monitoring through a user-friendly interface.
  4. High Performance:

    • Operates directly at the network interface level, bypassing the kernel's networking stack for faster processing and minimal resource usage.

eBAF combines efficiency, transparency, and ease of use to deliver a powerful ad-blocking solution.

Simple Install (Reccomended)

Make sure to have git and curl installed

git --version
curl --version

Enable Spotify integration (Recommended)

EBAF_ENABLE_SPOTIFY=yes curl -sSL https://github.com/Kazedaa/eBAF/raw/main/install.sh | sudo -E bash
EBAF_ENABLE_SPOTIFY=no curl -sSL https://github.com/Kazedaa/eBAF/raw/main/install.sh | sudo bash```
curl -sSL https://raw.githubusercontent.com/Kazedaa/eBAF/main/uninstall.sh | sudo bash

Run the following commands to install the required dependencies:

sudo apt-get update
sudo apt-get install libbpf-dev clang llvm libelf-dev zlib1g-dev gcc make python3

sudo apt update
sudo apt install net-tools
sudo dnf update
sudo dnf install -y libbpf-devel clang llvm elfutils-libelf-devel zlib-devel gcc make python3 net-tools bc
sudo pacman -Syu
sudo pacman -S --needed libbpf clang llvm libelf zlib gcc make python net-tools bc

Fix asm/types.h Error whiel running eBPF code

Check the current link ls -l /usr/include/asm Find the currect link find /usr/include -name "types.h" | grep asm Fix the symbolic link

sudo rm /usr/include/asm
sudo ln -s <current_link> /usr/include/asm

To build the eBPF Adblocker, follow these steps:

  1. Clone the repository:

    git clone <repository-url>
    cd eBAF
  2. Build the project:

  3. (Optional) Install system-wide:

  4. Other install options (help desk)

  5. UnInstall

Uses spotify-stable.txt as default Blacklist.
Usage: ebaf [OPTIONS] [INTERFACE...]
OPTIONS:
-a, --all               Run on all active interfaces
-d, --default           Run only on the default interface (with internet access)
-i, --interface IFACE   Specify an interface to use
-D, --dash              Start the web dashboard (http://localhost:8080)
-q, --quiet             Suppress output (quiet mode)
-h, --help              Show this help message

Edit the lists to add or remove domains. Each domain should be on a separate line. Comments start with #.

A Special thanks to ❤️

  1. Isaaker's Spotify-AdsList
  2. AnanthVivekanand's spotify-adblock

for providing a spotify block list

⭐️ Support the Project

If you find eBAF useful, please consider starring the repository on GitHub! Your support helps increase visibility and encourages further development.

联系我们 contact @ memedata.com