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")
有帮助吗?

解决方案

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.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top