Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Task 2.2: Spoofing When a normal user sends out a packet, operating systems usually do not allow the user to set all the fields in

image text in transcribedimage text in transcribed
Task 2.2: Spoofing When a normal user sends out a packet, operating systems usually do not allow the user to set all the fields in the protocol headers (such as TCP, UDP, and IP headers). OSes will set most of the fields, while only allowing users to set a few fields, such as the destination IP address, the destination port number, etc. However, if users have the root privilege, they can set any arbitrary field in the packet headers. This is called packet spoofing, and it can be done through raw sockets. Raw sockets give programmers the absolute control over the packet construction, allowing programmers to construct any arbitrary packet, including setting the header fields and the payload. Using raw sockets is quite straightforward; it involves four steps: . (1) create a raw socket, . (2) set socket option, . (3) construct the packet, and . (4) send out the packet through the raw socket. There are many online tutorials that can teach you how to use raw sockets in C programming. You can also refer to the example from CSC231. We show a simple skeleton of such a program. int sd; struct sockaddr_in sin; char buffer [1024] ; // You can change the buffer size /* Create a raw socket with IP protocol. The IPPROTO_RAW parameter * tells the sytem that the IP header is already included; * this prevents the OS from adding another IP header. */ sd = socket (AF_INET, SOCK_RAW, IPPROTO_RAW) ; if (sd

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Introduction to Wireless and Mobile Systems

Authors: Dharma P. Agrawal, Qing An Zeng

4th edition

1305087135, 978-1305087132, 9781305259621, 1305259629, 9781305537910 , 978-130508713

More Books

Students also viewed these Programming questions