13

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)

0

1 Answer 1

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"))
1
  • Maybe someone else is looking for it: use sport=RandShort() for a random source port. Oct 22, 2021 at 14:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.