Using python/scapy to detect device names

时间:2015-05-04 19:55:05

标签: python scapy probe

I was writing a python script to detect probe requests and print out device MAC address, manufacturer and SSID being prober for. I now want to add the functionality to discover device name (ex:Gio's Iphone 5) and print it along with the other results.

if p.haslayer(Dot11ProbeReq):                         
        mac = str(p.addr2)
        if p.haslayer(Dot11Elt):                          
            if p.ID == 0: 
                ssid = p.info                            
                if ssid not in clients and ssid != "":
                    clients.append(ssid)          
                    maco = EUI(mac)
                    macf = maco.oui.registration().org    
                    print len(clients),mac+" ("+macf+") <--Probing--> "+ssid
                    f.write (str(len(clients))+" "+mac+" ("+macf+") //"+" <--Probing--> "+ssid+"\n")
                    if mac not in mach:
                        mach.append(mac)
                        uni+=1                            

How would I be able to get device name using python/scapy? I know the networks that the devices are probing for, so I can spoof network name and try to connect and get the device name that way. But this seems too long, is there any other way to do it? maybe craft a packet though scapy to compel the device to divulge details?

Any help is appreciated!

My python version: 2.7.3 (default, Mar 13 2014, 11:03:55) [GCC 4.7.2] My linux version: Distributor ID:Kali Description:Kali GNU/Linux 1.1.0 Release:1.1.0 Codename:moto Linux version 3.18.0-kali3-amd64 gcc version 4.7.2 Debian 4.7.2-5) ) #1 SMP Debian 3.18.6-1~kali2 (2015-03-02)

1 个答案:

答案 0 :(得分:0)

简而言之:您无法获得WiFi的设备名称。设备名称永远不会在802.11帧中发送[请参阅here for good description of the frames]。

但您可以使用蓝牙来获取设备名称,但请注意:蓝牙mac与wifi端的mac地址之间没有通用关联。