⬆️ ⬇️

Worldwide database of passwords for Wi-Fi networks on your mobile phone

Those of us who travel a lot probably have found themselves in such a situation more than once: there are many wireless networks in the city to which you came, but they are all with passwords (which you do not know). You do not have a local SIM card, and the Internet in roaming costs like an engine of the plane on which you flew.



But it would be great if at least some of these passwords were known to you. Let's look at exactly how such a system could work.



For simplicity, let's assume that all users of Android phones (or tablets), and all have root access to the device. Naturally, in practice it is worth developing such a system with a view to a wider audience, but since this introduces significant technical complications, let's first consider just such a user category.



So, our user (let's call him Sveta) sits at home and drinks cocoa. Cocoa is warm, the mood is good, everything is fine. But here Sveta remembers that she needs to go to the city for business, and that she will most likely need the Internet, but she does not have mobile Internet. Therefore, she launches an Android application (let's call it hsdb - hotspot database), which carefully informs her that there are 137415 new Wi-Fi networks in the database (with passwords!), And Sveta, of course, clicks on “Refresh” . The program shows her a progress bar and a rough estimate of the time required to update the local database. At the same time, hsdb also displays a message stating that in the file /data/misc/wifi/wpa_supplicant.conf (namely, Android devices write passwords to the wireless networks to which the user connects), new entries appeared, and Sveta clarifies , whether she wants to load them into a common database. Sveta ticks 3 of 4 new entries - she connected to two networks in cafes, she is connected to one (hotel) right now, but the network she did not notice is at her friend's house, and Sveta does not want the password to it was available to anyone who wanted to - and click "Publish". Three selected networks almost instantly appear in the general database (of course, without any information about the Light).

')

A couple more minutes pass, and the database update is complete. Satisfied, Sveta is going to the city, knowing that now she shouldn’t worry so much about the Internet: don’t you need to ask the waiters these absurd questions in the spirit of “Excuse me, please?”, Yes and, let's face it, most likely she will be able to use the Internet on the street (near the same cafes, for example). Sveta simply opens hsdb, and sees a list of those networks to which there is a signal and for which there is a password in the locally stored database.



In principle, in the simplest version - this is quite enough. But if you complicate and implement the connection using hsdb (and not using the standard menu), you can also record the BSSID. Because, firstly, the name of some networks may periodically change, and secondly, the location can be often determined by the BSSID. Yes, and, in principle, you can immediately write down the coordinates - it can be more accurate than checking the BSSID using a public database. In addition, in this case, the need to read /data/misc/wifi/wpa_supplicant.conf disappears, and the application starts to work already everywhere, and not only where there is root access.



Of course, if the database stores information about the physical location of networks, then it is self-evident that it is possible to show a map (with the possibility of pre-caching selected cities), where you can see at any time where there are such networks nearby, the password for which is known.



It would also be helpful if the database (and perhaps even the map) was accessible via the website. To make it convenient to add and view passwords from a computer. And, of course, such a system should have a good open API with high-quality documentation - so that anyone can write an application for any platform.



I would be happy for your comments and ideas. Happy New Year to you, and fewer difficulties in finding wireless networks while traveling.

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



All Articles