Introduction to Passive Network Traffic Monitoring



Similar documents
CS197U: A Hands on Introduction to Unix

Network Security. Network Packet Analysis

Overview. Protocol Analysis. Network Protocol Examples. Tools overview. Analysis Methods

Unix System Administration

Network Traffic Evolution. Prof. Anja Feldmann, Ph.D. Dr. Steve Uhlig

A Research Study on Packet Sniffing Tool TCPDUMP

Network Security: Workshop

Practical Network Forensics

Lab 2. CS-335a. Fall 2012 Computer Science Department. Manolis Surligas

tcpdump: network traffic capture

Wireshark Deep packet inspection with Wireshark

How To Monitor And Test An Ethernet Network On A Computer Or Network Card

Internet Firewall CSIS Packet Filtering. Internet Firewall. Examples. Spring 2011 CSIS net15 1. Routers can implement packet filtering

Network Traffic Analysis

Passive Network Traffic Analysis: Understanding a Network Through Passive Monitoring Kevin Timm,

EKT 332/4 COMPUTER NETWORK

A Summary of Network Traffic Monitoring and Analysis Techniques

Introduction to Analyzer and the ARP protocol

COMP416 Lab (1) Wireshark I. 23 September 2013

Tcpdump Lab: Wired Network Traffic Sniffing

CS197U: A Hands on Introduction to Unix

Chapter 14 Analyzing Network Traffic. Ed Crowley

Packet Sniffing with Wireshark and Tcpdump

Ford ANX Troubleshooting Procedure for use by Trading Partners

Packet Sniffer A Comparative Study

Network Data Monitoring and Analysis. Computer Networks Lecture's Seminar Lecturer:Assoc.Prof.Turgay ĠBRĠKÇĠ Prepared by Çağla TERLĠKCĠOĞULLARI

netkit lab MPLS VPNs with overlapping address spaces 1.0 S.Filippi, L.Ricci, F.Antonini Version Author(s)

Lab VI Capturing and monitoring the network traffic

Customer Tips. Network Packet Analyzer Tips. for the user. Purpose. Introduction to Packet Capture. Xerox Multifunction Devices.

Network sniffing packet capture and analysis

Network sniffing packet capture and analysis

Network Packet Analysis and Scapy Introduction

Linux MDS Firewall Supplement

Network Monitoring. By: Delbert Thompson Network & Network Security Supervisor Basin Electric Power Cooperative

Tools for penetration tests 1. Carlo U. Nicola, HT FHNW With extracts from documents of : Google; Wireshark; nmap; Nessus.

Packet Capture, Filtering and Analysis

Project 4: IP over DNS Due: 11:59 PM, Dec 14, 2015

Project 2: Firewall Design (Phase I)

1. Whatdo you use? 2. Speed Tests?

Firewall Testing. Cameron Kerr Telecommunications Programme University of Otago. May 16, 2005

Procedure: You can find the problem sheet on Drive D: of the lab PCs. 1. IP address for this host computer 2. Subnet mask 3. Default gateway address

Network forensics 101 Network monitoring with Netflow, nfsen + nfdump

Module 1: Reviewing the Suite of TCP/IP Protocols

Introduction on Low level Network tools

Avaya ExpertNet Lite Assessment Tool

Introduction to Wireshark Network Analysis

Homework 3 TCP/IP Network Monitoring and Management

ITTC Communication Networks Laboratory The University of Kansas EECS 780 Introduction to Protocol Analysis with Wireshark

NetFlow Aggregation. Feature Overview. Aggregation Cache Schemes

Hands On Activities: TCP/IP Network Monitoring and Management

Linux Routers and Community Networks

Implementing Network Monitoring Tools

Lab Exercise SSL/TLS. Objective. Requirements. Step 1: Capture a Trace

Snoopy. Objective: Equipment Needed. Background. Procedure. Due Date: Nov 1 Points: 25 Points

Firewall Tutorial. KAIST Dept. of EECS NC Lab.

Firewall. IPTables and its use in a realistic scenario. José Bateira ei10133 Pedro Cunha ei05064 Pedro Grilo ei09137 FEUP MIEIC SSIN

Lab 1: Network Devices and Technologies - Capturing Network Traffic

SolarWinds Certified Professional. Exam Preparation Guide

TECHNICAL NOTE. Technical Note P/N REV 03. EMC NetWorker Simplifying firewall port requirements with NSR tunnel Release 8.

Traffic Analysis. CSF: Forensics Cyber-Security. Part II.B. Techniques and Tools: Network Forensics. Fall 2015 Nuno Santos

Evidence Acquisition. Network Forensics. Jae Woong Joo

Host Fingerprinting and Firewalking With hping

CYBER ATTACKS EXPLAINED: PACKET CRAFTING

A Protocol Based Packet Sniffer

