Check for a hidden Wi-Fi network

In the application that I am trying to create, I want to check for the presence of a hidden WiFi SSID. Unfortunately, networks with hidden SSIDs are not displayed in the scan, so I can not wait for the scan results returned through WifiManager.SCAN_RESULTS_AVAILABLE_ACTION .

I tried using android.net.wifi.WifiManager.enableNetwork(int netId, boolean disableOthers) after creating a WifiConfig for the network, believing that it will return true if the network can be connected and false otherwise, but it almost always returns true even in cases where I create a WifiConfigs tattoo.

I just need to check if the hidden network is broadcasting or not. I know all his information, including SSID.

+4
source share
1 answer

SSID hidden networks are well hidden. Therefore, they do not transmit their SSID. To check the availability of a hidden network, you should try to connect to the network. If it succeeds, it is there, otherwise not. The second option is to sniff traffic on the network in monitoring mode and look for the corresponding BSSID. This requires root, as well as some kind of tool or application that allows you to do this. The first option will always work, but you are active. The second allows passively checking networks, but requires root.

+1
source

Source: https://habr.com/ru/post/1497053/


All Articles