Python Scapy Intercept Packets before sending them on

1.3k views Asked by At

I have three virtual machines all on Centos 6.5.

The current setup is as follows:

A ------(eth0) B (eth1)------- C

Currently, when A pings C, it is routed through B as they are on different networks.

I want to write a script using python and scapy (Used on machine B) that will intercept the packet that passes through eth0.
By intercepting the packet, I can hold it for some time (delay) or do some packet manipulation. I then want to send the packet to its destined destination.

Does anyone know how I can intercept packets before they reach their end destination using Python and Scapy?

I have read a lot about Netfilter and iptables but not exactly sure how I can intercept the packets and change them.

Thank you in advance

0

There are 0 answers