Injecting data inside packets
We can manipulate the packet and change its contents before replaying it back to the network. Since our packets are actually stored as items inside the list, we can iterate over those items and replace specific information. For example, we can change mac addresses, IP addresses, or add additional layers to each packet or for specific packets matching a condition. However, we should note that manipulating packets in specific layers such as the IP and TCP and changing the content will result in an invalid checksum for the whole layer and the receiver may drop the packet for that reason.
Scapy has an amazing feature (yes I know, I keep saying amazing many times but Scapy really is an awesome tool). It will automatically ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access