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

  Importance of maintaining the secure computing environment

Prepare a report providing categorical feature comparison for the three products in the chosen category and make recommendations about the products to assist purchasing decision.

  How can we identify security risks and assess their levels

So, how can we identify security risks, assess their levels, implement appropriate tests and other controls, and report security test results based on risk?

  What are some windows security infrastructure components

How do you measure security? One of the ways is to calculate risk by the formula: R = T x V x A/C.  What are some Windows security Infrastructure components

  Identification of preventative controls

Identification of preventative controls and the development of recovery strategies and Explanation of the information technology (IT) contingency planning process to include an understanding of the required business impact analysis

  Most of the organizations have now adopted or begun to

many organizations have now adopted or begun to offer cloud computing. this type of computing has advantages and

  How can rfid works in construction company

How can RFID works in construction company, take one construction company as an example and write how RFID functions in it, i dont want you to explain each and every standard.

  How could a cyberattack affect airline operations

How could a cyberattack affect one of the following? 1 airport operations 2 airline operations 3 air traffic control operations.

  How is a chroot jail used to improve application security

How is a chroot jail used to improve application security? Where are two places user and group information may be stored on Windows systems?

  Implementation issues for it security policy development

Examine the implementation issues for IT security policy development. Determine which of these issues are the most challenging for organizations to overcome and explain why.

  Write a reflection report about the role cryptography

Determine what the risk to an organisation is, you need to know what the problems could be - Write a reflection report in 100 words about the role cryptography

  Search the web for news on computer security breaches

Search the web for news on computer security breaches that occurred during April-August 2015. Research one such reported incident. Prepare a report focusing on what the problem was, how and why it occurred and what are the possible solutions.

  What are some of the considerations and issues

Discuss key management techniques. What are some of the considerations and issues? Give at least two examples of key management techniques.

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