Craft and send some traffic using scapy

Assignment Help Computer Network Security
Reference no: EM132578227

LAB - Packet Crafting for IDS/IPS

Objectives:
Experiment with reading, writing and modifying packets.

These exercises help you become more familiar with concepts associated with Packet Crafting for IDS/IPS.

Exercise 1:
Enter scapy interface as follows:

The interface prompt is ">>>"

Description: Scapy supplies default values to fields/attributes so we supply the values we want to change only.

1. Craft an ICMP echo request with the following:
• An Ethernet source address of a1:b1:c1:d1:e1:f1
• An Ethernet destination address of a2:b2:c2:d2:e2:f2
• A source IP address of 192.168.1.1
• A destination address of 192.168.1.2
• An ICMP sequence number of 1234
2. Display the frame you just created.
3. Use Scapy to write the frame to the output pcap filename /tmp/icmp.pcap
4. In another terminal use tcpdump or wireshark to examine the record in
/tmp/icmp.pcap to make sure that the frame you crafted matches the specification detailed.
Note: if you choose to use tcpdump, supply the command line option -e to display the Ethernet header.

Exercise 2:
The objective of this exercise is to modify certain field of the packet, following the steps below:

1. Read /tmp/icmp.pcap, which you have created in (Exercise 1) using the same
Scapy session that you have open.
2. Change the value of the ICMP sequence number to 4321 and perform.
3. Write the new record to /tmp/icmp2.pcap
4. Read /tmp/icmp2.pcap in another terminal using tcpdump supplying it the
-vv option to verify that you crafted a valid record. Notice that an error was inadvertently introduced;
5. Correct the issue by changing the record that still exists in your Scapy
interactive session and writing it out again, to /tmp/icmp2.pcap.

6. Return tcpdump in the other terminal to make sure you corrected the issue.

Exercise 3:
Description:
This exercise enables you to craft and send some traffic using Scapy. Specifically, you will craft an ICMP echo request in one Scapy interactive session and send it, listen for it in another Scapy interactive session, and respond with a crafted ICMP echo reply from this second session.

All this is done over the network loopback interface instead of the default
eth0 interface.
This requires you to enter some Scapy configuration commands to assign a particular network socket to use.
You need to open three different terminals for this. All of them require you to be root using the sudo -s command with a password of "training". Scapy requires you to whenever you send a frame or packet to a network interface. This means you need to exit from the current Scapy session with CTRL/D, become root, and then go back into Scapy for one of the terminal open as root.

1. In the first terminal, use tcpdump to sniff traffic you crafted and sent from the Scapy sessions in the other two terminals.

2. In the second terminal, invoke the Scapy interactive interface and
prepare Scapy to sniff an ICMP echo request that was sent from another Scapy session in the third terminal.


• The first command configures Scapy to use the socket support for the loopback interface.
• The second line places Scapy in sniffing mode; specifically, it uses a familiar looking filter format (BPF) to look for a single ICMP echo request from the loopback interface. It puts the response in a list called
r. Scapy waits until it receives a record that matches the sniff criteria.

3. In the third terminal, invoke the Scapy interactive interface and send an ICMP echo request.

You are required to craft an ICMP echo request with a destination IP address of "127.0.0.1" with an ICMP ID value of 10 and an ICMP sequence value of 100. Add any string payload to this, enclosing it in double quotes.

Hint:
An example format would be IP()/ICMP()/"YOUR MESSAGE" where you supply the
IP() and ICMP() appropriate attribute values. Send your ICMP

Send your ICMP echo request. Make sure that you see in the tcpdump output the ICMP echo request you sent and the echo reply that the localhost returned.
Now, return to the Scapy interface that sniffed the packet. Display the received ICMP echo request to find the ICMP ID value of 10, display as 0xa, and the ICMP sequence number of 100.

Next, craft an ICMP echo response. Substitute "YOUR MESSAGE" for the payload that you supplied to the ICMP echo request you sent.

You should see an ICMP echo reply in the tcpdump output that is identical to the one generated by the host if you have successfully sent the ICMP echo reply.

Exercise 4:

Description:
The exercise is to reset an established TCP session on the localhost using Scapy. This requires you to use Scapy to craft a TCP reset segment with all the correct values found in the session to include the source and destination ports, TCP sequence number, and TCP flags.

