killchain-compendium/enumeration/network_scanners/arp_enum.py

17 lines
335 B
Python
Raw Normal View History

2021-08-23 01:13:54 +02:00
#!/usr/bin/env python
from scapy.all import *
interface = "wls3"
ip_range = "192.168.179.0/24"
broadcastMac = "ff:ff:ff:ff:ff:ff"
packet = Ether(dst=broadcastMac)/ARP(pdst=ip_range)
ans, unans = srp(packet, timeout=2, iface=interface, inter=0.1)
for send, receive in ans:
print(receive.sprintf(r"%Ether.src% - %ARP.psrc%"))