{% extends "core/layout.html" %} {% block custom_head %} {% endblock %} {% block main %}

Real-time network traffic analysis

D3 Graph
Informational stuff

Intro

This graph will show the connections between your several hosts which are represented by circles. Everytime a connection is active that specific link will be highlighted and will change color. This way you'll be able to track and monitor your network activity visually.

Keep in mind that every connection is directed that means network traffic could also flow in only one direction. The direction of the traffic flow itself is shown by an arrow.

Below you'll find a table containing all connections: Source, target and also number of connection occurences. The table will update everytime a new connection (link) is being added to the graph. The search functionality won't work properly until you stop adding data to your graph.

Run

In order to populate your graph your data you'll have to follow some specific steps.

  1. Start netgrafio
  2. Define your data source
  3. Send that data to netgrafio
Your data source could be:
  • pcap file
  • network interface
  • whatever

Collecting data

You'll need some data to visualize. Open a shell and paste this into it (make sure you adapt the command line to your system, e.g. change the NIC interface name):

$ tshark -l -i wlan0 -T fields -e ip.src_host -e ip.dst_host > /dev/null 2>&1 | stdbuf -oL awk -f web/mod_netanalyzer/scripts/src-dst.awk | egrep -v --line-buffered "Capturing" |  stdbuf -oL sed 's/"/\\"/g' | xargs -n 1 -I % sh -c "echo '%' | nc localhost 8081; sleep 0.2"
                            
Or you could read data from some pcap file:
$ tshark -l -T fields -e ip.src_host -e ip.dst_host -r file.pcap | uniq | awk -f web/mod_netanalyzer/scripts/src-dst.awk > /tmp/pcap.log
                            
And then import data:
$ while read line; do echo $line | nc localhost 8081; sleep 0.2; done < /tmp/pcap.log
                            
Connection Table
{% endblock %} {% block custom_scripts %} {% endblock %}