Skip to content

veondigital/srtp_decoder

 
 

Repository files navigation

SRTP decoder decodes WebRTC media streams and writes decoded payload into the file

This tool:

  • decodes pcap (Packet Capture) formatted file

  • extracts RTP packets

  • filters packets by SSRC

  • decodes secure

  • write payload to output file

  • produce .csv-file with list of all detected RTP streams

RTP can be packed in different way. Supports stream: WebRTC, Regular SRTP, Turn Extensions.

Supports transport protocol: UDP and TCP

To store opus packets in a file, you need some kind of container format that stores the packet boundaries. I am using https://www.opus-codec.org simple container format. Option: container[true/false] - switches on/off this feature.

Usage:

srtp_decoder[.exe] -l [-v] -f input_file -s ssrc [-e expression]

* -l | --list - Parse all rtp streams and produce .csv-file with full information

* ssrc - RTP stream identifier https://tools.ietf.org/html/rfc3550\#page-59 hex with 0x prefix

srtp_decoder[.exe] [-v] -f input_file -o output_file -s ssrc -k key -r sha -c container [-e expression]

* input - input pcap file path (Not pcapng!!!, just pcap)

* output - output pcm file path

* ssrc - RTP stream identifier https://tools.ietf.org/html/rfc3550\#page-59 hex with 0x prefix

* sha - crypto suite name https://tools.ietf.org/html/rfc4568\#page-16

* container - true/false see feature description above

Options:

* expression - pcap filter expression

* -v | --verbose - Print detail information about packets into stdout

Compiling:

Linux/MAC

git clone https://github.com/SteppeChange/srtp_decoder.git
cd srtp_decoder
git submodule init
git submodule update

cd docopt
mkdir build
cd build
cmake ..
make

cd ..
mkdir build
cd build
cmake ..
make

export PATH=`pwd`:"$PATH"

Windows (Visual Studio Community 2013/2015)

git clone https://github.com/SteppeChange/srtp_decoder.git
cd srtp_decoder
git submodule init
git submodule update

unzip .\win32_vs15\WpdPack_4_1_2.zip

.\prepare_build_win.cmd
.\libsrtp\srtp.sln

.\prepare_build_win.cmd
.\win32_vs15\srtp_decoder.sln

Prerequrements linux/mac

install libsrtp (https://github.com/cisco/libsrtp or https://github.com/dozeo/libsrtp) install libpcap

Prerequrements windows

libsrtp https://github.com/cisco/libsrtp winpcap https://www.winpcap.org/devel.htm

How to play pcm

http://www.audacityteam.org/ File->Import->Raw data-> A-Law:Little-Endian:1 Channel(Mono):0:100:8000Hz

How to play OPUS

https://www.opus-codec.org curl http://downloads.xiph.org/releases/opus/opus-1.1.3.tar.gz -o opus.tar.gz tar -xvf ./opus.tar.gz cd opus-1.1.3/ ./configure make

use opus_demo for converting OPUS payload to PCM: ./opus_demo -d 48000 1 payloadfile pcmfile

play pcmfile by audacity File->Import->Raw data-> PCM 16 bit 48000Hz

SDES/DTLS srtp

TO DO How to extract SEDS key/crypto from SDP TO DO How to extract DTLS key/crypto from browser logs

About

SRTP decoder. It decodes SDES SRTP.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C++ 77.0%
  • Shell 9.6%
  • CMake 8.2%
  • Batchfile 5.2%