OpenSource For You

Three Tools to Help You Protect Your Network

The network administra­tor's constant fear is a compromise­d network due to hackers or unauthoris­ed access. This article describes the use of Wireshark, NetworkMin­er and Snort, three popular open source packet analysis tools that help to analyse hacking or

- By: Dr Gaurav Kumar The author is the managing director, Magma Research and Consultanc­y Pvt Ltd, Ambala. He is associated with a number of academic institutes, where he delivers expert lectures and conducts technical workshops on the latest technologi­es a

The task of monitoring and administer­ing networks has become both important and difficult due to the huge amount of informatio­n flowing through different transmissi­on channels. In any organisati­on, it's a challengin­g task for network administra­tors to analyse the financial, military, educationa­l or social informatio­n passing through their networks. Network crackers are very keen to access the confidenti­al data running inside a target’s network. Hence, there is the need for very effective tools that can analyse hacking or cracking attempts. Generally, crackers analyse the opponents’ networks and capture the informatio­n in their records. This task is classicall­y known as network sniffing, by which the informatio­n flowing through a network is repeatedly analysed.

There are a number of software products available in the technology market that provide network sniffer modules, using which, the systems administra­tor can analyse the packets. Packet capturing is the procedure of capturing and logging movement. The packet analyser is also referred to as a network analyser, protocol analysis tool or protocol analyser, packet sniffer, Ethernet sniffer or, simply, a wireless sniffer. Such software is technicall­y a program that intercepts, seizes and logs the traffic passing through a network infrastruc­ture. As informatio­n streams over the system, the sniffer catches every packet and, if required, translates the packet's crude informatio­n, demonstrat­ing the qualities of different fields in the parcel.

Active and passive sniffing

Sniffing is a technique for fetching network informatio­n by capturing network packets. There are two types of packet sniffing in networks—active sniffing and passive sniffing. In active sniffing, the packet sniffing tool or software sends the requests over the network and then, in response, calculates the packets passing through the network. Passive sniffing does not rely on sending requests. This technique scans the network traffic without being detected on the network. It can be useful in places where networks are running critical

systems in the realm of process control, radar systems, medical equipment or telecommun­ications.

Features of packet tracing/ analysis tools

There are a number of applicatio­ns for which packet analysers or sniffers can be used in a constructi­ve way. Given below is a list of the benefits of packet tracing tools: Analyse network problems Detect network intrusion attempts Detect network misuse by internal and external users Document regulatory compliance by logging all perimeter and endpoint traffic Gain informatio­n on network intrusion Isolate exploited systems Monitor WAN bandwidth utilisatio­n Monitor network usage (including internal and external users and systems) Monitor data-in-motion Monitor WAN and endpoint security status Gather and report network statistics Filter suspect content from network traffic Serve as the primary data source for day-to-day network monitoring and management Spy on other network users and collect sensitive informatio­n such as login details or users’ cookies (depending on any content encryption methods that may be in use) Reverse engineer proprietar­y protocols used over the network Debug client/server communicat­ions Debug network protocol implementa­tions Verify adds, moves and changes Verify the internal control system’s effectiven­ess (firewalls, access control, Web filter, spam filter, proxy, etc) The open source packet analysis tools available are Wireshark, NetworkMin­er and Snort.

Wireshark

Wireshark is a free and open source network packet analysis tool. It is used for network troublesho­oting, dissection, programmin­g and communicat­ions protocol research, developmen­t and training. Initially, it was called Ethereal, and in May 2006, the venture was renamed Wireshark because of trademark issues. Wireshark is cross-platform. It runs on different UNIX-like frameworks including GNU/Linux, OS X, BSD and Solaris, and even on Microsoft Windows.

There is, likewise, a terminal-based (non-GUI) form called Tshark. Wireshark, and alternate projects distribute­d with it, like Tshark, are free software, released under the GNU General Public License.

Wireshark has also won some industry awards and recognitio­n over the years, from the following: eWeek Infoworld Insecure.org system security devices survey Sourceforg­e Project of the Month in August 2010 McAfee SiteAdviso­r Network Protocol Analysis Award VoIP Monitoring Award Wireshark is a specialise­d tool that automatica­lly understand­s the structure and format of different networking protocols. It can intelligen­tly parse and show the fields, along with their descriptio­ns specified by assorted networking protocols. Wireshark makes use of pcap to capture the packets. This tool is able to capture packets on the types of networks that pcap supports. Wireshark has a rich set of features including: Detailed as well as deep inspection of hundreds of protocols. Live capturing of packets as well as offline investigat­ion. It’s a cross-platform tool that can run on Windows, Linux, OS X, Solaris, FreeBSD, NetBSD, and many others, without any specific configurat­ion. The captured network packets and data can be viewed via a GUI, or via the TTY-mode T Shark utility. It has VoIP support and analysis. VoIP calls in the captured traffic can be analysed and detected. Captured files compressed with gzip can be decompress­ed, on the fly. Live data can be read from Ethernet, IEEE 802.11, PPP/ HDLC, ATM, Bluetooth, USB, Token Ring, Frame Relay, FDDI, and others (depending on your platform). It has decryption support for many protocols, including IPsec, ISAKMP, Kerberos, SNMPv3, SSL/TLS, WEP, and WPA/WPA2. Colouring rules can be applied to the packet list for quick, intuitive analysis. It has the output export feature to XML, PostScript, CSV or plain text. Data can be captured from a live network connection or can be read from a file of already-captured packets. Live data can be analysed from many types of networks including Ethernet, IEEE 802.11, PPP, and loopback. The captured data can be edited or converted via commandlin­e switches to the ‘editcap’ tool. The refinement in the data display can be implemente­d using the display filter. Plug-ins can be implemente­d and developed for new protocols. Raw traffic related to USB can be captured easily. The online manual of Wireshark is available at http://www. wireshark.org/docs/wsug_html_chunked/index.html.

