简体   繁体   中英

Scan WiFi MAC addresses of mobile phones from java application

My application (not mobile application) needs to scan WiFi MAC addresses of mobile phones that are in my range.

For now I can only test it with my laptop. So I would like to connect my wireless card in laptop with my java application so application could scan for addresses. In near future, I will connect my application with different WiFi detector.

My WiFi card is Intel(R) PRO/Wireless 3945ABG Network Connection

Stackoverflow and google only shows results for android mobile development.

What API can you recommend?

This is tricky and maybe impossible, depending on precisely what you want - feel free to view this as a list of warnings or starting points, depending on how brave you feel :)

  • to obtain MAC addresses you need to capture raw packets, which isn't possible using pure Java; you'll need to use something like jNetPcap which wraps the (native) libpcap packet sniffing library
  • to determine whether a MAC address is likely to belong to a mobile phone, you'll need the list of Organizationally Unique Identifiers which links the first three bytes of a MAC address with the device manufacturer; mind that the OUI list might not be sufficient, since Apple (for instance) makes phones and other devices
  • to see all wireless traffic you'll need a driver that supports putting the wifi interface into monitor mode - these don't exist for all platforms/devices
  • the devices may not be sending any data...

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM