diff options
author | Harmj0y <will@harmj0y.net> | 2016-03-11 16:37:14 -0500 |
---|---|---|
committer | Harmj0y <will@harmj0y.net> | 2016-03-11 16:37:14 -0500 |
commit | dee094a993642894d4542c6bc8c11864863e4536 (patch) | |
tree | 8bc9035aea8daedb13b36771a7e7c398a1c45b95 /Recon/PowerView.ps1 | |
parent | dedd805eaaedb17ec438e76825a9f9173e81dcd2 (diff) | |
download | PowerSploit-dee094a993642894d4542c6bc8c11864863e4536.tar.gz PowerSploit-dee094a993642894d4542c6bc8c11864863e4536.zip |
Additional error checking in Get-DFSshare
Diffstat (limited to 'Recon/PowerView.ps1')
-rw-r--r-- | Recon/PowerView.ps1 | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/Recon/PowerView.ps1 b/Recon/PowerView.ps1 index 5823d18..5f9cc73 100644 --- a/Recon/PowerView.ps1 +++ b/Recon/PowerView.ps1 @@ -5394,15 +5394,16 @@ function Get-DFSshare { } } - $redirects = Parse-Pkt $pkt[0] - $redirects | ForEach-Object { - # If a folder doesn't have a redirection it will - # have a target like - # \\null\TestNameSpace\folder\.DFSFolderLink so we - # do actually want to match on "null" rather than - # $null - if ($_ -ne "null") { - New-Object -TypeName PSObject -Property @{'Name'=$Properties.name[0];'RemoteServerName'=$_} + if($pkt -and $pkt[0]) { + Parse-Pkt $pkt[0] | ForEach-Object { + # If a folder doesn't have a redirection it will + # have a target like + # \\null\TestNameSpace\folder\.DFSFolderLink so we + # do actually want to match on "null" rather than + # $null + if ($_ -ne "null") { + New-Object -TypeName PSObject -Property @{'Name'=$Properties.name[0];'RemoteServerName'=$_} + } } } } |