Skip to content

Force Proxy to any Windows/MacOS/Linux Application TCP and UDP traffic

ci(linux): new build dependencies, portability job on older distros, docs

anof-cyber6c63feac2a7c
diff --git a/.github/workflows/build-linux.yml b/.github/workflows/build-linux.yml
index 83c9c00..c298cf1 100644
--- a/.github/workflows/build-linux.yml
+++ b/.github/workflows/build-linux.yml
@@ -33,6 +33,8 @@ jobs:
linux-tools-common \
linux-tools-generic \
libbpf-dev \
+ libelf-dev \
+ zlib1g-dev \
libgtk-3-dev \
pkg-config
shell: bash
@@ -85,7 +87,7 @@ jobs:
run: |
cd Linux
chmod +x build.sh
- ./build.sh
+ WERROR=1 ./build.sh
shell: bash
- name: Verify build output
@@ -141,6 +143,25 @@ jobs:
echo "✓ no libnetfilter dependency"
shell: bash
+ - name: Portability - run the binaries on older distributions (issue 146)
+ # BIND_NOW makes the loader resolve every glibc symbol at start-up, so a clean --help run in these images proves the
+ # binaries do not need a newer glibc than Ubuntu 22.04 / Debian 12 / RHEL 9 era systems provide.
+ run: |
+ set -e
+ out="$PWD/Linux/output"
+ run_in() { # image, install command
+ echo "::group::$1"
+ docker run --rm -v "$out:/out:ro" "$1" sh -c "$2 >/dev/null 2>&1 &&
+ LD_LIBRARY_PATH=/out /out/ProxyBridge --help | grep -q -- '--proxy' && echo 'CLI starts' &&
+ missing=\$(LD_LIBRARY_PATH=/out ldd /out/ProxyBridge /out/libproxybridge.so /out/ProxyBridgeGUI 2>&1 | grep 'not found' || true) &&
+ if [ -n \"\$missing\" ]; then echo \"missing: \$missing\"; exit 1; fi && echo 'all libraries resolve'"
+ echo "::endgroup::"
+ }
+ run_in ubuntu:22.04 "apt-get update && apt-get install -y libelf1 zlib1g libgtk-3-0"
+ run_in debian:12 "apt-get update && apt-get install -y libelf1 zlib1g libgtk-3-0"
+ run_in fedora:40 "dnf install -y elfutils-libelf zlib gtk3"
+ shell: bash
+
- name: Verify the build left the source tree clean
run: |
# build.sh compiles in a temp directory: no untracked or ignored file may appear outside Linux/output/
diff --git a/.github/workflows/release-linux.yml b/.github/workflows/release-linux.yml
index 9e41bdb..7552711 100644
--- a/.github/workflows/release-linux.yml
+++ b/.github/workflows/release-linux.yml
@@ -32,6 +32,8 @@ jobs:
linux-tools-common \
linux-tools-generic \
libbpf-dev \
+ libelf-dev \
+ zlib1g-dev \
libgtk-3-dev \
pkg-config
shell: bash
diff --git a/Linux/README.md b/Linux/README.md
index a47d912..79a1cff 100644
--- a/Linux/README.md
+++ b/Linux/README.md
@@ -34,7 +34,7 @@ curl -Lo deploy.sh https://raw.githubusercontent.com/InterceptSuite/ProxyBridge/
This script will:
- Download the latest release from GitHub automatically
- Detect your Linux distribution
-- Install all required dependencies (libbpf, GTK3)
+- Install all required dependencies (libelf, zlib, GTK3)
- Install ProxyBridge CLI, GUI, and library to system paths
- Update library cache (ldconfig)
- Verify installation
@@ -63,7 +63,7 @@ This script will:
```
The setup script will:
-- Install runtime dependencies (libbpf, GTK3)
+- Install runtime dependencies (libelf, zlib, GTK3)
- Copy binaries to `/usr/local/bin` (ProxyBridge CLI and GUI)
- Copy library to `/usr/local/lib` (libproxybridge.so)
- Update library cache
@@ -382,10 +382,15 @@ ProxyBridge hooks the **socket calls** (`connect()`, `sendmsg()`, `recvmsg()`) w
- Linux kernel 5.11+ with BTF and cgroup v2 (to run); GCC, Make, **clang** and **bpftool** (to build the eBPF object and skeleton)
- Development libraries:
- - libbpf-dev (Debian/Ubuntu) or libbpf-devel (Fedora/RHEL)
+ - libelf-dev + zlib1g-dev (Debian/Ubuntu) or elfutils-libelf-devel + zlib-devel (Fedora/RHEL). libbpf itself is built from a pinned
+ release and linked statically, so it is not needed at run time
+ - curl (fetches the pinned libbpf source on first build)
- libgtk-3-dev (optional, for GUI) or gtk3-devel (Fedora/RHEL)
- pkg-config
+Binaries are built against a glibc 2.34 baseline (Ubuntu 22.04, Debian 12, RHEL 9 and newer run them), with LTO, FORTIFY_SOURCE=3,
+full RELRO, BIND_NOW, PIE, stack protector and CET flags; `Linux/tests/check_binaries.sh` audits this on every build (issue #146).
+
### Building
1. **Install build dependencies:**
@@ -394,19 +399,19 @@ ProxyBridge hooks the **socket calls** (`connect()`, `sendmsg()`, `recvmsg()`) w
```bash
sudo apt-get update
sudo apt-get install build-essential gcc make clang bpftool \
- libbpf-dev libgtk-3-dev pkg-config
+ libelf-dev zlib1g-dev curl libgtk-3-dev pkg-config
```
**Fedora:**
```bash
sudo dnf install gcc make clang bpftool \
- libbpf-devel gtk3-devel pkg-config
+ elfutils-libelf-devel zlib-devel curl gtk3-devel pkg-config
```
**Arch/Manjaro:**
```bash
sudo pacman -S base-devel gcc make clang bpf \
- libbpf gtk3 pkg-config
+ libelf zlib curl gtk3 pkg-config
```
2. **Clone or download ProxyBridge source code:**
diff --git a/Linux/deploy.sh b/Linux/deploy.sh
index a9c64d3..7a51f1d 100644
--- a/Linux/deploy.sh
+++ b/Linux/deploy.sh
@@ -150,35 +150,35 @@ install_dependencies() {
ubuntu|debian|linuxmint|pop|elementary|zorin|kali|raspbian|mx|antix|deepin|lmde)
echo "Using apt package manager..."
apt-get update -qq
- apt-get install -y libbpf1 libgtk-3-0
+ apt-get install -y libelf1 zlib1g libgtk-3-0
;;
fedora)
echo "Using dnf package manager..."
- dnf install -y libbpf gtk3
+ dnf install -y elfutils-libelf zlib gtk3
;;
rhel|centos|rocky|almalinux)
echo "Using yum package manager..."
- yum install -y libbpf gtk3
+ yum install -y elfutils-libelf zlib gtk3
;;
arch|manjaro|endeavouros|garuda)
echo "Using pacman package manager..."
- pacman -Sy --noconfirm libbpf gtk3
+ pacman -Sy --noconfirm libelf zlib gtk3
;;
opensuse*|sles)
echo "Using zypper package manager..."
- zypper install -y libbpf1 gtk3
+ zypper install -y libelf1 libz1 gtk3
;;
void)
echo "Using xbps package manager..."
- xbps-install -Sy libbpf gtk3
+ xbps-install -Sy libelf zlib gtk3
;;
*)
echo "WARNING: Unknown distribution '$DISTRO' (family: '$DISTRO_LIKE')"
echo ""
echo "Please manually install the following packages:"
- echo " Debian/Ubuntu: sudo apt install libbpf1 libgtk-3-0"
- echo " Fedora: sudo dnf install libbpf gtk3"
- echo " Arch: sudo pacman -S libbpf gtk3"
+ echo " Debian/Ubuntu: sudo apt install libelf1 zlib1g libgtk-3-0"
+ echo " Fedora: sudo dnf install elfutils-libelf zlib gtk3"
+ echo " Arch: sudo pacman -S libelf zlib gtk3"
echo ""
read -p "Continue anyway? (y/n) " -n 1 -r
echo
diff --git a/Linux/setup.sh b/Linux/setup.sh
index 55a6ac4..aee4e95 100644
--- a/Linux/setup.sh
+++ b/Linux/setup.sh
@@ -53,36 +53,36 @@ install_dependencies() {
ubuntu|debian|linuxmint|pop|elementary|zorin|kali|raspbian|mx|antix|deepin|lmde)
echo "Using apt package manager..."
apt-get update -qq
- # libgtk-3-0 is for the GUI, libbpf for the eBPF datapath
- apt-get install -y libbpf1 libgtk-3-0
+ # libgtk-3-0 is for the GUI, libelf+zlib are what the statically linked libbpf needs
+ apt-get install -y libelf1 zlib1g libgtk-3-0
;;
fedora)
echo "Using dnf package manager..."
- dnf install -y libbpf gtk3
+ dnf install -y elfutils-libelf zlib gtk3
;;
rhel|centos|rocky|almalinux)
echo "Using yum package manager..."
- yum install -y libbpf gtk3
+ yum install -y elfutils-libelf zlib gtk3
;;
arch|manjaro|endeavouros|garuda)
echo "Using pacman package manager..."
- pacman -Sy --noconfirm libbpf gtk3
+ pacman -Sy --noconfirm libelf zlib gtk3
;;
opensuse*|sles)
echo "Using zypper package manager..."
- zypper install -y libbpf1 gtk3
+ zypper install -y libelf1 libz1 gtk3
;;
void)
echo "Using xbps package manager..."
- xbps-install -Sy libbpf gtk3
+ xbps-install -Sy libelf zlib gtk3
;;
*)
echo "WARNING: Unknown distribution '$DISTRO' (family: '$DISTRO_LIKE')"
echo ""
echo "Please manually install the following packages:"
- echo " Debian/Ubuntu: sudo apt install libbpf1 libgtk-3-0"
- echo " Fedora: sudo dnf install libbpf gtk3"
- echo " Arch: sudo pacman -S libbpf gtk3"
+ echo " Debian/Ubuntu: sudo apt install libelf1 zlib1g libgtk-3-0"
+ echo " Fedora: sudo dnf install elfutils-libelf zlib gtk3"
+ echo " Arch: sudo pacman -S libelf zlib gtk3"
echo ""
read -p "Continue anyway? (y/n) " -n 1 -r
echo