You need four different terminals in this exercise. Three must be configured as root. Here is the scenario:
First configure the preparation phase by starting tcpdump as root in the first terminal to examine the traffic exchanged on the localhost. In a second terminal as root, enter the Scapy interactive interface and first perform some configuration to send traffic on the loopback interface. In a third terminal as root, set up a netcat listener on port 99.
Finally, in a fourth terminal as user sans, use netcat to connect to the To the netcat listener. You can then craft a packet from Scapy to reset the established connection.

1. In the first terminal as root, start tcpdump to examine the traffic exchanged on the localhost. Make sure to use the option -S to display the absolute TCP sequence numbers that you need to craft the reset.
tcpdump -i lo -ntS ‘tcp and port 99'
2. In a second terminal as root, enter Scapy interactive interface and perform some configuration to send traffic on the loopback interface.
3. In the third terminal as root, set up a netcat listener on port 99.
4. In a fourth terminal as user ct6034, use netcat to connect to the netcat listener. You can then craft a packet from Scapy to reset the established connection.

Attachment:- Packet Crafting.rar

Reference no: EM132578227

Questions Cloud

Calculate economic value added : Calculate required rate of return of equity of Oil Rigs and Special Drills.
What technology evolution model : Pick an AI Technology. What Technology Evolution Model Would Best Suited for Assessing the Technology
What amount should washington company report : What amount should Washington Company report as total accounts payable at December 31, 2015? On December 27, 2015, Washington wrote and issued checks
Determine the amount that will be recognized as a liability : Determine the amount that will be recognized as a liability in each In August 2015, the XYZ commenced a suit against DEF for alleged violation
Craft and send some traffic using scapy : Craft and send some traffic using Scapy. Specifically, you will craft an ICMP echo request in one Scapy interactive session and send it
Determine the amount Janey may deduct for Tim : Janey operates a business that uses the accrual method of accounting. Determine the amount Janey may deduct for Tim's services
How much must the additions be if the investment account : How much must those additions be if the investment account pays 8% compounded quarterly? The Stein family wants to buy a small vacation house
Outline what risks farflung plc might face in spacetopia : What strategies or techniques could Farflung Plc possibly utilise to mitigate the political risk of investment in Spacetopia that you may have outline
Prepare journal entries in general journal form for Feb : On January 31, the firm had accounts receivable in the amount of $750,000. Prepare journal entries in general journal form for Feb

Reviews

len2578227

7/20/2020 4:25:33 AM

You need to do all these practicals in your Ubuntu PC and then provide screenshots Instruction - Check tutorial 01 & 02 Do the practicals and take screenshots Add both tutorial practical screenshots into one word file Convert to a PDF and submit

Write a Review

Computer Network Security Questions & Answers

  An overview of wireless lan security - term paper

Computer Science or Information Technology deals with Wireless LAN Security. Wireless LAN Security is gaining importance in the recent times. This report talks about how vulnerable are wireless LAN networks without any security measures and also talk..

  Computer networks and security against hackers

This case study about a company named Magna International, a Canada based global supplier of automotive components, modules and systems. Along with the company analysis have been made in this assignment.

  New attack models

The Internet evolution is and is very fast and the Internet exposes the connected computers to attacks and the subsequent losses are in rise.

  Islamic Calligraphy

Islamic calligraphy or Arabic calligraphy is a primary form of art for Islamic visual expression and creativity.

  A comprehensive study about web-based email implementation

Conduct a comprehensive study about web-based email implementation in gmail. Optionally, you may use sniffer like wireshark or your choice to analyze the communication traffic.

  Retention policy and litigation hold notices

The purpose of this project is to provide you with an opportunity to create a document retention policy. You will also learn how to serve a litigation hold notice for an educational institute.

  Tools to enhance password protection

A report on Tools to enhance Password Protection.

  Analyse security procedures

Analyse security procedures

  Write a report on denial of service

Write a report on DENIAL OF SERVICE (DoS).

  Phising email

Phising email It is multipart, what are the two parts? The HTML part, is it inviting the recepient to click somewhere? What is the email proporting to do when the link is clicked?

  Express the shannon-hartley capacity theorem

Express the Shannon-Hartley capacity theorem in terms of where is the Energy/bit and is the psd of white noise.

  Modern symmetric encryption schemes

Pseudo-random generators, pseudo-random functions and pseudo-random permutations

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd