diff options
author | b33f <ru.boonen@gmail.com> | 2017-07-17 21:26:04 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-07-17 21:26:04 +0100 |
commit | b895866c3b5d6a879180ae3db3019de5c258e050 (patch) | |
tree | 6b92887d3422fa9f81c494ddcf26dc53bd6fa0bc | |
parent | 872f711e3de9cc5243431a29741c433fdadcaa8c (diff) | |
download | PowerSploit-b895866c3b5d6a879180ae3db3019de5c258e050.tar.gz PowerSploit-b895866c3b5d6a879180ae3db3019de5c258e050.zip |
+ Invalid Cast Fix
This is a fix for https://github.com/PowerShellMafia/PowerSploit/issues/151
-rw-r--r-- | Exfiltration/Invoke-CredentialInjection.ps1 | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Exfiltration/Invoke-CredentialInjection.ps1 b/Exfiltration/Invoke-CredentialInjection.ps1 index d6f3c4c..818e551 100644 --- a/Exfiltration/Invoke-CredentialInjection.ps1 +++ b/Exfiltration/Invoke-CredentialInjection.ps1 @@ -2416,7 +2416,7 @@ function Invoke-CredentialInjection $PEInfo = Get-PEBasicInfo -PEBytes $PEBytes -Win32Types $Win32Types $OriginalImageBase = $PEInfo.OriginalImageBase $NXCompatible = $true - if (($PEInfo.DllCharacteristics -band $Win32Constants.IMAGE_DLLCHARACTERISTICS_NX_COMPAT) -ne $Win32Constants.IMAGE_DLLCHARACTERISTICS_NX_COMPAT) + if (([Int] $PEInfo.DllCharacteristics -band $Win32Constants.IMAGE_DLLCHARACTERISTICS_NX_COMPAT) -ne $Win32Constants.IMAGE_DLLCHARACTERISTICS_NX_COMPAT) { Write-Warning "PE is not compatible with DEP, might cause issues" -WarningAction Continue $NXCompatible = $false @@ -2474,7 +2474,7 @@ function Invoke-CredentialInjection Write-Verbose "Allocating memory for the PE and write its headers to memory" [IntPtr]$LoadAddr = [IntPtr]::Zero - if (($PEInfo.DllCharacteristics -band $Win32Constants.IMAGE_DLLCHARACTERISTICS_DYNAMIC_BASE) -ne $Win32Constants.IMAGE_DLLCHARACTERISTICS_DYNAMIC_BASE) + if (([Int] $PEInfo.DllCharacteristics -band $Win32Constants.IMAGE_DLLCHARACTERISTICS_DYNAMIC_BASE) -ne $Win32Constants.IMAGE_DLLCHARACTERISTICS_DYNAMIC_BASE) { Write-Warning "PE file being reflectively loaded is not ASLR compatible. If the loading fails, try restarting PowerShell and trying again" -WarningAction Continue [IntPtr]$LoadAddr = $OriginalImageBase |