<div dir="ltr"><pre># How to TRACE and visualize TLS and non-TLS SIP traffic in real time (thanks to Homer's Lorenzo Mangani for pointing me toward Frida)
apt-get install python-pip
pip install frida
pip install hexdump
wget <a href="https://raw.githubusercontent.com/google/ssl_logger/master/ssl_logger.py">https://raw.githubusercontent.com/google/ssl_logger/master/ssl_logger.py</a><a href="https://raw.githubusercontent.com/" target="_blank"></a>
#first ssh terminal
# create fifo pipe, then will send the content from fifo pipe to an sngrep without gui, which will be reading pcap from stdin, and sending eep packets to the other sngrep (third terminal)
mkfifo /tmp/pipe
cat /tmp/pipe | sngrep -N -q -H udp:<a href="http://127.0.0.1:5077" target="_blank">127.0.0.1:5077</a> -I -
#second ssh terminal
# writes as pcap to fifo pipe what freeswitch writes and reads from ssl lib
python ssl_logger_giova.py -pcap /tmp/pipe freeswitch
#third ssh terminal
# sngrep that receives packets from both the Ethernet device, and the eep packets sent by the other sngrep (eg, the tls packets ssl_logger grabs from freeswitch's ssl lib)
sngrep -L udp:<a href="http://127.0.0.1:5077" target="_blank">127.0.0.1:5077</a>
(you may want to edit ssl_logger.py and change 228 to be 101 - LINKTYPE_IPV4 to be LINKTYPE_RAW )</pre><br clear="all"><br clear="all"><br>-- <br><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature">Sincerely,<br><br>Giovanni Maruzzelli<br>OpenTelecom.IT<br>cell: +39 347 266 56 18<br><br></div><br><br></div>