Question

I want to send via scapy on one interface and listen on another. Instead of writing two functions, I'm curious if the existing "Send and Receive" function of Scapy "srp" supports specifying an "ingress" and "egress" port

For example, I'm sending on "Eth4" now, and I wish to listen to "Eth5", right now it is sending and listening on the same port

h=srp(Ether()/IP()/TCP(sport=80,dport=8080),iface="eth4")
Was it helpful?

Solution

The interface you specify in Scapy via srp() is the one interface it will listen on for sending and receiving.

Both the sendp and sniff functions have the interface option. Send your packet on your chosen interface with sendp and listen for it on your ingress interface with sniff.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top