Packet Injection 101 Vivek Ramachandran. What is packet injection ? Please go through the raw socket tutorial before going further. Simply put packet.

Slides:



Advertisements
Similar presentations
TCP/IP Christopher Zacky. lolwut Decimal Numbers.
Advertisements

COEN 252 Computer Forensics Using TCPDump / Windump for package analysis.
Introduction1-1 message segment datagram frame source application transport network link physical HtHt HnHn HlHl M HtHt HnHn M HtHt M M destination application.
UDP & TCP Where would we be without them!. UDP User Datagram Protocol.
CSE551: Computer Network Review r Network Layers r TCP/UDP r IP.
Networks I Transmission Control Protocol Instituto Tecnológico y de Estudios Superiores de Monterrey Campus Estado de México Prof. MSc. Ivan A. Escobar.
Instructor: Sam Nanavaty TCP/IP protocol. Instructor: Sam Nanavaty Version – Allows for the evolution of the protocol IHL (Internet header length) – Length.
Transmission Control Protocol (TCP) Basics
1 Chapter 3 TCP and IP. Chapter 3 TCP and IP 2 Introduction Transmission Control Protocol (TCP) Transmission Control Protocol (TCP) User Datagram Protocol.
CS3505 The Internet and Info Hiway transport layer protocols : TCP/UDP.
Transport Layer – TCP (Part1) Dr. Sanjay P. Ahuja, Ph.D. Fidelity National Financial Distinguished Professor of CIS School of Computing, UNF.
Chapter 7 – Transport Layer Protocols
TCP segment structure source port # dest port # 32 bits application data (variable length) sequence number acknowledgement number rcvr window size ptr.
TRANSPORT LAYER  Session multiplexing  Segmentation  Flow control (TCP)  Connection-oriented (TCP)  Reliability (TCP)
1 Transport Control Protocol. 2 Header Identifies the port number of a source application program. Used by the receiver to reply. (16-bit). Identifies.
Lecture 1.2: Linux and networking Roei Ben-Harush 2015.
EEC-484/584 Computer Networks Lecture 15 Wenbing Zhao (Part of the slides are based on Drs. Kurose & Ross ’ s slides for their Computer.
1 Application TCPUDP IPICMPARPRARP Physical network Application TCP/IP Protocol Suite.
Source Port # (16)Destination Port # (16) Sequence Number (32 bits) Acknowledgement Number (32 bits) Hdr Len (4) Flags (6)Window Size (16) Options (if.
CSCE 515: Computer Network Programming TCP Details Wenyuan Xu Department of Computer Science and Engineering.
Packet Capture & Analyze
EEC-484/584 Computer Networks Lecture 13 Wenbing Zhao (Part of the slides are based on Drs. Kurose & Ross ’ s slides for their Computer.
Chapter 3 Review of Protocols And Packet Formats
Internet Protocol (IP)
LOGO “ Add your company slogan ” Damaga ( 다막아 ) 핵심 0703 프로젝트.
LWIP TCP/IP Stack 김백규.
1 Chapter 1 OSI Architecture The OSI 7-layer Model OSI – Open Systems Interconnection.
6.1. Transport Control Protocol (TCP) It is the most widely used transport protocol in the world. Provides reliable end to end connection between two hosts.
ECE Prof. John A. Copeland fax Office: GCATT.
Chapter 4 TCP/IP Overview Connecting People To Information.
TCP/IP Basic Theory V1.2. Course Outline OSI model and layer function TCP/IP protocol suite Transfer Control Protocol Internet Protocol Address Resolution.
TCP : Transmission Control Protocol Computer Network System Sirak Kaewjamnong.
Raw Sockets Vivek Ramachandran. A day in the life of Network Packet.
Fall 2005 By: H. Veisi Computer networks course Olum-fonoon Babol Chapter 6 The Transport Layer.
Transport Layer3-1 Chapter 3: Transport Layer Our goals: r understand principles behind transport layer services: m multiplexing/demultipl exing m reliable.
Review the key networking concepts –TCP/IP reference model –Ethernet –Switched Ethernet –IP, ARP –TCP –DNS.
 network appliances to filter network traffic  filter on header (largely based on layers 3-5) Internet Intranet.
Network Programming Eddie Aronovich mail:
Socket Program Training 10/24/2011. Introduction Video Streaming Server –Darwin VoIP –Asterisk Socket Program –Ex: FTP Backdoor Program 2.
Decoding an IP Header (1)
1 CSE 5346 Spring Network Simulator Project.
COP 4930 Computer Network Projects Summer C 2004 Prof. Roy B. Levow Lecture 9.
Transport Protocols.
or call for office visit,
NUS.SOC.CS2105 Ooi Wei Tsang Application Transport Network Link Physical you are still here.
Computer Networks 1000-Transport layer, TCP Gergely Windisch v spring.
Socket Program Training 10/27/2010. What is a Socket ? An interface between an application process and transport layer (TCP or UDP). 2.
Lecture 1.1: Introduction. 2 Agenda 1 1 What is Firewall Types of Firewall 2 2 Firewall in linux kernel 3 3.
Introduction To TCP/IP Networking Mr. Zeeshan Ali, Asst. Professor
Introduction to TCP/IP networking
or call for office visit, or call Kathy Cheek,
Hping2.
Introduction to Networking Recital 4
or call for office visit,
Internet Protocol Formats
Process-to-Process Delivery
© 2003, Cisco Systems, Inc. All rights reserved.
Transmission Control Protocol (TCP)
CSCI-1680 Transport Layer I
Internet Protocol (IP)
Training 2018/10/11.
Internet Protocol Formats
Transport Protocols: TCP Segments, Flow control and Connection Setup
Chapter 5 Transport Layer Introduction
Network Architecture Models: Layered Communications
Transport Protocols: TCP Segments, Flow control and Connection Setup
Transport Layer 9/22/2019.
TCP Connection Management
Packet Sniffing and Spoofing
Presentation transcript:

Packet Injection 101 Vivek Ramachandran

What is packet injection ? Please go through the raw socket tutorial before going further. Simply put packet injection is the technique by which a programmer can construct arbitrary packets in memory and inject them into the network. By arbitrary i mean - full control over all the headers – Ethernet, IP, TCP, UDP … you name it we’ve got it ! Additionally, raw packet injection allows the programmer to design his own custom protocols, if he so desires.

Packet Injection – the whole nine yards – Approach 1 1. Create a raw socket 2. Create the Ethernet Header 3. Create the IP Header 4. Create the TCP Header 5. Create the data 6. Put everything together 7. Send the packet out Raw Ethernet IP TCP Data Raw EthernetIPTCPData EthernetIPTCPData

Packet Injection – the whole nine yards – Approach 2 1. Create a raw socket 3. Create the Ethernet Header 4. Create the IP Header 5. Create the TCP Header 6. Create the data 7. Send the packet out Raw Ethernet TCP EthernetIPTCPData 2. Create a buffer for the packet Ethernet IP Raw EthernetIPTCPData

The Ethernet Header – Pictorial view

The Ethernet Header – Data structure view Defined in linux/if_ether.h Looks like this : struct ethhdr { unsigned char h_dest[ETH_ALEN]; /* destination eth addr */ unsigned char h_source[ETH_ALEN]; /* source ether addr */ unsigned short h_proto; /* packet type ID field */ } We will fill this structure up to create the Ethernet Header for our packet.

The IP Header – Pictorial View

The IP Header Data Structure View struct iphdr { #if defined(__LITTLE_ENDIAN_BITFIELD) __u8 ihl:4, version:4; #elif defined (__BIG_ENDIAN_BITFIELD) __u8 version:4, ihl:4; #else #error "Please fix " #endif __u8 tos; __u16 tot_len; __u16 id; __u16 frag_off; __u8 ttl; __u8 protocol; __u16 check; __u32 saddr; __u32 daddr; /*The options start here. */ }; Define in linux/ip.h

The TCP Header – Pictorial view

The TCP header – Data Structures view struct tcphdr { __u16 source; __u16 dest; __u32 seq; __u32 ack_seq; __u16 doff:4, res1:4, cwr:1, ece:1, urg:1, ack:1, psh:1, rst:1, syn:1, fin:1; __u16 window; __u16 check; __u16 urg_ptr; }; Define in linux/tcp.h

Let the games begin !