Jump to content

EP. 2101 - im.ps1 error


ohbh

Recommended Posts

So I tried doing everything that is mentioned in Hak5's episode 2101, but when it goes to execute the .ps1 file, there is an error in the cmd prompt which says: 

 

Specified cast is not valid.
At line:2179 char:7
+         if (($PEInfo.DllCharacteristics -band $Win32Constants.IMAGE_D ...
+             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : OperationStopped: (:) [], InvalidCastException
    + FullyQualifiedErrorId : System.InvalidCastException

 

 

When I look at the .ps1 file through my web server, the error seems to be somewhere here: 

 

 

[IntPtr]$LoadAddr = [IntPtr]::Zero
		if (($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
		}
Link to comment
Share on other sites

1 hour ago, ohbh said:

So I tried doing everything that is mentioned in Hak5's episode 2101, but when it goes to execute the .ps1 file, there is an error in the cmd prompt which says: 

 

Specified cast is not valid.
At line:2179 char:7
+         if (($PEInfo.DllCharacteristics -band $Win32Constants.IMAGE_D ...
+             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : OperationStopped: (:) [], InvalidCastException
    + FullyQualifiedErrorId : System.InvalidCastException

 

 

When I look at the .ps1 file through my web server, the error seems to be somewhere here: 

 

 


[IntPtr]$LoadAddr = [IntPtr]::Zero
		if (($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
		}

Also, i'm using Windows 10

 

Link to comment
Share on other sites

1 hour ago, ohbh said:

So I tried doing everything that is mentioned in Hak5's episode 2101, but when it goes to execute the .ps1 file, there is an error in the cmd prompt which says: 

 

Specified cast is not valid.
At line:2179 char:7
+         if (($PEInfo.DllCharacteristics -band $Win32Constants.IMAGE_D ...
+             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : OperationStopped: (:) [], InvalidCastException
    + FullyQualifiedErrorId : System.InvalidCastException

 

 

When I look at the .ps1 file through my web server, the error seems to be somewhere here: 

 

 


[IntPtr]$LoadAddr = [IntPtr]::Zero
		if (($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
		}

Also, i'm using Windows 10

Also, instead of using Windows 7 like the Episode 2101, i'm using Windows 10

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...