Scapy script to send packets in a loop

This program demonstrates how to send packets in a loop with scapy. The srloop command in scapy is used for the purpose. The Python program, takes the destination IP address from the user (192.168.1.2) and sends an ICMP packet (ping) with type value as 8 and code value 0 to the destination in a Loop.

 


 

from scapy.all import

ip = IP()
ip.dst = raw_imput(“n Enter the destinaltion IP address : “)
icmp = ICMP()
icmp.type = 8
icmp.code = 0
srloop(ip/icmp)

Become a packet crafting expert with our video course – Python Network programming