Skip to content
This repository was archived by the owner on Jan 21, 2021. It is now read-only.

Commit b895866

Browse files
+ Invalid Cast Fix
This is a fix for #151
1 parent 872f711 commit b895866

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Exfiltration/Invoke-CredentialInjection.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2416,7 +2416,7 @@ function Invoke-CredentialInjection
24162416
$PEInfo = Get-PEBasicInfo -PEBytes $PEBytes -Win32Types $Win32Types
24172417
$OriginalImageBase = $PEInfo.OriginalImageBase
24182418
$NXCompatible = $true
2419-
if (($PEInfo.DllCharacteristics -band $Win32Constants.IMAGE_DLLCHARACTERISTICS_NX_COMPAT) -ne $Win32Constants.IMAGE_DLLCHARACTERISTICS_NX_COMPAT)
2419+
if (([Int] $PEInfo.DllCharacteristics -band $Win32Constants.IMAGE_DLLCHARACTERISTICS_NX_COMPAT) -ne $Win32Constants.IMAGE_DLLCHARACTERISTICS_NX_COMPAT)
24202420
{
24212421
Write-Warning "PE is not compatible with DEP, might cause issues" -WarningAction Continue
24222422
$NXCompatible = $false
@@ -2474,7 +2474,7 @@ function Invoke-CredentialInjection
24742474
Write-Verbose "Allocating memory for the PE and write its headers to memory"
24752475

24762476
[IntPtr]$LoadAddr = [IntPtr]::Zero
2477-
if (($PEInfo.DllCharacteristics -band $Win32Constants.IMAGE_DLLCHARACTERISTICS_DYNAMIC_BASE) -ne $Win32Constants.IMAGE_DLLCHARACTERISTICS_DYNAMIC_BASE)
2477+
if (([Int] $PEInfo.DllCharacteristics -band $Win32Constants.IMAGE_DLLCHARACTERISTICS_DYNAMIC_BASE) -ne $Win32Constants.IMAGE_DLLCHARACTERISTICS_DYNAMIC_BASE)
24782478
{
24792479
Write-Warning "PE file being reflectively loaded is not ASLR compatible. If the loading fails, try restarting PowerShell and trying again" -WarningAction Continue
24802480
[IntPtr]$LoadAddr = $OriginalImageBase

0 commit comments

Comments
 (0)