This tutorial demonstrates how an ARP request packet can be sent at Layer 2 using Scapy and Python. The program takes the destination address as the required IP address (192.168.1.2), and uses the sendp functionality in scapy. In this program an ARP packet is crafted where the ether header is given as broadcast for ARP request packets. The packet is sent by appending ethernet headers. The Packet is then sent using the sendp command.Python file is used for the purpose.
Join our Course to Build Network Automation tools and scripts with Python and Scapy on Udemy
from scapy.all import*
dst=raw_input(‘n enter the destination ip address=’)