

Wi-Fi SSID Sniffer in 10 Lines of Python - infoseckid
http://hackoftheday.securitytube.net/2013/03/wi-fi-sniffer-in-10-lines-of-python.html

======
Luyt
He's using the incorrect datatype for ap_list. This is apprently the
collection of AP's already seen, and used with this pattern:

    
    
      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.

~~~
infoseckid
Nice catch! This may be required as we are comparing against every beacon
frame and one could have a large number of them over the air at any time.

------
tzury
Should be WiFi SSID Sniffer in 10 lines of Scapy.

Let's give Philippe (Scapy's author) the credit he deserves.

------
h43z
Is there a problem/drawback with "iw phy phy0 interface add mon0 type monitor"
besides using the airmon tool to create a monitor interface? It works nicely
with the iw command.

------
adlpz
> A 10 Line Wi-Fi SSID Sniffer

> from scapy.all import *

Yeah.

~~~
switch007

      > 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.

~~~
sergiotapia
I kind of agree with @adlpz on this. It's like saying, "Serve a website with 1
line of code!" and then running `sudo service apache start`.

Technically 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.

~~~
mseebach
Meh. Strictly speaking you are correct, but deconstructing it, it means that
we can never say anything is easy (N lines of codes for small N's being
synonymous with 'easy'). Yes, it's actually bloody easy to serve a website,
and that's a good thing, and if someone didn't know it was possible, it's been
helpful to write that 'tutorial'.

All members of the "Do X in N lines or M minutes" meme are examples of
stringing together one or more powerful libraries.

