Sniffing & Spoofingudptcptunnelfirewallrtpsecurity testing

UDPTunnel

UDPTunnel tunnels UDP packets bi-directionally over a TCP connection. It enables multi-media conferences to traverse firewalls allowing only outgoing TCP connections and supports security tests in networks.

Description

UDPTunnel is a small program designed to tunnel UDP packets over TCP connections in both directions. Its primary purpose is to facilitate multi-media conferences through firewalls that permit only outgoing TCP connections, bypassing restrictions on UDP traffic.

Additionally, UDPTunnel serves security testing purposes within networks, allowing penetration testers and security researchers to simulate or transport UDP-based traffic over TCP where direct UDP is blocked.

The tool operates in server or client modes, with optional RTP support for multimedia applications requiring even port pairs.

How It Works

UDPTunnel establishes a TCP connection to encapsulate and forward UDP packets bidirectionally. In server mode (-s), it listens on a specified TCP port for incoming connections and forwards traffic to a UDP address/port. In client mode (-c), it connects to a remote TCP address/port and tunnels to the local UDP endpoint. RTP mode (-r) uses consecutive even ports (N and N+1) for both UDP and TCP to support multimedia streams. TTL can be specified for UDP packets.

Installation

bash
sudo apt install udptunnel

Flags

-sServer mode. Wait for TCP connections on the port.
-cClient mode. Connect to the given address.
-rRTP mode. Connect/listen on ports N and N+1 for both UDP and TCP. Port numbers must be even.
-vVerbose mode. Specify -v multiple times for increased verbosity.

Examples

Server mode: Listen on TCP-port and forward to UDP-addr/UDP-port.
udptunnel -s TCP-port UDP-addr/UDP-port
Server mode with RTP: Listen on even TCP-port and port+1, forward to UDP-addr/UDP-port and port+1.
udptunnel -s TCP-port -r UDP-addr/UDP-port
Server mode with verbose output: Listen on TCP-port and forward to UDP-addr/UDP-port.
udptunnel -s TCP-port -v UDP-addr/UDP-port
Server mode with TTL: Listen on TCP-port and forward to UDP-addr/UDP-port with specified TTL.
udptunnel -s TCP-port UDP-addr/UDP-port/ttl
Client mode: Connect to TCP-addr/TCP-port and tunnel to UDP-addr/UDP-port.
udptunnel -c TCP-addr/TCP-port UDP-addr/UDP-port
Client mode with RTP: Connect to even TCP-addr/TCP-port and port+1, tunnel to UDP-addr/UDP-port and port+1.
udptunnel -c TCP-addr/TCP-port -r UDP-addr/UDP-port
Client mode with verbose output: Connect to TCP-addr and tunnel to UDP-addr/UDP-port.
udptunnel -c TCP-addr -v UDP-addr/UDP-port
Updated 2026-04-16kali.org ↗