Friday 11 January 2013


How to find WiFi user name and password


Question : How to find WiFi user name and password in an android phone

Answer : As Android exposes WiFiManager API to access WiFi related information of the device but few OEM does not bother about securing the information exposed through these API's. So by using couple of lines of code you may find WiFi credentials.

1. Get WiFi manager instance.
WifiManager wifiManager = (WifiManager) getSystemService(Context.WIFI_SERVICE);

2. Get all WiFi configurations.
wifiManager.getConfiguredNetworks();

3. Traverse each WifiConfiguration returned in the above step and look for corresponding credentials.

For e.g. in the case of EAP protocol where EAP method is PEAP i.e. where user's domain credentials are used to connect to office WiFi. You can look for identity and password field and end up getting user's name and password.

POC : This works very well with HTC EVO running android 2.1 and HTC EVO spits out user's name and password. But it does not work with devices running latest android version. So keep exploring...