How do you prepare your security data for visualization?

By Raffael Marty  5 comments

Do you know how much traffic is transmitted on your networks? Do you know what protocols are in use and what machines are using them? Are there spyware infected machines on your network that leak information?
Traffic flows are records that tell you what machines have communicated on the network, what services they used, and how much data they transmitted. These records can be used to answer a variety of questions about the behavior of machines and the traffic flowing on your networks.
In the next blog entry I will show how flows can be visualized to ease their analysis. To do so, we need to first collect them and do some initial processing.
In the following example, I am going to use NetFlow - one specific type of traffic flow. (Other traffic flows include sFlow or jFlow). Traffic flows are a representative of security data. To process other security data sources a similar process to the one presented here can be used.
First we need to configure the source device - in my case a CISCO router - to generate NetFlow records. To do so, you have to issue the following commands:

interface Ethernet0/0
  ip route-cache flow
ip flow-export destination 192.168.0.1 8888
ip flow-export version 9 bgp-nexthop

This assumes that on 192.168.0.1 you have a machine that can accept NetFlow records. To collect the NetFlow records, we are going to use nfdump. Issue the following command to start nfdump and record the flows being sent to our collection machine:

./nfcapd –w –D –p 8888

This will record the flows on disk, in a binary format. In order to read the recorded information, issue the following command:

./nfdump –r /var/tmp/nfcapd.200801021115 
-o "fmt:%ts %td %pr %sap -> %dap %pkt %byt %fl %out %in"

This tells nfdump both the location of the records, as well as the format in which to output the information. The output of the previous command displays records in the following form:

2005-10-22 23:02:53.967  0.000  TCP  
10.0.0.2:40060 0> 10.0.0.1:23   1   60   1   0   1 

To visualize the data, this is not very useful. We need to generate CSV output of the fields that we are interested in. To do so, we can use the following command:

./nfdump –r /var/tmp/nfcapd.200801021115 -o "fmt:%sa,%da"

This will output all the source and destination IPs in a CSV (comma separated values) format:

10.0.0.2,10.0.0.1

This is a format that is understood by various visualization tools. Unfortunately, a lot of security tools do not offer the capability to change the output format to CSV - unlike nfdump. In those cases, we need to parse the output with either a specialized parser or some type of UNIX script. Here is how we could parse the previous output with awk (pipe the output into the following command):

awk '{print $5,$7}' | awk -F: '{print $1,$3}'

There are many other ways to parse this, for example with Perl and a regular expression. If you don't know regular expressions, the previous awk line is probably the simplest way of parsing the output.

Stay tuned for the next blog entry where I will show how we can take the CSV output to visualize the communication patterns.

Terima Kasih from Jakarta

5 comments

    Anonymous 2 years ago
    Search-and-destroy Antispyware is the best scan that I have used to keep my PC clean and working like new. It’s a great scanner that finds all the same bugs that other scans such as Norton can find. What’s even better is that it cost less than many of the other options. I found the antispyware solution from Search-and-destroy at http://www.Search-and-destroy.com and decided to give it a try. That was one of the best decisions I ever made. I’m very happy with this scanner and would recommend it to anyone that wants to protect and care for their PC so it will last as long as possible.
    Raffael Marty
    Raffael Marty 3 years ago
    There are a ton of NetFlow visualization tools out there. There are open source solutions like nfsen, for example. Other commercial solutions include Arbor Networks or Mazu. But they are all for pay.My blog post shows how to do it manually and is just an example of how to apply hands-on visualization to some security data source. I could have picked any other data source to illustrate this.
    Anonymous 3 years ago in reply to Raffael Marty
    Hello Raffael,I would like to see if we could integrate your tool with our NetFlow Analyzer 'Scrutinizer': http://www.plixer.com/products/scrutinizer.php How do I contact you? Sincerely,Michael Pattersonmike@plixer.com
    Anonymous 3 years ago
    www.lancope.comHow it works:VM2VM communications are formatted into a NetFlow PDU and sent out of the VM Server across the network to the StealthWatch Xe for NetFlow collector. As flows arrive at the collector, StealthWatch performs behavior analysis to reveal network congestion issues, policy violations, worm outbreaks and other security and traffic volume related incidents. A single StealthWatch Xe for NetFlow collector supports up to 1000 VM servers simultaneously.

      Add a comment

      Post a comment using one of these accounts
      Or join now
      At least 6 characters

      Note: Comment will appear soon after you have activated your account.
      Obscene/spam comments will be removed and accounts suspended.
      The information you submit is subject to our Privacy Policy and Terms of Service.

      ITworld LIVE

      SecurityWhite Papers & Webcasts

      White Paper

      Overcome Top 7 Admin Challenges of Active Directory

      As Active Directory's role in the enterprise has drastically increased, so has the need to secure the data. Gain insight on creating repeatable, enforceable processes that reduces administrative overhead and enables robust, customizable reporting and auditing capabilities. Brought to you by NetIQ.

      White Paper

      Insiders Can Ruin Your Company. Take Action.

      Did you know that 80 percent of threats to an organization come from the inside? The threat from insiders is often overlooked in organizations worldwide. This white paper from NetIQ, discusses key technology solutions that help to prevent and detect insider threats.

      White Paper

      Top Solutions and Tools to Prevent Devastating Malware

      Custom malware frequently goes undetected. According to Forrester Research, the best way to reduce risk of breach is to deploy file integrity monitoring (FIM) tools that provide immediate alerts. This white paper has been brought to you by NetIQ, the leader in solving complex IT challenges.

      White Paper

      Streamline Compliance and Increase ROI

      Streamline, simplify, and automate compliance related activities; especially those that impact multiple business units. This white paper from NetIQ, outlines solutions that will help your business gain the maximum return on investment possible while aligning your compliance programs.

      White Paper

      X-Ray of the PCI Process-4 Proactive Steps

      This white paper from Forrester Research Inc., helps break PCI into understandable components. Security and risk professionals will gain knowledge and insight into creating a compliant and secure IT environment. Follow these four proactive steps now before your next audit. Brought to you by NetIQ.

      See more White Papers | Webcasts

      Ask a question

      Ask a Question