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")
Était-ce utile?

La 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.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top