I am playing around with scapy (module for Python). I want to build packages and send them across my local network from one host to another. When I buil my package like that, I do not receive anything on my destination host:
packet = Ether() / IP(dst='192.168.0.6') / TCP(dport=8000) => sendp(packet).
However, when I build it like that it works: packet = IP(dst='192.168.0.6') / TCP(dport=8000), send(packet).
I capture the packages on my destination host with the help of wireshark.
Why doesn't the Ethernet-Variant work? I have all my PCs connected with ethernet cables...
Thanks for help!
send() uses Scapy's routing table (which is copied from the host's routing table when Scapy is started), while sendp() uses the provided interface, or conf.iface when no value is specified.
So you should either set conf.iface = [iface] ([iface] being the interface you want to use), or specify sendp([...], iface=[iface]).
Can't send ethernet packages across my LAN