Packet capture and protocol analysis 1. Content TCP/IP Networking Review Packet Capture Protocol Analysis 2.

Slides:



Advertisements
Similar presentations
Cisco 2 - Routers Perrine. J Page 14/30/2015 Chapter 10 TCP/IP Protocol Suite The function of the TCP/IP protocol stack is to transfer information from.
Advertisements

CISCO NETWORKING ACADEMY Chabot College ELEC Transport Layer (4)
IST 201 Chapter 9. TCP/IP Model Application Transport Internet Network Access.
Transmission Control Protocol (TCP)
Review of Important Networking Concepts
1 Review of Important Networking Concepts Introductory material. This module uses the example from the previous module to review important networking concepts:
Institute of Technology Sligo - Dept of Computing Semester 2 Chapter 9 The TCP/IP Protocol Suite Paul Flynn.
Practical Networking. Introduction  Interfaces, network connections  Netstat tool  Tcpdump: Popular network debugging tool  Used to intercept and.
Gursharan Singh Tatla Transport Layer 16-May
Click to edit Master subtitle style Chapter 17: Troubleshooting Tools Instructor:
1 Review of Important Networking Concepts Introductory material. This slide uses the example from the previous module to review important networking concepts:
CS 356 Systems Security Spring Dr. Indrajit Ray
Lecture 8 Modeling & Simulation of Communication Networks.
IST 228\Ch3\IP Addressing1 TCP/IP and DoD Model (TCP/IP Model)
Process-to-Process Delivery:
CN2668 Routers and Switches Kemtis Kunanuraksapong MSIS with Distinction MCTS, MCDST, MCP, A+
1 Lab 3 Transport Layer T.A. Youngjoo Han. 2 Transport Layer  Providing logical communication b/w application processes running on different hosts 
TELE202 Lecture 10 Internet Protocols (2) 1 Lecturer Dr Z. Huang Overview ¥Last Lecture »Internet Protocols (1) »Source: chapter 15 ¥This Lecture »Internet.
Packet Analysis with Wireshark
TCP/IP Protocol Suite - examples
Exercises ARP ICMP DNS HTTP/TCP Trace analysis. ARP launch Wireshark ipconfig /all ; see local IP and gateway route -print ; find gateway arp -a ; list.
Hands-On Microsoft Windows Server 2003 Networking Chapter Three TCP/IP Architecture.
Network Protocols. Why Protocols?  Rules and procedures to govern communication Some for transferring data Some for transferring data Some for route.
70-291: MCSE Guide to Managing a Microsoft Windows Server 2003 Network Chapter 3: TCP/IP Architecture.
Presentation on Osi & TCP/IP MODEL
1 Chapter Overview TCP/IP DoD model. 2 Network Layer Protocols Responsible for end-to-end communications on an internetwork Contrast with data-link layer.
COMT 429 The Internet Protocols COMT 429. History 1969First version of a 4 node store and forward network, the ARPAnet 1972Formal demonstration of ARPAnet.
Examining TCP/IP.
Computer Networks (CS 132/EECS148) General Networking Example Karim El Defrawy Donald Bren School of Information and Computer Science University of California.
COMT 6251 Network Layers COMT Overview IP and general Internet Operations Address Mapping ATM LANs Other network protocols.
70-293: MCSE Guide to Planning a Microsoft Windows Server 2003 Network, Enhanced Chapter 2: TCP/IP Architecture.
Chap 9 TCP/IP Andres, Wen-Yuan Liao Department of Computer Science and Engineering De Lin Institute of Technology
Fall 2005Computer Networks20-1 Chapter 20. Network Layer Protocols: ARP, IPv4, ICMPv4, IPv6, and ICMPv ARP 20.2 IP 20.3 ICMP 20.4 IPv6.
ECE 526 – Network Processing Systems Design Networking: protocols and packet format Chapter 3: D. E. Comer Fall 2008.
Chapter 6-2 the TCP/IP Layers. The four layers of the TCP/IP model are listed in Table 6-2. The layers are The four layers of the TCP/IP model are listed.
© Jörg Liebeherr, Organization Addresses TCP/IP Protocol stack Forwarding Internet.
TCP/IP Honolulu Community College Cisco Academy Training Center Semester 2 Version 2.1.
1 CS 4396 Computer Networks Lab TCP/IP Networking An Example.
TCP/IP Protocol Suite 1 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Chapter 19 Domain Name System (DNS)
Lecture 4 Overview. Ethernet Data Link Layer protocol Ethernet (IEEE 802.3) is widely used Supported by a variety of physical layer implementations Multi-access.
1 Introduction to TCP/IP. 2 OSI and Protocol Stack OSI: Open Systems Interconnect OSI ModelTCP/IP HierarchyProtocols 7 th Application Layer 6 th Presentation.
Practice 4 – traffic filtering, traffic analysis
70-291: MCSE Guide to Managing a Microsoft Windows Server 2003 Network, Enhanced Chapter 3: TCP/IP Architecture.
Monitoring Troubleshooting TCP/IP Chapter 3. Objectives for this Chapter Troubleshoot TCP/IP addressing Diagnose and resolve issues related to incorrect.
Advanced Packet Analysis and Troubleshooting Using Wireshark 23AF
1 Introduction to Networking Concepts Chu-Sing Yang Department of Electrical Engineering National Cheng Kung University.
1 Bus topology network. 2 Data is sent to all computers, but only the destination computer accepts 02608c
1. Layered Architecture of Communication Networks: TCP/IP Model
Page 12/9/2016 Chapter 10 Intermediate TCP : TCP and UDP segments, Transport Layer Ports CCNA2 Chapter 10.
COMP2322 Lab 1 Introduction to Wireshark Weichao Li Jan. 22, 2016.
TCP/IP Protocol Suite 1 Chapter 17 Upon completion you will be able to: Domain Name System: DNS Understand how the DNS is organized Know the domains in.
Hands-On Ethical Hacking and Network Defense Chapter 2 TCP/IP Concepts Review Last modified
Data Communications and Networks Chapter 6 – IP, UDP and TCP ICT-BVF8.1- Data Communications and Network Trainer: Dr. Abbes Sebihi.
TCP/IP1 Address Resolution Protocol Internet uses IP address to recognize a computer. But IP address needs to be translated to physical address (NIC).
- 1 - DPNM Review of Important Networking Concepts J. Won-Ki Hong Dept. of Computer Science and Engineering POSTECH Tel:
COMPUTER NETWORKS Hwajung Lee. Image Source:
End-host IP: MAC: 11:11:11:11:11 gateway IP: MAC: 22:22:22:22:22 Google server IP: interne t interface DNS server IP:
Introduction to TCP/IP
COMP2322 Lab 1 Wireshark Steven Lee Jan. 25, 2017.
TCP/IP Transmission Control Protocol / Internet Protocol
Network Architecture Introductory material
Review of Important Networking Concepts
Chapter 6 The Data Link layer
TCP/IP Networking An Example
Week 5: Network Protocols Part 1
Process-to-Process Delivery:
Review of Important Networking Concepts
1 TRANSMISSION CONTROL PROTOCOL / INTERNET PROTOCOL (TCP/IP) K. PALANIVEL Systems Analyst, Computer Centre Pondicherry University, Puducherry –
Process-to-Process Delivery: UDP, TCP
Review of Important Networking Concepts
Presentation transcript:

Packet capture and protocol analysis 1

Content TCP/IP Networking Review Packet Capture Protocol Analysis 2

3

4 Communications Architecture The complexity of the communication task is reduced by using multiple protocol layers: Each protocol is implemented independently Each protocol is responsible for a specific subtask Protocols are grouped in a hierarchy A structured set of protocols is called a communications architecture or protocol suite

5

6 TCP/IP Protocol Suite The TCP/IP protocol suite is the protocol architecture of the Internet The TCP/IP suite has four layers: Application, Transport, Network, and Data Link Layer End systems (hosts) implement all four layers. Gateways (Routers) only have the bottom two layers.

7 Send HTTP Request to Server Establish a connection to at port 80 Open TCP connection to port 80 Send a datagram (which contains a connection request) to Send IP datagram to Send the datagram to Send Ethernet frame to 00:e0:f9:23:a8:20 Send Ethernet frame to 00:20:af:03:98:28 Send IP data-gram to Send the datagram to Frame is an IP datagram IP datagram is a TCP segment for port 80 HTTP service listening at port 80

8 Layers and Services Service provided by TCP to HTTP: – reliable transmission of data over a logical connection Service provided by IP to TCP: – unreliable transmission of IP packets across an IP network Service provided by Ethernet to IP: – transmission of a frame across an Ethernet segment Other services: – DNS: translation between domain names and IP addresses – ARP: Translation between IP addresses and MAC addresses