Assignment One. ITN534 Network Management. Title: Report on an Integrated Network Management Product (Solar winds 2001 Engineer s Edition)

Flow-level analysis: wireshark and Bro. Prof. Anja Feldmann, Ph.D. Dr. Nikolaos Chatzis

Introduction to Network Security Lab 1 - Wireshark

IP addressing and forwarding Network layer

Network Connect Performance Logs on MAC OS

Network Security: Workshop. Dr. Anat Bremler-Barr. Assignment #2 Analyze dump files Solution Taken from

20 Command Line Tools to Monitor Linux Performance

Information Security Training. Assignment 1 Networking

Exercise 7 Network Forensics

CSC574 - Computer and Network Security Module: Firewalls

Internet Protocol: IP packet headers. vendredi 18 octobre 13

Troubleshooting Procedures for Cisco TelePresence Video Communication Server

Internet Firewall CSIS Internet Firewall. Spring 2012 CSIS net13 1. Firewalls. Stateless Packet Filtering

EE984 Laboratory Experiment 2: Protocol Analysis

Wireshark and tcpdump: Packet Capture for Network Analysis

Network Traffic Analysis and Intrusion Detection using Packet Sniffer

CS 356 Lecture 16 Denial of Service. Spring 2013

Life of a Packet CS 640,

WHITE PAPER September CA Nimsoft For Network Monitoring

Solution of Exercise Sheet 5

Wireshark Tutorial INTRODUCTION

Transport and Network Layer

Firewall Examples. Using a firewall to control traffic in networks

Packet Sniffing and Spoofing Lab

Network Diagnostic Tools. Jijesh Kalliyat Sr.Technical Account Manager, Red Hat 15th Nov 2014

A Distributed Approach to Collecting End-to-End Network Performance Measurements

Configuring SNMP Cisco and/or its affiliates. All rights reserved. 1

Packet Sniffer Detection with AntiSniff

Figure 1. Wireshark Menu Bar

IP Address: the per-network unique identifier used to find you on a network

TCP Packet Tracing Part 1

Network Management and Debugging. Jing Zhou

SolarWinds. Understanding SolarWinds Charts and Graphs Technical Reference

TCP/IP Security Problems. History that still teaches

Emerald. Network Collector Version 4.0. Emerald Management Suite IEA Software, Inc.

CET442L Lab #2. IP Configuration and Network Traffic Analysis Lab

Transcription:

Introduction to Passive Network Traffic Monitoring CS459 ~ Internet Measurements Spring 2015 Despoina Antonakaki antonakd@csd.uoc.gr

Active Monitoring Inject test packets into the network or send packets to servers and applications & measure the response Unfortunately extra generated traffic influences the measurement Induced traffic can be controlled/adjustable Explicit control on generation of packets, nature of traffic generation, sampling techniques, timing, frequency, packet sizes, path & function to be monitored You can control what you want, when you need it

Can measure: Delay/loss Topology/routing behavior Bandwidth/throughput Active Monitoring Internet Control Message Protocol (ICMP) message used for diagnostic or control purposes or generated in response to errors in IP operations. TTL field: ping & traceroute use it in attempt to reach a given host computer or to trace a route to that host. Traceroute intentionally sends a packet with a low TTL value so that it will be discarded by each successive router in the destination path. The time between sending the packet and receiving back the ICMP message that it was discarded is used to calculate each successive hop travel time

Passive Monitoring Watch passing by traffic. How? Special purposed device on the network to capture packets for analysis: Sniffer (software/hardware), OCxMon, build on routers/ switches/end node hosts. Build capabilities on switches or other network devices: Remote Monitoring (RMON), Simple Network Monitoring Protocol (SNMP) Netflow capable devices Collect information periodically

No extra traffic induced Measures real traffic Passive Monitoring But generated traffic can be enormous, hard for analysis The passive approach extremely valuable in network trouble-shooting, however limited in ability to emulate error scenarios or isolating exact fault location May require viewing all packets on the network raises privacy/security issues

Passive Monitoring Different ways to perform passive network monitoring: Capturing done by packet capture filters (tcpdump) Requires access to wire promiscuous mode network ports to see other traffic pass ALL traffic it receives to CPU rather passing only frames the controller is intended to receive flow-level, packet-level data on routers Simple Network Management Protocol (SNMP). Three key components: managed devices, agents, network-management systems (NMSs). A managed device is a node that has an SNMP agent and resides on a managed network. These devices can be routers and access servers, switches and bridges, hubs, computer hosts, or printers. An agent is a software module residing within a device. This agent translates information into a compatible format with SNMP. An NMS runs monitoring applications. They provide the bulk of processing and memory resources required for network. Cisco NetFlow

Passive Monitoring Different ways to perform passive network monitoring: Ad hoc packet analysis: capturing packets & analyzing: file manipulation tools (deep understanding of packet structure/network protocols, grep, sort, uniq J) a protocol analyzer: WireShark (supports both live/offline analysis, a GUI & support for analyzing multiple protocols) Simple Network Management Protocol (SNMP)-based analysis. A simple protocol helpful for monitoring conditions at the device level & helps have info about device interactions, especially the flow of traffic between devices. Three key components: Managed devices: a node that has an SNMP agent and resides on a managed network. These devices can be routers and access servers, switches and bridges, hubs, computer hosts, or printers Agents: software module residing within a device that translates information into a compatible format with SNMP Network-management systems (NMSs): runs monitoring applications & provide the bulk of processing and memory resources required for network.

Passive Monitoring Netflow-based analysis: protocol for collecting information at a flow of traffic level Packets with same src & dst, ports, IP protocol and type of service considered part of same network flow. Developed by Cisco Allows you identify apps & services: consuming inordinate amounts of bandwidth should not be on the network, such as malicious software or application Capturing done by packet capture filters (tcpdump) Requires access to wire promiscuous mode network ports to see other traffic pass ALL traffic it receives to CPU rather passing only frames the controller is intended to receive

Passive Monitoring tools Tcpdump & libpcap (limited protocol decoding but available on most *NIX platforms) http://www.tcpdump.org/ Wireshark(powerfull sniffer which can decode lots of protocols, lots of filters) http://www.wireshark.org/ Tshark (command line version of wireshark) http://www.wireshark.org/docs/man-pages/tshark.html dumpcap (part of wireshark) - can only capture traffic and can be used by wireshark / tshark ssldump (an SSLv3/TLS network protocol analyzer-decrypts HTTPS) http://www.rtfm.com/ssldump/ All tools use libpcap (on windows winpcap) for sniffing. Wireshark / tshark / dumpcap can use tcpdump filter syntax as capture filter.

Passive Monitoring tools Microsoft Network Monitor http://blogs.technet.com/netmon Tcpflow https://github.com/simsong/tcpflow dsniff http://www.monkey.org/~dugsong/dsniff/ Tcptrace http://www.tcptrace.org/

tcpdump tcpdump is the premier network analysis tool for information security professionals. Syntax: tcpdump [options] [filter expression] Filters: We are often not interested in all packets flowing through the network Use bpf filters to capture only packets of interest to us

Berkeley Packet Filter On some Unix provides a raw interface to data link layers, allowing raw link-layer packets to be sent and received. If promiscuous mode available: all packets ( &destined to other hosts) can be received Supports filters on packets(keep only interesting packets) Filters implemented as interpreter for a machine language for the BPF virtual machine: Program gets data from packets, performs arithmetic operations and compare results with constants or against data in the packet or test bits in the results, accepting or rejecting packet. See more at: http://www.tcpdump.org/papers/bpf-usenix93.pdf

Berkeley Packet Filter So Allows a user-space program to attach a filter onto any socket and allow or disallow certain types of data to come through the socket. BPF is sometimes used to refer just to the filtering mechanism, rather than to the entire interface. The human readable filter is converted to a bytecode send to kernel -> efficient! See more at: http://www.tcpdump.org/papers/bpf-usenix93.pdf

Capture only udp packets tcpdump udp Capture only tcp packets tcpdump tcp Demo

Demo Capture only UDP packets with destination port 53 (DNS requests) tcpdump udp dst port 53 Capture only UDP packets with source port 53 (DNS replies) tcpdump udp src port 53 Capture only UDP packets with source or destination port 53 (DNS requests and replies) tcpdump udp port 53

tcpdump output Timestamp This is an IP packet Source host name Source port number (22) The standard TCP port 22 has been assigned for contacting SSH servers 01:46:28.808262 IP danjo.cs.berkeley.edu.ssh > adsl-69-228-230-7.dsl.pltn13.pacbell.net.2481:. 2513546054:2513547434(1380) ack 1268355216 win 12816 Destination host name Destination port number TCP specific information Different output formats for different packet types 16

Useful tcpdump commands See the list of interfaces on which tcpdump can listen: tcpdump D Listen on interface eth0: tcpdump -i eth0 Be verbose while capturing packets: tcpdump v Limit the capture to 100 packets: tcpdump -c 100 Record the packet capture to a file called capture.cap: tcpdump -w capture.cap Display the packets of a file called capture.cap: tcpdump -r capture.cap Display IP addresses and port numbers instead of domain and service names when capturing packets: tcpdump n Capture any packets where the destination host is 192.168.1.1. Display IP addresses and port numbers: tcpdump -n dst host 192.168.1.1 Capture any packets where the source host is 192.168.1.1. Display IP addresses and port numbers: tcpdump -n src host 192.168.1.1 Capture any packets where the source or destination host is 192.168.1.1: tcpdump host 192.168.1.1

