aboutsummaryrefslogtreecommitdiff
path: root/Recon
diff options
context:
space:
mode:
authorHarmj0y <will@harmj0y.net>2016-03-11 16:37:14 -0500
committerHarmj0y <will@harmj0y.net>2016-03-11 16:37:14 -0500
commitdee094a993642894d4542c6bc8c11864863e4536 (patch)
tree8bc9035aea8daedb13b36771a7e7c398a1c45b95 /Recon
parentdedd805eaaedb17ec438e76825a9f9173e81dcd2 (diff)
downloadPowerSploit-dee094a993642894d4542c6bc8c11864863e4536.tar.gz
PowerSploit-dee094a993642894d4542c6bc8c11864863e4536.zip
Additional error checking in Get-DFSshare
Diffstat (limited to 'Recon')
-rw-r--r--Recon/PowerView.ps119
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'=$_}
+ }
}
}
}