1

How to get saved WiFi password from my android 5.1.1 without rooting?

I checked the path /data/misc/wifi/ using adb pull from terminal, but it's empty

4

You can't get the passwords without root access because shell (adb) is not privileged to access the file containing those passwords. As you would know, the file wpa_supplicant.conf contains all the saved Wi-Fi passwords. In order to even ascertain the existence of that file, you must have read or executable permission until wifi directory. It just happened that the permissions on that directory is drwxrwx---, is owned by user wifi and group wifi. Executing id tells us that shell is not part of wifi group, so it ultimately would be considered others. As you can see, the permissions for others are blank --- i.e. no read/write/execute permission is available, hence, you can't enter that directory, let alone copy a particular file residing inside it.

Root the device if you want that file badly.

Related reading: File permissions and attributes

1

Reading memorized wifi passwords by device is only possible if you have a rooted device. There are two methods to do it.
1)You can do it manually by pulling file wpa_supplicant.conf Or
2)By simply using applications like wifi password by farproc on play store. Install app, grant root permission and it will automatically show you all saved wifi passwords.

1

I have to say I am surprised that the answer to this is hidden so well on the internet.

It is a myth that retrieving the WiFi passwords from an unrooted device is impossible.

Prerequisites:

  • developer mode activated on android device
  • USB debugging (in activated developer options)
  • USB data cable
  • adb (on host computer)
  • java (on host computer)
  • an archiver such as winzip or 7zip (can be skipped on Unix systems)

These prerequisites may differ depending on operating system. android version and manufacturer. Answers on how to prepare these on your specific platform can be easily obtained with a search on your favourite search engine. Keep in mind that a USB cable that is good for charging your phone not necessarily provides a data connection. Use the cable that came with your phone if in doubt.

Steps:

  1. Connect your phone to the host computer using the USB data cable
  2. Backup your WiFi passwords with adb (from command line).

    adb backup com.android.providers.settings
    
  3. Enter a password for the file on your phone. The resulting file will be named "backup.ab" and appear in the directory where you executed adb.

  4. Download and install Android Backup Extractor.

  5. Convert the backup file into a TAR archive using the password that you entered earlier:

    java -jar abe.jar unpack backup.ab backup.tar *password*
    
  6. The archive will contain a file called "flattened-data". This file contains all networks that are saved on your phone. The psk entries are the passwords.

Notes: It may be easier to move the backup file into the same directory as abe.jar before converting it. Tested on Android 7 and Ubuntu, adb version 1.0.36, android-backup-extractor v20180521. If adb doesn't work, make sure you device is found using adb devices. On the same device, I tried to access the passwords directly using adb pull which didn't work (as was expected).

  • On which device did you test this? – Firelord Oct 16 at 11:05
  • 1
    @Firelord That would have been an LG G5 (H860N). I think the reason of doing so was to access a stored wifi password to use it on a laptop or it was to access a mifi-device that didn't have a reset button, probably the latter. – life-on-mars Oct 19 at 11:37
-1

@Firelord is right but there's a file browser for Android that doesn't require root for some IO operations, and looking from the path for the saved passwords it should have full rights. It's called XPlorer, hope this helps

  • "looking from the path for the saved passwords it should have full rights." -- I take it as you've not verified your own answer. Please verify it because the app shouldn't be able to access the file or last-level directory per my answer. Hope this helps. – Firelord Jan 24 '16 at 16:06
  • @Firelord works perfectly fine on my nexus testing phone on CyanogenMod 10 and my San Francisco phone on Lollipop. – TechnicalTophat Jan 24 '16 at 16:31
  • I see. Can you verify that the permissions I explained in my answer for the relevant file and directory are the same in your devices? Furthermore, have you verified that the app in both CM10 and San Francisco phone doesn't have root access? – Firelord Jan 24 '16 at 16:57
  • @Firelord Yup they are, and my CM12 phone has root access, but my SF phone doesn't (I keep a vanilla android phone for testing too) – TechnicalTophat Jan 24 '16 at 16:59
  • 1
    I tried the app you mentioned on Nexus 5, Android 6 (stock, rooted), but I couldn't even access /data folder; it gave "permission denied". Could you clarify which location you get the saved passwords, and possibly also the permission? – Andrew T. Jan 24 '16 at 17:41

Not the answer you're looking for? Browse other questions tagged or ask your own question.