diff options
author | HarmJ0y <will@harmj0y.net> | 2017-05-20 01:54:55 -0400 |
---|---|---|
committer | HarmJ0y <will@harmj0y.net> | 2017-05-20 01:54:55 -0400 |
commit | d12e1516f872ff32098677ac70bec901136365db (patch) | |
tree | 3e9878c0a4236be818532dc1e1a48b984061d50c /Privesc | |
parent | f8d2a3474bf0e0ca7267944ddc04a83a55ee122c (diff) | |
download | PowerSploit-d12e1516f872ff32098677ac70bec901136365db.tar.gz PowerSploit-d12e1516f872ff32098677ac70bec901136365db.zip |
increased PowerUp error checking
Diffstat (limited to 'Privesc')
-rw-r--r-- | Privesc/PowerUp.ps1 | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/Privesc/PowerUp.ps1 b/Privesc/PowerUp.ps1 index 50f8268..5852904 100644 --- a/Privesc/PowerUp.ps1 +++ b/Privesc/PowerUp.ps1 @@ -875,10 +875,13 @@ a modifiable path. else { # if the path doesn't exist, check if the parent folder allows for modification - $ParentPath = (Split-Path -Path $TempPath -Parent -ErrorAction SilentlyContinue).Trim() - if ($ParentPath -and ($ParentPath -ne '') -and (Test-Path -Path $ParentPath -ErrorAction SilentlyContinue)) { - $CandidatePaths += Resolve-Path -Path $ParentPath -ErrorAction SilentlyContinue | Select-Object -ExpandProperty Path + try { + $ParentPath = (Split-Path -Path $TempPath -Parent -ErrorAction SilentlyContinue).Trim() + if ($ParentPath -and ($ParentPath -ne '') -and (Test-Path -Path $ParentPath -ErrorAction SilentlyContinue)) { + $CandidatePaths += Resolve-Path -Path $ParentPath -ErrorAction SilentlyContinue | Select-Object -ExpandProperty Path + } } + catch {} } } } @@ -5012,5 +5015,4 @@ $Kernel32 = $Types['kernel32'] $NTDll = $Types['ntdll'] Set-Alias Get-CurrentUserTokenGroupSid Get-ProcessTokenGroup -Set-Alias Get-UnquotedService Get-UnquotedService Set-Alias Invoke-AllChecks Invoke-PrivescAudit |