News for hackers. Stuff that matters.
Re:“Alexa, what is my WiFi password?” by AshamedCaptain on Saturday April 01, 2023 @08:23AM (#35399685)
> When using this tool, it is good practice to hash the password for the wireless network before storing it in the configuration file (encrypt it in a way that cannot be reversed). This can be done with one simple command (wpa_passphrase),

Huh? Anyone who has that hash can still connect to your Wi-Fi network, which kind of defeats what is being claimed. At that point you can also bruteforce the plaintext password (offline, at your leisure), or worse...

Re:“Alexa, what is my WiFi password?” by lxgr on Saturday April 01, 2023 @08:36AM (#35399783)
Exactly, and you can also derive all other devices' pairwise session keys from the password hash as well, i.e. intercept their traffic.

The only thing you can't get from the hash (without reversing it) is the password itself, so if you use the same high-entropy one for a different SSID (but why would you?), it helps a bit in that specific scenario.

Apple has annoyingly decided to share the password hash using the "share Wi-Fi password with nearby devices" at least in some versions, which makes it impossible to actually manually copy-paste over a password received in such a way. I consider that pretty poor security-by-obscurity as well.

If you need your network to be resilient against such attacks, you need WPA-EAP ("enterprise"). PSK was never designed for that threat model. That said, it's a shame WPA-EAP is as complicated to set up and poorly supported by most routers as it is.

Re:“Alexa, what is my WiFi password?” by est31 on Saturday April 01, 2023 @09:54AM (#35400317)
> you can also derive all other devices' pairwise session keys from the password hash as well, i.e. intercept their traffic.

Note that deriving keys in a passive fashion only works with WPA2. With WPA3 SAE you must do an active Man in the Middle attack, which means also that you need to possess the key at the time of the handshake. With WPA2 you can decrypt any historic traffic you have recorded.

Re:“Alexa, what is my WiFi password?” by lostlogin on Saturday April 01, 2023 @02:09PM (#35402502)
> share Wi-Fi password with nearby devices

You dislike this feature? It’s pretty amazing compared to explaining which letters are uppercase and what an ‘&’ is called.

Re:“Alexa, what is my WiFi password?” by johnwalkr on Saturday April 01, 2023 @02:23PM (#35402648)
Apple password sharing is definitely annoying. I mainly use Apple stuff including iCloud for password management. Surprisingly, it even works well enough on chrome for windows. It doesn’t work for the 10 game launchers I’m forced to use, but it’s not a huge inconvenience, I can just grab those from my iPhone. But I cannot grab wifi passwords from my iPhone, that can only done in keychain in MacOS.
Re:“Alexa, what is my WiFi password?” by lxgr on Saturday April 01, 2023 @02:33PM (#35402761)
On iOS 16 (and possibly earlier), it's finally possible to view passwords!

On exception are those originally received via nearby sharing, potentially also those afterwards synced to other devices via Keychain, as the iPhone does not have the preimage to display.

Re:“Alexa, what is my WiFi password?” by johnwalkr on Saturday April 01, 2023 @03:59PM (#35403554)
Oh wow! I’m happy to read that!
Re:“Alexa, what is my WiFi password?” by badkitty99 on Saturday April 01, 2023 @08:35AM (#35399775)
But don't you need the preimage of the hash to generate it in authentication?
Re:“Alexa, what is my WiFi password?” by lxgr on Saturday April 01, 2023 @08:42AM (#35399841)
Not for WPA-PSK. The PSK is used to derive the PMK from (simplified) something like PMK = Hash(PSK, SSID). This key is static and never changes for the lifetime of a particular SSID, and is also shared across all devices in WPA-PSK.

From the PMK, all other per-connection keys are then derived at association time, but everybody that captures that conversation can derive all further keys since that exchange uses only symmetric functions with all secret inputs derived from the PMK, not something like Diffie-Hellman.

It's unfortunately not easy to do anything more resistant against compromised clients without storage on the APs (or at least a stable encryption key available to all access points of an SSID), so WPA-PSK doesn't – for anything more robust than that, you need WPA-EAP. (Some networks support a per-station/MAC address PSK as a proprietary feature, but that's only possible because they do have some management plane that allows the APs to share the required state.)

Re:“Alexa, what is my WiFi password?” by overthrow on Saturday April 01, 2023 @08:42AM (#35399839)
On Linux you can auth using the hash instead of the password. Other OSs probably have something similar.

https://unix.stackexchange.com/questions/40/use-wpa-supplica...

Re:“Alexa, what is my WiFi password?” by lxgr on Saturday April 01, 2023 @08:45AM (#35399864)
Yes, but I suppose GPs question was "is that enough to authenticate?" – and given that as you say Linux and iOS/macOS (for Wi-Fi "password" sharing with nearby devices) do support that, and my other comment, the answer is "yes".
Re:“Alexa, what is my WiFi password?” by _Nat_ on Saturday April 01, 2023 @09:16AM (#35400071)
It wouldn't matter if the preimage of the hash were needed for authentication.

Because, if a device has all of the information needed to connect to a network on it, then.. well, it has all of the information needed to connect to a network on it. Could be passwords, hashes, or whatever -- doesn't really matter.

Re:“Alexa, what is my WiFi password?” by geokon on Saturday April 01, 2023 @08:51AM (#35399901)
I always thought this aspect of Wifi password security was a weird annoyance. It just makes thing inconvenient without providing any real security - and it's leaked into Android and taken to new extremes. For instance you can get and share Wifi with goofy QR codes - but syncing the whole wifi password list between devices? Impossible without rooting your device

They then up the goofyness in that it doesn't provide any mechanism in the UI to actually see the password, but you can screenshot the "share QR" code, read the QR in an app, and finally extract the password phrase that way (at least in all the Android versions I've tried). I have to do this dance regularly b/c scanning a QR code from a laptop is a pain

Loosing all my wifi passwords when I get a new phone always kinda sucks...

Re:“Alexa, what is my WiFi password?” by franga2000 on Saturday April 01, 2023 @09:13AM (#35400049)
You can sync your WiFi passwords....to your Google account. It's a privileged permission, like most fun things on Android these days are, for totally legit and not at all anticompetitive reasons.
Re:“Alexa, what is my WiFi password?” by jeroenhd on Saturday April 01, 2023 @10:41AM (#35400652)
I wanted to write a quick app to switch between VPNs based on which WiFi network I'm connected. The Wireguard app exposes an API for this and many years ago I remember enjoying the broadcast receiver API of Android to react to such general changes. Thought I'd have myself an app in half an afternoon.

Well, it turns out getting the name of the current WiFi network is near impossible. There are four different ways for four different ranges of Android versions, the most recent of which plain doesn't work on my phone.

Somewhere down the line the greedy tracking on mobile apps has gotten so bad that even Google wants to make sure their users know they're being tracked. Without a permanent notification and a permission you can't grant in a popup, you're just not getting the WiFi name.

I completely understand why they changed the API and I'll even agree with the most recent incantation, but the state of mobile app development has become truly deplorabele because of tracking companies and everyone must now suffer the consequences.

Re:“Alexa, what is my WiFi password?” by cma on Saturday April 01, 2023 @11:23AM (#35400992)
At least in the past there was no fine-grained option to backup other things like bookmarks without also giving google all of your wifi passwords:

https://micahflee.com/2013/07/use-android-youre-probably-giv...

The only way was turning on some enterprise mode most home routers don't have, I think because they didn't want to get sued for leaking company passwords.

Re:“Alexa, what is my WiFi password?” by AndriyKunitsyn on Saturday April 01, 2023 @09:17AM (#35400082)
On my Pixel, Android 13, I can see the wifi password in plain text on the QR code screen, below the QR code.
Re:“Alexa, what is my WiFi password?” by crtasm on Saturday April 01, 2023 @06:19PM (#35404707)
I recently discovered that on LineageOS (Android 10), good to know Google does this too.
Re:“Alexa, what is my WiFi password?” by Vogtinator on Sunday April 02, 2023 @05:18AM (#35408662)
Same on my Xperia, which is pretty close to stock Android.
Re:“Alexa, what is my WiFi password?” by lxgr on Saturday April 01, 2023 @09:11AM (#35400044)
Couldn't have said it better.

Apple used to play that security-by-obscurity game too in their implementation of password sharing with nearby devices, and by not allowing users to view passwords in the Wi-Fi settings (even passwords they hand-entered themselves, as if they can't also make a copy of that in a much less secure place at that point). Fortunately, they've come around in the newer iOS versions.

But which Android feature are you referring to? On my Pixel, I can share the PSK as a QR code – not just the hash as far as I can tell.

Re:“Alexa, what is my WiFi password?” by bombolo on Saturday April 01, 2023 @09:21AM (#35400113)
He wants to share it as a string, since humans aren't too well versed into reading qr codes.
Re:“Alexa, what is my WiFi password?” by lxgr on Saturday April 01, 2023 @09:26AM (#35400146)
Huh? The password is displayed right below the QR code, at least on my Pixel. Must be a difference between Android versions or vendor customizations, which is why I asked.
Re:“Alexa, what is my WiFi password?” by tryauuum on Saturday April 01, 2023 @10:13AM (#35400465)
can confirm
Re:“Alexa, what is my WiFi password?” by bombolo on Saturday April 01, 2023 @10:53AM (#35400762)
Not on my phone.
Re:“Alexa, what is my WiFi password?” by lozf on Saturday April 01, 2023 @10:44AM (#35400678)
The `zbar' package (specifically `zbarcam`) makes scanning QR codes easier (especially when you can hold a phone in front of the webcam).
Re:“Alexa, what is my WiFi password?” by Dragon863 on Saturday April 01, 2023 @10:10AM (#35400448)
Sorry about that! I misunderstood how hashing works, and I've updated the page with a correction at the bottom