Python扫描WiFi

Luc*_*lio 3 python sniffer scapy wifi python-3.5

我正在搜索可以扫描WiFi网络并打印所有SSID的程序.我尝试用scapy,但我失败了.我正在使用pyCharm编辑器.

我试过这段代码:

from scapy.all import *
from scapy.layers.dot11 import Dot11

def packet_handler(pkt):        
    if pkt.haslayer(Dot11) and pkt.type == 2:        
        print(pkt.show())
scapy.sniff(iface="mon0", prn=packet_handler)
Run Code Online (Sandbox Code Playgroud)

Jug*_*aut 6

pip install wifi然后尝试扫描使用

from wifi import Cell, Scheme
Cell.all('wlan0')
Run Code Online (Sandbox Code Playgroud)

这将返回Cell对象的列表.在引擎盖下,这称为iwlist扫描并解析不友好的输出.每个单元对象应具有以下属性:ssid,signal,quality等.并用于连接使用

cell = Cell.all('wlan0')[0]
scheme = Scheme.for_cell('wlan0', 'home', cell, passkey)
scheme.save()
scheme.activate()

scheme = Scheme.find('wlan0', 'home')
scheme.activate()
Run Code Online (Sandbox Code Playgroud)

欲了解更多信息,请转到https://wifi.readthedocs.io/en/latest/

  • 简要说明-此python库仅适用于Linux系统 (3认同)
  • @NikhilBaliga 那么我们其他人会怎么做? (2认同)