I would like to send my packet to a UDP dst port number and send it through eth0 interface (if scapy handles my layer2 directly, then eth0 does not need to be given as an argument)
Asked
Active
Viewed 3.8k times
1 Answers
18
Using the scapy documentation, we see that sending an UDP packet is as simple as:
send(IP(dst="127.0.0.1")/UDP(dport=123)/Raw(load="abc"))

Ortomala Lokni
- 56,620
- 24
- 188
- 240
-
Maybe someone else is looking for it: use `sport=RandShort()` for a random source port. – stackprotector Oct 22 '21 at 14:32