Tuesday, 12 April 2011

Android Wifi password locations

The other day, I realised that I had forgotten my WiFi network password back at home.

The easy way to fix this would have been to use an already connected PC to access the router and change the password there, or to use an application like WirelessKeyView to recover the password of the said PC.

If I used method 1, I'd have to give the key to my housemates, which adds a bit of hassle.

When I tried method 2, the PC I was using was running XP I got a hex string which is not very user friendly (XP automatically converts WPA-PSK keys to a 64bit non-(easily?) reversible hash).

I then decided to try to get the key off my (rooted) Desire Z. Easy enough, the passwords are stored in plaintext in the following file:
/data/misc/wifi/wpa_supplicant.conf  

I then wrote a quick application to make the extraction a bit more painless (links at the bottom of the post), but when I was testing it on my Galaxy Tab, I realised that the file was not there. After a bit of digging around, I found the passwords here:
/data/wifi/bcm_supp.conf  

Also, here is the location of the file on the Streakroid ROM (this could be the default for all Dell Streaks, but as I don't have one I can't check):
/data/misc/wifi/wpa.conf  

The formatting of the files is identical and can be found here: http://linux.die.net/man/5/wpa_supplicant.conf, but the location is different (based on the whims of each developer/company I guess).

To access the files, you need root permissions.

Application Links:


If anyone has a device on which the app does not work, do two things:
  1. Make sure you are rooted.
  2. If you are certain you are rooted and it still does not work, email me (my email can be found here: http://aschillings.co.uk/html/contact.html).
I have no way to contact you if you post anonymously in the comments section!

29 comments:

  1. I saw an application that does basically that the other day. It's a little easier to get the passwords that way. You might check it out: https://market.android.com/details?id=com.nevercertain.wifipasswords.pro

    Thanks for the post.

    ReplyDelete
  2. I already wrote one myself:

    https://market.android.com/details?id=aws.apps.wifiKeyRecovery

    And its freeware :)

    ReplyDelete
  3. hey Alex. do you have any download link for desktop and install to my tab directly? i found one in 4shared.com, im not sure if thats what you wrote since i cant open it...password protected.. thanks

    ReplyDelete
  4. Hi,
    unfortunately on my motorola defy the password must be stored somewhere else, any ideas?

    ReplyDelete
  5. Alexandros, good morning.

    What I don't understand is your fear of giving your password to your "mates".
    If you didn't give it to them the first time.....how did they ever log on? And if you gave it to them once, why not again?

    ReplyDelete
  6. Goodmorning!

    You misunderstood.

    There is no fear in giving out the password. My mates had the password because I gave it to them, and I would again if I had to change it.

    The problem is that if I changed the password, I would have to let them know of the change and possibly disrupt their work until they change the password and reconnect.
    As part of said work is unattended and professional (remote desktoping, running simulations, etc.) it is more inconvenient that say, a lost WoW raid.

    Plus, it was more fun to poke around android :)

    ReplyDelete
  7. If anyone has a device on which the app does not work, do two things:

    1. Make sure you are rooted
    2. If you are certain you are rooted, email me (my email can be found here: http://aschillings.co.uk/html/contact.html).

    If you post anonymously, there is not much I can do :)

    ReplyDelete
  8. Hello Alexandros first of, thanks for the wonderful app, it is really helpful when i forgot the passwords and need to share it with others.

    It'll be nice to see an import feature built in into the app to complement the export feature

    thanks again

    ReplyDelete
  9. Hi Alt236,
    Is there a way that we get wifi password without rooting the device ? If yes please specify how ?
    ~S

    ReplyDelete
  10. very nice decent app does what it says it does congrats my friend really good Job!!!

    ReplyDelete
  11. Is there a way that we get wifi password without rooting the device ? If yes please specify how ? thx

    ReplyDelete
  12. No, there is no way to get the keys without rooting because of where the file sits on disk. The location is in a portion of the filesystem where only the root user (read: administrator) has and write permission. If you could just write an app that did that without needing root permission what good would it be in the first place since it would be a big, gaping security hole.

    ReplyDelete
  13. Je resulta ke mi clave aparece encriptada! Alguna idea??

    ReplyDelete
  14. I have read your blog and know the process of how to get Android wi-fi password location ? it is really interesting way to explain it and i understand it easily. Thanks . .

    ReplyDelete
  15. pls give here tutorial video or pictures
    thx

    ReplyDelete
  16. Thanks for this information.... its very useful for android users.

    ReplyDelete
  17. Thanks for this useful application.

    ReplyDelete
  18. Great App, thanks for your work.
    Is there any option to restore the backup txt-file?
    I had a crash and reinstalled my phone. Lucky for me, that I saved days before all my WIFI keys as a txt-file.
    In your app is no restore function, so isn't it possible to get all keys back in this app?

    ReplyDelete
  19. I like your post it is very interesting i would like to visit your website frequently.....

    ReplyDelete
  20. Hi the App worked great. But now with Android 4.3 it is not available in Playstore. Maybe only an setting in the Supported OS?

    ReplyDelete
  21. it doesn't give me the password it gives me something else like numbers & letters too long (MD5)

    ReplyDelete
  22. plz hlep me to fix it using wintouch Q93

    ReplyDelete
  23. Hi the app worked great up until yesterday when i switch phones. On the Samsung I9505 i gives the password in the hash form you described on your introduction.
    I have looked almost everywhere. Is there a way to fix this? P.S. On other devices it works great (Nexus 5, Xperia Ray etc)

    ReplyDelete
  24. A small update. As it seems the issue is not related with the app per se. It has to do with the way some smartphones save the information in the wpa_supplicant.conf in /data/misc/wifi. The passwords are stored encrypted and it seems to be affecting samsung devices that have the 4.3+ android OS. I dont think there is a way to fix this unless maybe changing the way the information are stored :(

    ReplyDelete
  25. This comment has been removed by the author.

    ReplyDelete
  26. A VERY GOOD APP (WifiKeyRecovery) to backup the 40Items in my list- export goes good, BUUUUUT I have install a new ROM how I can IMPORT the list back?? :-)

    ReplyDelete