1. Homepage
  2. Homework
  3. INFO3007 Network Security Practical 1, Spring 2022 - ARP cache poisoning
This question has been solved

INFO3007 Network Security Practical 1, Spring 2022 - ARP cache poisoning

Engage in a Conversation
Western Sydney UniversityINFO3007Network SecurityPythonScapyHomework

INFO3007 Network Security CourseNana.COM

Practical 1, Spring 2022 CourseNana.COM

Due: 11:59pm on Thursday of the week where the practical is. CourseNana.COM

Introduction CourseNana.COM

Shown in the figure below is part of a diagram used in Lecture 1, with regard to ARP Cache Poisoning. The main objective of this practical is to use a program to perform ARP cache poisoning attacks on the ARP cache of a target computer and indirectly via the default gateway.  CourseNana.COM

IP Address CourseNana.COM

MAC Address CourseNana.COM

192.168.1.1 CourseNana.COM

A_MAC_Addr CourseNana.COM

192.168.1.2 CourseNana.COM

MAC_PC2 CourseNana.COM

• ARP Cache Poisoning Attack CourseNana.COM

g Performed by changing (or poisoning) the MAC Address part of an entry in the target computer’s arp cache CourseNana.COM

In the diagram, PC3 is the attack computer and PC4 is the target computer. The end result of the attack is:
The default gateway’s MAC address in PC4’s ARP cache is replaced by another MAC address A_MAC_Addr. CourseNana.COM

In the diagram, symbols, e.g. A_MAC_Addr, are used to represent MAC addresses. The actual MAC address values should be used in an actual system. Note that the IP addresses of the default gateway and the computers in the lab, which is a VMware environment, may be different from those in the diagram. The actual IP addresses of the default gateway and computers in the lab can be found by the Windows command ipconfig and should be used in this practical. CourseNana.COM

Task 1. Scapy (1 mark) CourseNana.COM

The networking tool used in this practical is called Scapy, which can be used as a packet builder. This tool is a computer program written in Python and is run in the Python interpreter. Python is a comprehensive script programming language. For this subject, we are not going to study, in depth, either Scapy or Python. We use Scapy as a tool to perform some of the practical tasks and will only use a few of the functions or features in Scapy or Python. These functions and features will be described and explained in the practical tasks if their understanding is important with regard to the successful completions of the tasks. CourseNana.COM

Use the altadmin account to logon a Windows machine. No password is required. CourseNana.COM

Step 1.1 CourseNana.COM

Two Windows virtual machines (VM's), NS-W7a and NS-W7b (which may be called slightly differently in each year's VM environment), on the School’s VMware server are provided for each student. NS-W7a is used as the Attack Computer and NS-W7b as the Target Computer. (Students who are familiar with the Linux OS may use NS-Kali as the Attacker instead.) CourseNana.COM

Windows 7 VMs are used instead of Windows 10 as Windows 7 has less demand on resources than Windows 10. Running a large number of Windows 10 VMs may slow down the VMWare server. CourseNana.COM

The networking tool used in this practical is Scapy and it can be run by opening a Windows command window and entering the Scapy command. CourseNana.COM

In this task, we use Scapy to build an ARP query to get the MAC address of another computer connected to the same LAN. Firstly, we need to know the IP address of the target computer using the command ipconfig on the target computer. CourseNana.COM

1.2.1 Write down the IP address of the target computer. CourseNana.COM

To send a Layer 2 frame by Scapy and to get a reply, the Scapy srp command is used.
The function
srp is the Scapy Send&Receive function, which sends packets onto the network CourseNana.COM

through a network interface card and receives the replies if any. For example, CourseNana.COM

ans,unans=srp(Ether(dst=“ff:ff:ff:ff:ff:ff”)/ARP(pdst=“192.168.1.134”),timeout=2, iface=“eth0”) CourseNana.COM

The above command broadcasts an ARP query onto the network connected to the network interface eth0 for the MAC address of another computer having an IP address of 192.168.1.134. Successful replies will be appended to the first list ans, while a sent packet which does not get a reply, after the timeout=2 sec, will be appended to the second list unans. CourseNana.COM

Note that Scapy fills in default values of those parameters which are not specified in the command. For example, if the parameter iface is not specified, Scapy will use a default interface: CourseNana.COM

ans,unans=srp(Ether(dst=“ff:ff:ff:ff:ff:ff”)/ARP(pdst=“192.168.1.134”),timeout=2) CourseNana.COM

In all the practicals where Scapy commands are used, it is not necessary to specify the iface parameter unless Scapy is not able to find the correct one. CourseNana.COM

Windows 7’s Firewall may interfere with some of the tasks below. It is better to disable it if it has not been done:
Click Start Control Panel System and Security Windows Firewall Turn CourseNana.COM

Windows on or off
o Select both Turn off Windows Firewall (not recommended) and then OK o Close the Control Panel window CourseNana.COM

Note that like other command prompts, Scapy command prompt has command history enabled, i.e., you could retrieve a previously entered command using the up arrow key. However, if Scapy is closed/terminated, command history may be lost. CourseNana.COM

Note that a,b are used instead of ans,unans as they are just names for the output variables. In the above diagram, the iface parameter was not specified. Scapy in this case used the default value. However, sometimes it may not work and iface needs to be specified. There is no effective way to find out the NIC label of a Windows computer, i.e., your VM’s NIC may not be eth0. One way to find out is to try iface=“eth0”, iface=“eth1”, iface=“eth2”, etc. until you get an answer. CourseNana.COM

The above screenshot shows an example in using the function srp to send an ARP query to IP address = 192.168.1.134, and the different ways in showing the contents of the first output argument, which in this example is a. CourseNana.COM

The method show() displays the contents of a in a higher level format: sent packet ==> received packet CourseNana.COM

From the received packet, it can be found that the MAC address of the computer of IP address = 192.168.1.134 is 00:0c:29:24:9b:8b CourseNana.COM

Step 1.3 Use the Scapy srp command on the attack computer to find out the MAC address of the target computer, assuming that you don’t have physical access to the target computer, except to find out its IP address. CourseNana.COM

1.3.1a Write down the Target’s MAC address found by your Scapy srp command. CourseNana.COM

1.3.1b Screenshot (which must include the area of the window where your Student ID is) of the Windows command terminal showing the execution and complete results of the above Scapy command CourseNana.COM

Reminder: A screenshot must include the area of the window where the Student ID is as specified in the document "Practical Screenshot Requirements. No marks will be given for the answers associated with this screenshot if the requirements are not met. CourseNana.COM

Task 2. ARP DoS Attack (1.5 marks) CourseNana.COM

In theory, an ARP DoS Attack can be carried out by sending ARP queries continuously to the target computer where the query contains: CourseNana.COM

  1. a spoofed, (but valid) source IP address of the computer you want to masquerade
  2. a spoofed or an arbitrary MAC address
  3. the Target’s IP address

In Scapy command format, an ARP query to perform an ARP attack looks like this: sendp(Ether(dst=“Target MAC address”)/ARP(hwsrc=“Spoofed source MAC address”, CourseNana.COM

psrc=“Spoofed source IP address”, pdst=“Target IP address”), loop =1, inter=1)
In theory, dst=“ff:ff:ff:ff:ff:ff”. However, for the attack to work, dst has to be equal to the MAC
CourseNana.COM

address of the target computer. CourseNana.COM

The function sendp is used instead in this case, since we are not interested in receiving any replies from the target computer. CourseNana.COM

The parameters, loop = 1 and inter=1, in the command cause Scapy to repeat the command every 1 second. CourseNana.COM

Effectively, the above command enables you to place the following IP-MAC address pair into the ARP cache of the target computer of IP address Target IP Address and make it to remain there: CourseNana.COM

Spoofed source IP address : Spoofed source MAC address CourseNana.COM

When the target computer uses this address-pair to send packets, these addresses will be used as destination addresses. If the addresses are “poisoned”, packets will be sent to the wrong place. Refer to Lecture 1 for details of ARP Cache Poisoning. CourseNana.COM

In the example below, the pair of addresses are 192.168.0.2 : 00:11:22:33:44:55. CourseNana.COM

The screenshot above shows an example of using Scapy to perform an ARP Cache Poisoning attack on another computer of IP address pdst=”192.168.0.203” and MAC address dst. The Spoofed source IP address in this example is 192.168.0.2, i.e., the computer sending these packets does not have this address, but masquerades this address. The source MAC address hwsrc is a random MAC address. CourseNana.COM

The sequence of dots after the command shows packets are being sent from Scapy with each dot representing one packet. If only three dots are shown, a command is not working. CourseNana.COM

Step 2.1 On the attack computer, CourseNana.COM

  • Run Scapy using a Windows Command terminal
  • Enter the above sendp command, but replace the address values in the above command

so that the command can be used to place the following pair of address in the target computer’s ARP cache: CourseNana.COM

Default gateway’s IP address a random MAC address CourseNana.COM

where the random MAC address should NOT be any pre-defined MAC address such as ff:ff:ff:ff:ff:ff and should start with 00. That is: CourseNana.COM

Spoofed Source IP address = Default Gateway’s IP address Spoofed Source MAC address = A random MAC address CourseNana.COM

The above command, if entered correctly, will perform a DoS on the target computer in that the target computer will not be able to reach the default gateway and hence the Internet. It can be confirmed by pinging the default gateway from the target computer during the attack. CourseNana.COM

2.1.1 Screenshot (which must include the area of the window where your Student ID is) of the Windows command terminal showing the successful execution of the Scapy command CourseNana.COM

Step 2.2 Step 2.3 CourseNana.COM

Test if the attack is successful, by pinging the default gateway from the target computer. CourseNana.COM

If the attack is successful and while the above command is running on the attack computer, open a Windows command window on the target computer and use the Windows command arp –a to show the contents of the ARP cache on the target computer. CourseNana.COM

  1. 2.3.1a  Screenshot (which must include the area of the window where your Student ID is) of the Windows command terminal showing the execution and complete results of the arp -a command
  2. 2.3.1b  Write down the entry of the Target’s ARP cache relevant to this practical task, i.e. the IP-MAC address pair for the Default Gateway in the ARP cache.

Press Control-C to stop the Scapy command.
2.3.2 Write down the answer to the following question.
CourseNana.COM

Why it is necessary to continuously send ARP frames to the target computer in this attack? Hint: There are at least two reasons due to the characteristics of the ARP cache and the ARP protocol. What are these reasons? CourseNana.COM

Task 3. Traffic Redirection from a Target Computer (0.5 mark) CourseNana.COM

Step 3.1 Type the same sendp command in Task 2 to the Scapy prompt, except that hwsrc is equal to the MAC address of the attack computer’s NIC instead of a random MAC address. CourseNana.COM

Hence, the hwsrc parameter may be omitted since Scapy will put in the default value, which is the MAC address of the attack computer’s NIC. CourseNana.COM

Run the sendp command to make sure it works, i.e., no errors, and Control-C to stop the command. CourseNana.COM

Step 3.2 Run Wireshark to capture all traffic on the attack computer
Step 3.3 On the attack computer, run the sendp command in Step 3.1 again. On the target CourseNana.COM

computer, ping the default gateway CourseNana.COM

Page 6 of 12 CourseNana.COM

3.3.1 Screenshot (which must include the area of the window where your Student ID is) of the Windows command terminal showing the execution and complete results of the Scapy command in Step 3.3. CourseNana.COM

Step 3.4 Stop the Scapy command and Wireshark.
In the Wireshark capture, locate the packets which can be used to confirm that the pings CourseNana.COM

from the target computer to the default gateway were indeed directed to the attack computer instead of being sent to the default gateway. CourseNana.COM

3.4.1 Screenshot (which must include the area of the window where your Student ID is) of Wireshark showing the relevant captured packets in Step 3.4. CourseNana.COM

Optional Task 5 CourseNana.COM

This section of the practical task is for students who would like to explore some of the practical tasks further by using some investigation. This task is not assessed, i.e., no marks. CourseNana.COM

In Task 3, packets, i.e., ICMP echo requests, to the Default Gateway from the target computer were re-directed to the attack computer. The packets were captured by the use of Wireshark. Instead the packets may be captured by Scapy, e.g., using Scapy’s sniff() function. CourseNana.COM

Step 5.1 Repeat Task 3, but try using Scapy’s sniff() function to capture the re-directed ICMP echo requests instead. CourseNana.COM

Another enhancement to Task 3 is to forward the captured packets to the intended destination, i.e., the Default Gateway. In this case, knowledge on how to forward packets using the OS of the computer, or how to write program codes, e.g., using Python, to capture and forward the packets is required. CourseNana.COM

A.1 Connection to the VMware server
Open a Web browser and enter the following url to connect to the School’s VMware server.
URL: https://vsphereteaching.scem.westernsydney.edu.au/ui/
Login with your CDMS user name and password
CourseNana.COM

Locating and taking a snapshot of a VM
After logging in, navigate to the subject folder where your VM's are. Right-click a VM, and click
Snapshots and take a snapshot of the VM. Note that the folder structure in the following diagram is different from yours. CourseNana.COM

Get in Touch with Our Experts

WeChat (微信) WeChat (微信)
Whatsapp WhatsApp
Western Sydney University代写,INFO3007代写,Network Security代写,Python代写,Scapy代写,Homework代写,Western Sydney University代编,INFO3007代编,Network Security代编,Python代编,Scapy代编,Homework代编,Western Sydney University代考,INFO3007代考,Network Security代考,Python代考,Scapy代考,Homework代考,Western Sydney Universityhelp,INFO3007help,Network Securityhelp,Pythonhelp,Scapyhelp,Homeworkhelp,Western Sydney University作业代写,INFO3007作业代写,Network Security作业代写,Python作业代写,Scapy作业代写,Homework作业代写,Western Sydney University编程代写,INFO3007编程代写,Network Security编程代写,Python编程代写,Scapy编程代写,Homework编程代写,Western Sydney Universityprogramming help,INFO3007programming help,Network Securityprogramming help,Pythonprogramming help,Scapyprogramming help,Homeworkprogramming help,Western Sydney Universityassignment help,INFO3007assignment help,Network Securityassignment help,Pythonassignment help,Scapyassignment help,Homeworkassignment help,Western Sydney Universitysolution,INFO3007solution,Network Securitysolution,Pythonsolution,Scapysolution,Homeworksolution,