> For the complete documentation index, see [llms.txt](https://wiki.smhuda.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://wiki.smhuda.com/pentesting/infrastructure-security/wireless-security/cached-wireless-keys.md).

# Cached Wireless Keys

A Powershell one liner to retrieve all the WiFi passwords stored on a computer:

### Windows:

```
$a = netsh.exe wlan show profiles | Select-String -Pattern ": "; For ($i=1; $i -le $a.length * 2; $i+=2){ $b =  ($a -split "`t" -split ": ")[$i]; $c = netsh.exe wlan show profile name=$b key=clear | Select-String -Pattern "Key Content"; "Network: " + $b + $c}
```