9 Encapsulation and Demultiplexing As data is moving down the protocol stack, each protocol is adding layer-specific control information

10 Encapsulation and Demultiplexing

11 Encapsulation and Demultiplexing: IP Header

12 Encapsulation and Demultiplexing: TCP Header Option: maximum segment size

Content TCP/IP Networking Review Packet Capture Protocol Analysis 13

Packet capture/Sniffering Why do we need to capture packets? – troubleshoot network problems – examine security problems – debug protocol implementations – learn network protocol internals 14

Packet capture tools/Sniffers Classic tools – WireShark ( – TCPDump ( Other tools – Ettercap – Dsniff – Ntop – KISMET – WinDump – Tshark – … 15

16 What is Wireshark? An open source packet analyzer Decodes 1115 protocols (V1.4) Supports command-line and GUI interfaces Run on many platforms including Windows, OS X, Linux, and UNIX Many online resources Wireshark User's Guide ( ser-guide-a4.pdf)

Wireshark libpcap Winpcap WindowsLinux

Wireshark Y:\Win32\WiresharkPortable Select interface tcp visit HTTP traffic 18

TCPDump/WinDump/Tshark Tcpdump – Unix-based command-line tool used to analyze packets Including filtering to just capture the packets of interest – Capture packets from interface specified using -i option – Read packets from an existing trace file specified using -r option – Save captured packets using -w option WinDump – The Windows version of tcpdump Tshark – Tcpdump-like capture program that comes with Wireshark – Very similar behavior & flags to tcpdump 19

20 Commonly Used Tcpdump Options -n Don’t convert host addresses to names. Avoids DNS lookups. It can save you time. -w Write the raw packets to the specified file instead of parsing and printing them out. Useful for saving a packet capture session and running multiple filters against it later -r Read packets from the specified file instead of live capture. The file should have been created with –w option -q Quiet output. Prints less information per output line

21 Commonly Used Options -s 0 tcpdump usually does not analyze and store the entire packet. This option ensures that the entire packet is stored and analyzed. NOTE: You must use this option while generating the traces for your assignments. (Default in tshark) -A (or –X in some versions) Print each packet in ASCII. Useful when capturing web pages. NOTE: The contents of the packet before the payload (for example, IP and TCP headers) often contain unprintable ASCII characters which will cause the initial part of each packet to look like rubbish

22 Writing Filters Specifying ICMP packets – “icmp” Specifying UDP packets – “udp” Specifying TCP packets – “tcp”

23 Writing Filters Combining filters – and (&&) – or (||) – not (!) Example: – All tcp packets which are from or to host tcpdump “tcp and host – Lots of examples in the EXAMPLES section of the man page

WinDump y:\win32\windump ping – Pinging [ ] with 32 bytes of data windump -D – Show the interface name and index windump -i 1 -n host and tcp 15:37: IP > : P 77836:78946(1110) ack win

Content TCP/IP Networking Review Packet Capture Protocol Analysis 25

26 ARP and RARP Note: – The Internet is based on IP addresses – Data link protocols (Ethernet, FDDI, ATM) may have different (MAC) addresses The ARP and RARP protocols perform the translation between IP addresses and MAC layer addresses

27 ARP Packet Format

ARP Request Message Source contains initiating system’s MAC address and IP address Destination contains broadcast MAC address ff.ff.ff.ff.ff.ff

ARP Reply Message Source contains replying system’s MAC address and IP address Destination contains requestor’s MAC address and IP address

Domain names and IP addresses People prefer to use easy-to-remember names instead of IP addresses Domain names are alphanumeric names for IP addresses e.g., ietf.org The domain name system (DNS) is an Internet- wide distributed database that translates between domain names and IP addresses

Domain name resolution 1.User program issues a request for the IP address of a hostname 2.Local resolver formulates a DNS query to the name server of the host 3.Name server checks if it is authorized to answer the query. a)If yes, it responds. b)Otherwise, it will query other name servers, starting at the root tree 4.When the name server has the answer it sends it to the resolver.

