30

I have an Android phone which is connected to a secured Wi-Fi hotspot. How can I find out the password of the hotspot from the phone?

1

3 Answers 3

14

On my phone, the credentials are stored in /data/wifi/bcm_supp.conf. You'll probably need root to see it directly on your phone but you may be able to use adb pull (requires the Android SDK) from your PC to get the file.

As noted in the comments, the location may vary based on your ROM or device (specifically the Wi-Fi chip; mine's a Broadcom). Check /data/wifi/, /data/etc/wifi/ and /data/misc/wifi/ for relevant config files if you don't find the ones suggested by eldarerathis or me.

2
  • 3
    Hm, interesting. What type of phone are you using ATM? I don't have that file, but I was just about to post an answer saying to look for /data/misc/wifi/wpa_supplicant.conf. Maybe WPA Supplicant is just a CyanogenMod thing... Apr 2, 2012 at 18:41
  • The name and location of the file vary per device, but it should be either one or the other.
    – oxr463
    Sep 11, 2019 at 12:19
9

On CyanogenMod devices, and possibly other AOSP ROMs, you should be able to grab it from the /data/misc/wifi/wpa_supplicant.conf file. On a non-rooted device I don't think this is possible since you won't have permission to read the /data directories where the settings are stored and the Settings menu simply displays (Unchanged) if you go into the network configuration.

This is what I see on my CM7 EVO (network name and password redacted):

# cd /data/misc/wifi/
# ls
sockets              wpa_supplicant.conf
# more wpa_supplicant.conf
ctrl_interface=eth0
update_config=1

network={
        ssid="SomeWifiNetwork"
        psk="MyPlaintextPassword"
        key_mgmt=WPA-PSK
        priority=1
}
#
3
  • My phone is rooted. I have 'superuser' app installed. But how can I get 'adb shell' with root accessed. I tried '$ adb shell shell@android:/ $ su Permission denied 1|shell@android:/ $ cd /data shell@android:/data $ ls opendir failed, Permission denied 255|shell@android:/data $ su Permission denied 1|shell@android:/data $
    – michael
    Apr 2, 2012 at 20:34
  • 1
    Ah, this is actually a new setting in CyanogenMod. You'll need to use su to get a root shell, but first check in Settings->Developer Options (your phone's main settings) to see what the "Root Access" setting is. By default it is "Apps only". You'll need to switch it to "Apps and ADB" in order for su to work from the shell. Apr 2, 2012 at 21:08
  • @michael I always do adb root followed by adb shell.
    – ott--
    Dec 1, 2012 at 17:41
5

In Android Oreo and Pie (tested on OnePlus 6), the file seems to be /data/misc/wifi/WifiConfigStore.xml which stores your Wi-Fi credentials. I do not know of a good XML parser, but the file can be opened in a text editor (requires root access). Search with the name of your Wifi (SSID) and locate the line containing:

<string name="SSID">&quot;YOUR_SAVED_SSID;</string>

One of the following lines would show the password. It would be mentioned as "PreSharedKey". Example:

<string name="PreSharedKey">&quot;SAVED_PASSWORD;</string>
3
  • This PreSharedKey doesn't seem to contain plain-text version of the password on Android 8
    – Ruslan
    Jan 9, 2020 at 9:57
  • @Ruslan your OEM might have kept it encrypted. Samsung especially is known to do it. Mine is not encrypted.
    – Firelord
    Jan 9, 2020 at 11:25
  • For me it worked. Thanks.
    – dentex
    Jul 11, 2022 at 18:52

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .