How-Tos

How-To: Hunt for VPN Bridges and Tunnels You Didn’t Install on Your Linux Servers

Leave a comment

The Webworm story in this batch is a good reminder that attackers love legit tunneling tools, like a rebuilt SoftEther bridge renamed to look like monitoring software. That case was on Windows, but the same tools run on Linux. Here’s a quick check for Debian and Arch boxes. It takes about five minutes.

1. List tunnel-type interfaces

ip -br link
ip -d link show | grep -E -B1 'tun|tap|wireguard|vxlan|gre|ipip'

Every tun, tap or wg interface should match something you set up on purpose, like Tailscale or WireGuard.

2. Check what’s listening and who’s connected out

sudo ss -tulpn
sudo ss -tnp state established

Look for processes you don’t recognize, and long-lived outbound connections to addresses you can’t explain, especially on 443 from something that isn’t a browser or package manager.

3. Look for common tunneling tools by name

ps -eo pid,user,lstart,args | grep -iE 'vpnbridge|vpnserver|vpnclient|softether|chisel|frpc|frps|ngrok|cloudflared|gost|ligolo' | grep -v grep

Names can be changed, as Webworm showed, so don’t stop here.

4. Make sure every running binary belongs to a package

sudo ls -l /proc/[0-9]*/exe 2>/dev/null | awk '{print $NF}' | sort -u > /tmp/running-bins.txt
# Debian
while read f; do dpkg -S "$f" >/dev/null 2>&1 || echo "NOT FROM A PACKAGE: $f"; done < /tmp/running-bins.txt
# Arch
while read f; do pacman -Qo "$f" >/dev/null 2>&1 || echo "NOT FROM A PACKAGE: $f"; done < /tmp/running-bins.txt

Anything in /tmp, /dev/shm, /opt or a home folder that isn’t from a package deserves a hard look.

5. Check services and timers

systemctl list-units --type=service --state=running
systemctl list-timers --all

If you find something you didn’t install, don’t just kill it. Take the box off the network, save copies of the binary and its config, and work out how it got there first.

God Bless, and Use the Source!

References & Further Reading

Subscribe (RSS) Follow How-Tos via RSS

Leave a note

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.