fulljackz / DrawMyCall

Piece of script for drawing calls diagrams from pcap files

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Draw my call

Simple script to generate a call flow diagram from a pcap capture. If your pcap capture contains sip and rtp packets, the script will try to generate a diagram as Wireshark do :

Wireshark example

The script massively use tshark, pyshark, python markdown, md_mermaid and others default packaged python3 libraries.

RTP exchanges are indicated only once, avoiding multiple useless lines.

Setup env

Tested on Ubuntu 21.10 and Debian 11.2

  • Install requirements
apt update
apt install git tshark python3-pip --no-install-recommends
pip3 install pyshark markdown md-mermaid
  • Clone this repo and give a try
git clone https://github.com/fulljackz/DrawMyCall.git
cd DrawMyCall
./drawmycall.py -f /path/to/pcap -o /path/to/output.html

How it works

  • Show help
./drawmycall.py --help
usage: drawmycall.py [-h] -f FILE [-t]

optional arguments:
  -h, --help            Show this help message and exit
  -t, --time            Add time on diagram

required arguments:
  -f FILE, --file FILE  Path to your pcap file
  -o OUTPUT, --output   Path to output file 
  • Generate diagram
./drawmycall.py -f pcap_samples/SIP_CALL_RTP_G711 -o ./html/SIP_CALL_RTP_G711.html
  • Should produce a SIP_CALL_RTP_G711.html file in ./html/ like :

Mermaid example

  • Generate diagram with time informations on the left
./drawmycall.py -f pcap_samples/SIP_CALL_RTP_G711 -o ./html/SIP_CALL_RTP_G711.html -t
  • Should produce somethinkg like :

Mermaid example with time

Pcap samples are availble from wireshark web page : https://wiki.wireshark.org/SampleCaptures#sip-and-rtp

Todo

  • Improve diagrams for captures containing multiple sip and rtp streams.

About

Piece of script for drawing calls diagrams from pcap files


Languages

Language:CSS 56.7%Language:Python 39.0%Language:HTML 4.3%