简体   繁体   中英

Checking Custom Protocol Response Packet Field

I have implemented a custom packet/protocol in scapy and sent it to a device on the network. The custom protocol is a hardware broadcast to discover the receiving devices mac address. Using wireshark, I have confirmed that the device is responding to the packet, however when I do the following:

def check_connections(interface):
    src_mac = get_if_hwaddr(interface)
    dest_mac = 'FF:FF:FF:FF:FF:FF'
    packet = Narp(dest=dest_mac, src=src_mac)
    response = srp1(packet, iface=interface, verbose=False, timeout=2)
    print response

response is nonetype, meaning scapy did not perceive a response.

In wireshark the packet being sent from the responding device is being addressed to the same hardware interface I used to send the packet from.

Any idea what could be causing scapy to not identify the incoming packet as a response?

You need to implement a way for Scapy to match the answers. Have a look at https://stackoverflow.com/a/27974093/5459467 . It explains that you'll need to implement answers .

You can find quite a few code examples online.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM