How it works...

This script defines a send_packet() function to construct the IP packet using Scapy. The source and destination addresses and ports are supplied to it. Depending on the protocol, for example, TCP or UDP, it constructs the correct type of packet. If the packet is TCP, the flags argument is used; if not, an exception is raised.

In order to construct a TCP packet, Sacpy supplies the IP()/TCP() function. Similarly, in order to create a UDP packet, the IP()/UDP() function is used.

Finally, the modified packet is sent using the send() function.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.15.12.34