scapy sniff doesn't find any devices on VM

249 Views Asked by At

I'm trying to sniff in VM in Ubuntu, using Wifi Adapter Card in Python. The sniffing takes a lot of time, and does not show any available devices. I installed the latest version of SCAPY. the is code below: (in the interface i put the wlan of the adapter card)

def addSSID(pkt):
    if pkt.haslayer(Dot11Beacon):
        bssid = pkt.getlayer(Dot11).addr2
        ssid = pkt.getlayer(Dot11Elt).info
        if bssid not in bssids:
            bssids[bssid] = ssid
            if ssid == '' or pkt.getlayer(Dot11Elt).ID != 0:
                print("Hidden Network Detected")
            print("New network detected! Mac address: %s Name: %s" % (bssid, ssid))


def start(interface):
    print('Start sniffing networks in %s interface' % interface)
    thread = threading.Thread(target=hopper, args=(interface,), name="hopper")
    thread.daemon = True
    thread.start()

    sniff(iface=interface, prn=addSSID)
0

There are 0 best solutions below