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

Issue with Invoke-DllInjection.ps1 #85

Closed
3gstudent opened this issue Nov 20, 2015 · 2 comments
Closed

Issue with Invoke-DllInjection.ps1 #85

3gstudent opened this issue Nov 20, 2015 · 2 comments

Comments

@3gstudent
Copy link

https://github.com/PowerShellMafia/PowerSploit/blob/master/CodeExecution/Invoke-DllInjection.ps1

$Proc = Get-Process notepad
Invoke-DllInjection -ProcessId $Proc.Id -Dll DemoDLL.dll

When I use the above command to inject DemoDLL.dll into the running process notepad.exe on Windows8 x64
it occurs
PE file was not compiled for x86.

I think Line284 should be
if ($Architecture -eq 'X86')
and it will solve the probmlem:)

@PowerShellMafia
Copy link
Collaborator

In 64-bit Windows 8, that line shouldn't even execute. Run the following and tell me what you get:

(Get-WmiObject Win32_OperatingSystem).OSArchitecture

If that returns '64-bit' then line 284 cannot execute.

For reference, the check in line 284 is designed to throw an error if you're trying to inject a non 32-bit dll into a process on a 32-bit operating system. Your suggested change is illogical.

@PowerShellMafia
Copy link
Collaborator

I'm going to close but if you run into any issues, please open a new issue.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant