how to send one udp packet multiple time in scapy ?
11,941
Solution 1
Here you go:
sendp(p, iface=eth0, inter=1 , count=x )
Where p
is your packet or a list of packets and count
is the number of times to repeat the send operation.
Also check the corresponding documentation scapy.sendrecv Namespace Reference.
Solution 2
create ip packet
i=IP()
i.dst="destination ip "
create udp packet
u=UDP()
u.dport="destination port"
now send
while(1)
{
send(i/u)
}
Solution 3
With this line, your packet will be send continuously, on a loop :
send(packet, loop=1)
Author by
ms.flo
Updated on June 04, 2022Comments
-
ms.flo about 2 years
How to send one udp packet multiple time in scapy ? I need to send,an valid udp packet more than one times. Is there any specific method or function in scapy ?
-
Symmetric over 10 yearsThis is very slow; use sendp() (as suggested above) to get a reasonable rate.
-
lowitty over 9 years@Symmetric How can I send packet one by one and in a fast speed using scapy? I need to modify every packet and send it out, problem is that send(packet) takes a long time. Do you know that there is a solution?
-
John Smith about 2 yearsI noticed that when loop=2 is specified it works as well. What is the difference between
loop=1
andloop=2
? -
Utopia about 2 yearsloop=2 means you sent two packets at the same time, in a loop.