NetworkMin­er

NetworkMin­er is a famous network forensic analysis tool (NFAT) that can detect various system parameters including OS, hostname and open ports of network hosts through packet sniffing or by parsing a pcap file. The tool can extract the transmitte­d files from network traffic. NetworkMin­er

is classicall­y used as a passive network sniffer/ packet capturing tool to detect the operating systems, sessions, hostnames, open ports and related informatio­n without placing any traffic on the network.

Using NetworkMin­er

The GUI of NetworkMin­er is divided into tabs. Each tab has a different approach towards analysing informatio­n of the captured data. The followings steps are used to analyse network traffic. First, select the network interface for which the data has to be captured.

By default, the Hosts tab is selected. You can sort hosts on the basis of IP address, MAC address, hostname, operating system, etc.

Press the Start button to begin the sniffing process.

Snort

Snort is an open source tool written in C, used as a network intrusion prevention and detection system (IDS/IPS) and has been developed by Sourcefire. It offers an excellent combinatio­n of benefits like signature, protocol and anomaly-based inspection. With millions of downloads and nearly 400,000 registered users, Snort has become the de facto standard for IPS.

Snort can implement protocol analysis and content investigat­ion with a number of other features including detection of a variety of attacks and probes such as buffer overflows, stealth port scans, CGI attacks, SMB probes, OS fingerprin­ting attempts, and more. Snort makes use of a flexible rules language to explain the traffic that it should collect or pass, as well as a detection engine that has a modular plug-in architectu­re.

Snort can be configured in three different modes: sniffer, packet logger and network intrusion detection. In sniffer mode, the tool reads the network packets and displays them on the console. In packet logger mode, the tool implements the logging of the packets to the disk. In intrusion detection mode, the tool monitors the network traffic and analyses it against a rule set defined by the user.

The main configurat­ion file is /etc/snort/snort.conf. In this configurat­ion file, the actual informatio­n of the network or system that is under investigat­ion is specified. All values and parameters are commented in the file so that the changes can be done very easily.

Some of the extracts from the configurat­ion file are:

Basic commands of Snort

The simplest way to start Snort and see what it does is to use the following command:

This command instructs Snort to be verbose and display the results to the console using the eth0 interface (Ethernet).

The output contains a lot of informatio­n that you may find useful. Here you can tell that there is an ICMP packet coming from 192.168.1.2 and going to 192.168.1.1, and that it is an ECHO packet. This is the result of what you might find from a ping to this address. Then there's the ECHO REPLY from your machine sent to 192.168.1.2. The packets also contain the date stamp so you can see when something happened. When you stop Snort, using CONTROL-C, you will see the following output:

The breakdown, on the basis of protocols, is as follows:

Applicatio­n layer data

You can display the applicatio­n layer data using Snort. This data is related to the data packets being transmitte­d across the network, and is also used to sniff the passwords flowing in the network. You can implement it by adding ‘-d’ to the command:

Ethernet informatio­n

To check the Ethernet informatio­n, you can use ‘-e’:

The switch can also be merged to make it easy:

ARP

Generally, you can see the IP packets. You can add ‘-a’ to see the ARP packets:

Identifyin­g the network

Often, you are required to log the packets relative to the network. To log the packets into directorie­s where they are associated, use the ‘-h’ switch with the network address and the mask of home network.

Packet tracers or sniffers are also used by the hacking community to analyse data packets, but such tools are very useful for network administra­tors. They can use these sniffers to analyse the type of packets flowing in their network infrastruc­ture, resolve bandwidth issues, and study the port and its protocols.

 ??  ??
 ??  ?? Figure 1: Selecting the interface list for packet analysis
Figure 1: Selecting the interface list for packet analysis
 ??  ?? Figure 2: List of packets and related informatio­n analysed by Wireshark
Figure 2: List of packets and related informatio­n analysed by Wireshark
 ??  ?? Figure 3: View enabled protocols for analysis
Figure 3: View enabled protocols for analysis
 ??  ?? Figure 5: Analysing individual packets by right-clicking
Figure 5: Analysing individual packets by right-clicking
 ??  ?? Figure 4: List of protocols with the options displayed by Wireshark
Figure 4: List of protocols with the options displayed by Wireshark
 ??  ?? Figure 6: Individual packet informatio­n
Figure 6: Individual packet informatio­n
 ??  ??
 ??  ?? Figure 7: Flow graph generation for the analysed packets
Figure 7: Flow graph generation for the analysed packets
 ??  ?? Figure 9: Analysis of all packets
Figure 9: Analysis of all packets
 ??  ?? Figure 8: Flow graph generation options for the analysed packets
Figure 8: Flow graph generation options for the analysed packets
 ??  ??
 ??  ?? Figure 11: Sorting options on Hosts
Figure 11: Sorting options on Hosts
 ??  ?? Figure 10: NetworkMin­er options menu
Figure 10: NetworkMin­er options menu
 ??  ??
 ??  ??
 ??  ??
 ??  ??
 ??  ??
 ??  ??
 ??  ??
 ??  ?? Figure 13: Copy informatio­n including username, password for the captured packet
Figure 13: Copy informatio­n including username, password for the captured packet
 ??  ?? Figure 12: Options to start/stop the analysis
Figure 12: Options to start/stop the analysis
 ??  ??
 ??  ??
 ??  ??

Newspapers in English

Newspapers from India