TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Wi-Fi SSID Sniffer in 10 Lines of Python

71 pointsby infoseckidabout 12 years ago

4 comments

Luytabout 12 years ago
He's using the incorrect datatype for ap_list. This is apprently the collection of AP's already seen, and used with this pattern:<p><pre><code> ap_list = [] if AP not in ap_list: ap_list.append(AP) print AP </code></pre> It works, but does a linear scan every time. It's better to use a set() in such a case:<p><pre><code> ap_seen = set() if AP not in ap_seen: ap_seen.add(AP) print AP </code></pre> 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.
评论 #5472229 未加载
评论 #5481233 未加载
adlpzabout 12 years ago
&#62; A 10 Line Wi-Fi SSID Sniffer<p>&#62; from scapy.all import *<p>Yeah.
评论 #5472076 未加载
评论 #5472101 未加载
tzuryabout 12 years ago
Should be WiFi SSID Sniffer in 10 lines of Scapy.<p>Let's give Philippe (Scapy's author) the credit he deserves.
h43zabout 12 years ago
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.