How to capture probe request data or probe response data sent from wireless router

StackOverflow https://stackoverflow.com/questions/21120072

  •  28-09-2022
  •  | 
  •  

Question

I have a tplink-wr703n wireless router with OpenWrt.

I know I can capture all kinds of data when the adapter is in monitor mode.

I want to the adapter work in master mode, and I also want to capture probe request data sent from client or probe response data sent from my router.

I have tried to use libpcap to capture data, but I failed.

Can you tell me how I can get that data?

Était-ce utile?

La solution

You can set up several modes on one radio card simultaneously.

Using the "iw" command you should be able to create a secondary wifi device interface with type monitor, I guess you could read all frame types from this one.

See http://wireless.kernel.org/en/users/Documentation/iw/vif/

Autres conseils

I am also trying to prepare a scapy script to capture probe request only. there is an Indian guy who made this nice video:https://www.youtube.com/watch?v=Z1MbpIkzQjU

His script seems to work in his enviroment but for some reason I cant get this to work for me.

I will appreciate your assistance.

The script is:

#!/usr/bin/python

import sys
from scapy.all import *

clientprobes = set()

def PacketHandler(pkt):

    if pkt.haslayer(Dot11ProbeReq):

       if len(pkt.info) > 0:
          testcase = pkt.addr2 + '_ _ _' + pkt.info
          if testcase not in clientprobes:
            clientprobes.add(testcase)
            print "New Probe Found: " + pkt.addr2 + ' ' + pkt.info

            print "\n-----------Client Probes Table-------------\n"
            counter = 1
            for probe in clientprobes:
                [client, ssid] = probe.split('---')
                print counter, client, ssid
                counter = counter + 1
            print "\n--------------------------------------------\n"

sniff(iface = sys.argv[1], count = int(sys.argv[2]), prn = PacketHandler)
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top