The app also crowdsources login credentials, so when one user logs into a
hotspot, his or her credentials are added to the database so that everyone
else on the app can also use that hotspot. Users cannot actually view these
credentials so as to protect user data.
As a small-time reverser I can tell you, even without having heard of this program before now, that it is insecure.
The rule of thumb: If it runs on the client's device or if the client can read it then it can be cracked, inspected, seen, analyzed and decoded. There is nothing you can do to protect code/data you send to the client's device (for long).
The client isn't the problem, since you could push custom code to read the wifi key yourself. The problem is that the server will have everyone's Wifi keys.
The problem isn't in reading, but using the wifi key. The app promises to keep the wifi keys secret from other users:
> "... credentials are added to the database so that everyone else on the app can also use that hotspot. Users cannot actually view these credentials so as to protect user data."
But if a client app can download the wifi key from the server and use it to log in, then a modified client app could also download all wifi keys and show them to the user.
There is no practical way for the server to distinguish the original client app from a modified one as long as the user is in control of the hardware and OS it runs on.
Oh, I see what you mean now, I thought they meant secret on the server. Yeah, obviously they can be read if they go to the device, and verroq on the other thread looks like he found out how to decrypt the keys in the local cache.
This from the ap8.db from the Android download. I didn't want to install this piece of shit on a real phone, the source does update and get a newer version.
They change depending on the auth type (WEP vs WPA vs WPA2-PSK vs WPA2-Enterprise). It'll be a day or two before someone manages to decrypt the DB. I'd have a crack at it if I had more time.
Anyways, it is 128 bit CBC. I incorrectly assumed 256 bit because I forgot the hex representation of a char is twice the length. Since they don't have a padding block, the shortest possible output is one block. Thus 16 bytes or a hex string of 32 characters in length.
Jesus Christ that's incompetent. I see what you mean, it's 32 hex chars, not binary chars. Since we have the IV and key, we can just decrypt all the passwords.
Insecure, and I assume that sharing user-specific login credentials is usually against the Wifi-provider's TOS and grounds for termination
Sustained abuse (or sharing) should be simple to detect for a service provider with a network that has multiple, widely-distributed hotspots. In other cases, seeing many different MAC addresses use the same login credentials might be a way to detect abuse, though the MAC might not be sent to the ISP by standard access point firmware.
While it seems (based on other comments) that the product mentioned here doesn't do that, if the phone has an alternative link (e.g. GPRS / 3G / 4G) data link to the server that stores the credentials, it would be possible to make this more secure.
For example, suppose Alice wants to connect to Bob's 802.11g wifi hotspot using 802.11i-2004 (WPA2) authentication in PSK mode. Charlie and Bob have the password; neither want to give it to Alice, but Charlie wants to facilitate Alice to access Bob's system. The first step of the normal WPA2-PSK process is to take the password and generate the Pairwise Master Key (PMK) by putting the password through a key derivation function (PBKDF2-SHA1). However, the PMK is essentially just a stretched version of the password - so we will assume Charlie also doesn't want to share that. To continue with the connection, Alice needs to compute the same Pairwise Transient Key (PTK) as Bob. The PTK is a hash function computed from the PMK, Alice's random nonce, Bob's random nonce, Alice's MAC address, and Bob's MAC address. Alice could send the latter four pieces of information to Charlie over the existing link, then Charlie could send the computed PTK back to Alice, allowing Alice to make the 802.11g connection without revealing the PMK or password to Alice.
A similar way of transferring enough information to allow the connection to continue is likely possible for other authentication modes like the various 802.11X options.
Of course, implementing this would probably require, at least, a rooted phone (for example, to replace the stock wpa_supplicant on Android).
Also, the server would need to store the password or PMK itself (either in plaintext or encrypted with a key that is kept available at all times to process incoming requests), so it would have a huge database of credentials that could be compromised.