evilsocket/NetCommander — Issue #5: Add support to specify host
Author: rsreese
Created: 2011-12-09 18:29:03+00:00
State: open

Some hosts do not respond to ARP broadcast requests but will respond to direct request. Please consider adding "s" to specify the IP to look-up if host does not exist in list from broadcast request. This will require a direct arp lookup.

conf.verb=0
ans,unans=srp(Ether(dst="ff:ff:ff:ff:ff:ff")/ARP(pdst=iprange),
timeout=2)
collection = []
for snd, rcv in ans:
result = rcv.sprintf(r"%ARP.psrc% %Ether.src%").split()
collection.append(result)
return collection