-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscan.py
More file actions
32 lines (25 loc) · 714 Bytes
/
scan.py
File metadata and controls
32 lines (25 loc) · 714 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/usr/bin/env python3
# davep 201800303; learning scapy
# broadcast a probe request, read probe response(s)
from scapy.all import *
def main(iface):
fam, hw = get_if_raw_hwaddr(iface)
print("hw=%s" % hw)
bcast = "ff:ff:ff:ff:ff:ff"
rep = RadioTap(len=None)\
/ Dot11(
addr1=bcast,
addr2=hw,
addr3=bcast,
# SC=9999
)\
/ Dot11ProbeReq()\
/ Dot11Elt(ID="SSID",len=0)\
/ Dot11Elt(ID="Rates", info="\x0c\x12\x18\x24\x30\x48\x60\x6c")
# ans, unans = srp(rep, multi=True, iface=iface, timeout=5)
ans, unans = srp(rep, multi=True, iface=iface, timeout=5, filter="wlan addr1 a4:c4:94:a2:91:17")
if ans is not None:
ans.summary()
if __name__ == '__main__':
iface = sys.argv[1]
main(iface)