Search code examples
pythonpython-3.xscapyarpether

scapy code: srp(Ether()/ARP(pdst="192.168.0.100"), timeout=1, inter=0.2) sometimes can receive the answers, normally can't


These are all I wanna send out and get the answers. However, only sometimes can get the correct receive packets, usually can't.

srp(Ether()/ARP(pdst="192.168.0.100", hwsrc="xxxxxx"), timeout=2)

this problem is driving me crazy, anybody can help to figure it out?


Solution

  • Well that's simple: your host doesn't always answer to the ARP requests.

    Certain devices tend to do this more than others. For instance iPhones devices tend not to, and only answer to ARP when they are connecting to the network (short timeframes) whereas Windows / Linux computers tend to answer everything.