DNS packet format Identification used to match request/reply packets; QR, Query/Response; Opcode: QUERY, Standard query. AA, Authoritative Answer; TC, Truncated; RD, Recursion Desired;RA, Recursion Available; Z, reserved bits AD, Authenticated data CD, Checking Disabled; Rcode, Return code 32

DNS Query 33

DNS Response 34

35 TCP TCP = Transmission Control Protocol Connection-oriented protocol Provides a reliable unicast end-to-end byte stream over an unreliable internetwork.

36 Connection-Oriented Before any data transfer, TCP establishes a connection: One TCP entity is waiting for a connection (“server”) The other TCP entity (“client”) contacts the server Each connection is full duplex

Reliable Byte stream is broken up into chunks which are called segments Receiver sends acknowledgements (ACKs) for segments TCP maintains a timer. If an ACK is not received in time, the segment is retransmitted Detecting errors: TCP has checksums for header and data. Segments with invalid checksums are discarded Each byte that is transmitted has a sequence number 37

38 TCP Format TCP segments have a 20 byte header with >= 0 bytes of data.

39 Three-Way Handshake

TCP SYN 40

TCP SYN/ACK 41

TCP ACK 42

43 HTTP Hypertext Transfer Protocol is a network protocol used to deliver virtually all files and other data (collectively called resources) on the World Wide Web. This is a request and retrieve function of the server. This includes: Text files, graphic images, sound, video, and other multi-media files.

44 HTTP Request Methods There are 3 open-ended methods that are frequently used to request information: GET – used to ask for specific document and is the simplest form of requesting information (URL access will not change the state of database) HEAD – used to ask for information about a document (very fast because less data is required) POST – used when the service associated with the processing of the form has side effects (URL access will cause change in database). Example: Ebay, Amazon

HTTP Request 45

HTTP Response 46

Exercise: ARP ipconfig /all ; see local IP and gateway route -print ; find gateway arp -a ; list all MAC addresses learned arp -d * ; delete all MAC address learned ping What is the MAC address of the router/default gateway? 47

Hints If the default gateway/router’s MAC address is not in the cache, the host will send ARP to ask for it. The default gateway’s IP address is pre- configured or learnt through the DHCP protocol. 48

Exercise: ICMP ping – htm htm – What is the value of ‘Type’ in the outgoing ICMP packet? – What is the value of ‘Type’ in the incoming ICMP packet? – Take a look at the data section in the incoming ICMP packet. tracert – What are the answers to the above two questions? 49

Hints Ping – Send: ICMP Echo Request – Receive: ICMP Echo Reply Traceroute – Send: And kind of IP packet with special TTL It would be an ICMP packet if we need the reply from the destination – Receive: ICMP Time Exceeded 50

Exercise: DNS nslookup Take a look at DNS query and response packets nslookup set type=PTR Take a look at DNS query and response packets 51

Hints set type=A (default setting) – Normal DNS lookup: get the IP address from a host name set type=PTR – Reverse DNS lookup: get the host name from its IP address 52

Exercise: HTTP/TCP Use browser to visit Take a look at – TCP’s three-way handshake – sequence numbers in packets from the server and the acknowledgement number in packets from the client – HTTP header in the packet from the client – HTTP header in the packets from the server 53

Exercise: Trace analysis Real trace from a VoIP hacking demo – Analyze the trace using Wireshark and answer the following questions – Which 4 protocols are involved in the pcap? – Which codec does the RTP stream use? – How did the attacker gain access to the server? – Where is the hacked server? Tips: look into the payload 54

Hints 4 Protocols: HTTP, RTP, RTCP, SIP RTP uses G.7111 PCMU coding Default user name/password – Authorization: Basic bWFpbnQ6cGFzc3dvcmQ= The city is DISTRITO FEDERAL MEXICO – Hear it Telephony -> RTP -> Stream analysis – Public IP: in an HTTP response Follow HTTP connections Look into the HTTP responses Use Geolocation websites to locate the city 55

Reference* reshark.ppt usa-01-Mike-Beekey.ppt Topics/http.ppt pdf Computer Networking: A Top-down Approach Featuring the Internet * Some slides were taken from the above sources and the pcap file was from Forensic Challenge VoIP 56