Hulios:一个基于 eBPF 的 Linux 透明 Tor 网关
Hulios: An eBPF-powered, transparent Tor gateway for Linux

原始链接: https://github.com/ghaziwali/Hulios

**Hulios**(硬化通用 Linux 隐身与洋葱系统)是一款基于 eBPF 的 Tor VPN 网关,旨在为 Linux 提供透明且防泄漏的网络安全保护。它利用内核套接字钩子(kernel socket hooks)和 cgroup 策略路由,强制将出站 TCP 和 DNS 流量通过内置的 Arti Tor 客户端进行传输,无需修改 `resolv.conf` 等系统配置文件。 **主要安全特性:** * **权限隔离:** 采用具有 root 权限的守护进程管理 eBPF 钩子,同时将网络任务委托给沙盒化的非特权工作进程。 * **故障安全关闭开关(Kill-Switch):** 使用内核策略表和黑洞机制,在服务故障时立即阻断流量,防止 IP 泄漏。 * **LSM 保护:** 阻止原始套接字(raw socket)的创建,以防止应用程序绕过安全规则。 **要求与使用:** Hulios 要求 Linux 内核版本 5.10 及以上,并支持 BPF 和 cgroup v2。可通过 Arch 用户仓库(`hulios-git`)安装,或使用 Rust 编译源码。虽然 Hulios 提供了强大的传输层安全保护,但它无法阻止应用层指纹识别,也无法提供绝对的匿名性。建议用户搭配 Tor Browser 使用以获得最大程度的保护。 *免责声明:本软件按“原样”提供;它无法防范 root 级别的宿主机入侵。*

**Hulios** 是一个基于 eBPF 的新项目,旨在为 Linux 提供透明的 Tor 网关。该工具由 GitHub 用户 ghaziwali 开发,利用 eBPF 为本地套接字标记 `fwmark`,同时通过 Arti 库在用户空间处理网络流量和 Tor 加密,以确保安全性。 该项目近期出现在 Hacker News 上,开发者就其架构回答了社区提问。用户提出的一个主要担忧是通过 eBPF 在内核层面运行网络基础设施可能带来的安全风险。开发者澄清道,eBPF 组件仅限于套接字标记,而敏感的加密操作则安全地隔离在用户空间内。讨论中还出现了一个关于项目代码注释的轻松互动,开发者打趣称这些注释对 eBPF 验证器来说是“承重”的。
相关文章

原文

Hardened Universal Linux Invisibility and Onion System

Hulios is an eBPF-powered, transparent Tor VPN gateway for Linux. It secures outbound network traffic by redirecting TCP sockets and DNS queries through an embedded Arti (Tor client) instance and a localized Hickory-based DNS resolver. By operating at the kernel socket level via cgroup hooks and policy routing, Hulios implements robust leak-resistant boundaries without modifying runtime resolv.conf configurations or relying on external firewall daemons.

Kernel Technology Rust Platform


🔒 Security Architecture

Hulios implements a strict privilege-separated runtime model:

  • Privilege Separation: The entry point supervisor runs with host root privileges to hook eBPF programs and build policy routing tables, then immediately spawns an unprivileged worker child.
  • Sandbox Isolation: The worker process drops privileges to nobody and is isolated using a restrictive seccomp system call filter.
  • Fail-Secure Kill-Switch: Output traffic routing is locked using kernel policy tables (table 100) and default blackholes. In the event of a daemon crash or forced shutdown (SIGKILL), the blackholes remain active, blocking outgoing traffic to prevent IP leaks until a manual recovery is initiated.
  • Raw Socket Blocker: An LSM eBPF hook blocks raw AF_PACKET socket creation globally to prevent applications from bypassing standard IP routing rules.

  • Linux Kernel: Version 5.10 or higher.
  • Kernel Configs: CONFIG_BPF_SYSCALL, CONFIG_BPF_LSM, and CONFIG_CGROUPS_V2 must be enabled.
  • Build Dependencies: clang and libelf (required for compile-time eBPF compilation).

Tested and verified on Arch Linux and Debian 13 (Bookworm).


⚙️ Build and Installation

Hulios is available on the Arch User Repository as hulios-git:

# Using paru
paru -S hulios-git

# Using yay
yay -S hulios-git

🛠️ Building from Source

1. Install Build Dependencies

  • Arch Linux:
    sudo pacman -S clang libelf zlib sqlite
  • Debian/Ubuntu:
    sudo apt install -y clang libelf-dev zlib1g-dev libsqlite3-dev

Ensure you have the Rust compiler installed (toolchain selection and target requirements are automatically managed by rust-toolchain.toml):

git clone https://github.com/ghaziwali/Hulios.git
cd Hulios
cargo build --release

The compiled binary will be located at target/release/hulios.


All commands that interact with kernel interfaces or policy routing require elevated privileges:

# View global help and available commands
./target/release/hulios --help

# View help for a specific command (e.g. start)
./target/release/hulios start --help

# Start Hulios in foreground TUI mode
sudo ./target/release/hulios start

# Check current running state and Tor bootstrap progress
./target/release/hulios status

# Verify network namespace integrity and check for leaks
sudo ./target/release/hulios diagnose

# Revert system network settings and recover from unclean shutdowns
sudo ./target/release/hulios recover

# Stop Hulios and restore standard internet routing
sudo ./target/release/hulios stop

Hulios automatically generates a default, self-documenting template file at /etc/hulios/config.toml on its first run if one is not already present. Open the generated file to customize variables (such as preferred Tor exit nodes, DNS redirects, custom SOCKS ports, or strict lockdown mode).


If you find Hulios useful and would like to support its ongoing security development and research, donations are greatly appreciated:

  • Bitcoin (BTC): bc1q0gllvd7fe2y48emjd4shf42ul3cl4pgda5zpqz
  • USDT (TRON / TRC20): TQWUmTATa8sDntobTNGkLmbgmHVS9iWCRx
  • USDC (Ethereum / ERC20): 0x16aFd1De7889071194A026D79393eb3CE659181e

Hulios securing the network transport layer (Layer 3) does not guarantee total anonymity.

  • No Liability / Misuse: THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED. THE DEVELOPER ASSUMES NO LIABILITY OR RESPONSIBILITY FOR ANY DATA LEAKS, PRIVACY COMPROMISES, LEGAL CONSEQUENCES, SYSTEM INSTABILITY, OR DAMAGES ARISING FROM THE USE, MISUSE, OR ILLEGAL APPLICATION OF HULIOS.
  • Application Fingerprinting: Hulios does not strip application-level trackers, cookies, or browser fingerprinting configurations. For web browsing, it is highly recommended to use the official Tor Browser configured to route through the Hulios SOCKS interface.
  • Host Compromise: Hulios cannot protect your system if an adversary obtains root access, as they can unload eBPF programs and alter routing tables.
  • Tor Network Limitations: Your traffic is subject to the security of the Tor network, including potential correlation attacks by entities controlling both entry and exit nodes.
联系我们 contact @ memedata.com