> from scapy.all import *
Yeah.
Obviously we're not going to have Wireshark innards built with 10 lines of python (or whatever other language). However, the fact that such an easy to use, high level library available for packet inspection allowing one to build a quick AP scanner is completely relevant.
> A 10 Line Wi-Fi SSID Sniffer
> #!/usr/bin/env python
Yeah.I bet it's even being run on an OS that they didn't write themselves.
$ startxTechnically correct, but highly misleading. Either way, I hope you realize I'm not being snarky here - just wanted to share my point of view on this. OP's article was great, that's a ridiculously powerful library.
ap_list = []
if AP not in ap_list:
ap_list.append(AP)
print AP
It works, but does a linear scan every time. It's better to use a set() in such a case: ap_seen = set()
if AP not in ap_seen:
ap_seen.add(AP)
print AP
For looking up things, a set (essentially a dict without values) is much quicker than a list. Is this premature optimisation? Perhaps, but using a list for this purpose is also a code smell.In this case, I feel that it is not. It's just using the right data set for the job. This is exactly the sort of thing that sets are for.
Let's give Philippe (Scapy's author) the credit he deserves.