Sniffing & Spoofingrtpaudiospoofingmixingnetworkinjection

rtpmixsound

rtpmixsound mixes pre-recorded audio in real-time with the audio in a specified target RTP stream. It spoofs RTP packets to inject the mixed audio into the live stream.

Description

rtpmixsound is a tool designed to mix pre-recorded audio files into live RTP audio streams over the network. It supports specific WAV file formats with constraints like mono channel, 8000 Hz sample rate, and PCM/uncompressed encoding, or tcpdump-formatted files containing G.711 u-law RTP/UDP/IP/ETHERNET packets. This enables real-time audio manipulation for testing or demonstration purposes in VoIP environments.

Use cases include injecting custom audio into ongoing RTP sessions, such as mixing sound effects or voices into conference calls or media streams. The tool targets specific source and destination IP/port combinations, allowing precise control over the injection process. It handles packet timing, sequence numbers, and timestamps to blend spoofed packets seamlessly with legitimate traffic.

Operators must consider network interface selection and routing tables, as Linux may route spoofed packets differently than specified. Verbose output aids in monitoring the process, and parameters like spoof and jitter factors fine-tune packet generation and timing to avoid detection.

How It Works

rtpmixsound monitors a target RTP stream using libfindrtp with pcap filters for IP traffic. Upon detecting legitimate RTP packets from specified source/destination IP and ports, it generates spoofed RTP packets by mixing audio from the input file. It increments sequence numbers, adjusts timestamps based on payload length multiplied by spoof factor, and increments IP ID. Jitter factor controls transmission timing relative to the next expected legitimate packet, delaying output to mimic natural stream behavior. Packets are injected via the specified interface, supporting G.711 u-law or constrained WAV formats.

Installation

bash
sudo apt install rtpmixsound

Flags

-asource RTP IPv4 addr
-Asource RTP port
-bdestination RTP IPv4 addr
-Bdestination RTP port
-fspoof factor - amount by which to increment RTP sequence number, multiply timestamp by payload length, and increment IP ID [range: +/- 1000, default: 2]
-iinterface (e.g. eth0)
-jjitter factor - determines transmission timing of spoofed packet relative to next legitimate packet [range: 0 - 80, default: 80]
-pseconds to pause between setup and injection
-vverbose output mode
-hhelp - print this usage

Examples

Mix the given audio file (/usr/share/rtpmixsound/stapler.wav) through the network displaying verbose output (-v). Targets interface eth0 by default.
rtpmixsound /usr/share/rtpmixsound/stapler.wav -v
Mix a WAV file into the target stream using specified interface eth0.
rtpmixsound /path/to/audio.wav -i eth0
Mix audio from tcpdump file targeting source IP 192.168.1.100 and port 5004.
rtpmixsound /path/to/tcpdump.pcap -a 192.168.1.100 -A 5004
Mix WAV file targeting destination IP 192.168.1.200 and port 5004 with verbose output.
rtpmixsound /path/to/audio.wav -b 192.168.1.200 -B 5004 -v
Mix audio with custom spoof factor 5 and jitter factor 50 for adjusted packet timing.
rtpmixsound /path/to/audio.wav -f 5 -j 50
Mix audio with 10 seconds pause between setup and injection.
rtpmixsound /path/to/audio.wav -p 10
Display help and usage information.
rtpmixsound /path/to/audio.wav -h
Updated 2026-04-16kali.org ↗