Useful tcpdump commands Capture any packets where the destination network is 192.168.1.0/24: tcpdump dst net 192.168.1.0/24 Capture any packets where the source or destination network is 192.168.1.0/24: tcpdump net 192.168.1.0/24 Capture any packets where the destination port is 23: tcpdump dst port 23 Capture any packets where the destination port is is between 1 and 1023 inclusive: tcpdump dst portrange 1-1023 Capture only TCP packets where the destination port is is between 1 and 1023 inclusive: tcpdump tcp dst portrange 1-1023 Capture only UDP packets where the destination port is is between 1 and 1023 inclusive: tcpdump udp dst portrange 1-1023 Capture any packets with destination IP 192.168.1.1 and destination port 23: tcpdump "dst host 192.168.1.1 and dst port 23" Capture any packets with destination IP 192.168.1.1 and destination port 80 or 443: tcpdump "dst host 192.168.1.1 and (dst port 80 or dst port 443)" Capture any ICMP packets: tcpdump -v icmp See more at: http://www.tcpdump.org/manpages/tcpdump.1.html

Online Packet Capturing example Start capturing traffic (needs sudo): login milo csd machine $: tcpdump D (find the appropriate interface e.g. eth0) $: tcpdump n i eth0 w onlinetest.pcap Produce traffic: Read your email Watch a YouTube video for 5 minutes Download torrent of an official Linux distribution

Online Packet Capturing example Average packet size: get ip packets: Stop packet capture and report: $ tcpdump q n r onlinetest.pcap ip > onlinetest.out search for length string, get size, sum bytes, print sum/n: $: cat onlinetest.out \ awk -F'length' '{print $2} \ awk '{ sum += $1; n++ } \ END { if (n > 0) print sum / n; }

Online Packet Capturing example Number of packets per destination port: 1. Get the destination port for each packet $: cat onlinetest.out \ awk '{print $5}' \ awk -F'.' '{print $5}' \ awk -F':' '{print $1} > destports 2. Remove blank lines if any $: sed '/^$/d' destports > destports.log 3. Sort ports and measure the occurences of each port $: sort -n destports uniq -c > numbofpackets 4. Plot numbofpackets

Online Packet Capturing example Plot CDF of packet sizes: Before you make cdf plot you should prepare your data: $: cat onlinetest.out \ awk -F'length' '{print $2} \ awk -F ': {print $1}' \ sort -n uniq -c

MAWI traces The MAWI Working Group is a joint effort of Japanese network research and academic institutions to study the performance of networks and networking protocols in Japanese wide area networks. MAWI is an acronym for the Measurement and Analysis of Wide-area Internet. See more at: http://mawi.wide.ad.jp/mawi/

Offline packet capturing example Download a trace (e.g. trace of 1/3/2014 ): $: wget http://mawi.nezu.wide.ad.jp/mawi/ samplepoint-f/2014/201403011400.dump.gz Analyze trace with tcpdump: 1. Number of packets in trace: $: tcpdump n r 201301071400.dump wc l gives 100,933,314 packets

Offline packet capturing example 2. CDF of packet sizes, show the 95th and 99th percentile: A percentile (or a centile) is a measure used in statistics indicating the value below which a given percentage of observations in a group of observations fall. e.g. the 20th percentile is the value (or score) below which 20 percent of the observations may be found. Get the data from trace and measure the occurrences: cat 201301071400.out \ awk -F'length' '{print $2} \ awk -F ': {print $1}' \ sort n uniq c How this work in awk: Line from trace file looks like this: 07:00:01.351778 IP 141.83.1.224.21011 > 128.33.137.252.64071: UDP, length 1423 awk -F'length' '{print $2} sets length as a delimiter and returns 1423

Offline packet capturing example

Offline packet capturing example

Offline packet capturing example 3. Traffic percentage per destination port Get number of packets per destination port cat 201301071400.out \ awk '{print $5}' \ awk -F'.' '{print $5}' \ awk -F':' '{print $1}' \ sort -n uniq -c > packets Divide each port s number of packets by the total packets that you calculate in (1) e.g. cat packets awk '{print $1/<totalnum>" "$2}

Offline packet capturing example 4. All traffic to/from a given IP address per minute (let s say 201.57.174.30) Get delta (micro-second resolution) between current and first line on each dump line for a specific host: $: tcpdump q -ttttt -nr 201301071400.dump host 201.57.174.30 > specip.out

length 0 this is the length of the packet Because we sent just a SYN packet, and a SYN packet contain only the header of a TCP packet and doesn t contain any data.

Offline packet capturing example 5. Get all UDP conversations of the trace: $: tcpdump n w udpconvers.pcap r 201301071400.dump udp