We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c1b4b3e commit 684987fCopy full SHA for 684987f
arp_scan.py
@@ -0,0 +1,19 @@
1
+#!/usr/bin/env python
2
+# Arp scanner
3
+
4
+# Suppress warning messages from Scapy, but show errors.
5
+import logging
6
+logging.getLogger("scapy.runtime").setLevel(logging.ERROR)
7
8
+from scapy.all import *
9
10
+SUBNET = "192.168.1."
11
+HOST_RANGE_START = 1
12
+HOST_RANGE_END = 254
13
14
+for host in range(HOST_RANGE_START,HOST_RANGE_END):
15
+ ip = SUBNET +str(host)
16
+ arpRequest = Ether(dst="ff:ff:ff:ff:ff:ff")/ARP(pdst=ip, hwdst="ff:ff:ff:ff:ff:ff")
17
+ arpResponse = srp1(arpRequest, timeout=1, verbose=0)
18
+ if arpResponse:
19
+ print "IP: " + arpResponse.psrc + " MAC: " + arpResponse.hwsrc
0 commit comments