문제

with Scapy I can sniff packets and filter by destination.

sniff(filter="dst <ip addr>")

How do I use Scapy to only forward packets that are being sent to that specific ip address?

도움이 되었습니까?

해결책

You can use the prn argument for sniff like this

sniff(filter="your ip address", prn=process_packet)

Where process_packet is a method that do what you need, like this

def process_packet(pkt):
    here you do what you need with the sniffed packet

Sniff function will apply process_packet to every packet that is sniffed.

Hope this is what you asked.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top