Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fails to inject notepad.exe into calc.exe on x64 #7

Open
abdullah2993 opened this issue Feb 5, 2019 · 3 comments
Open

Fails to inject notepad.exe into calc.exe on x64 #7

abdullah2993 opened this issue Feb 5, 2019 · 3 comments
Labels

Comments

@abdullah2993
Copy link

abdullah2993 commented Feb 5, 2019

I haven't tried it on x86 but currently on x64 it is unable to inject notepad.exe into calc.exe other combinations works as shown

Payload Target Success
Calc.exe Calc.exe Sucess
Calc.exe notepad.exe Fails
notepad.exe Calc.exe Sucess
notepad.exe notepad.exe Sucess

I have the same problem with my implementation and i'm unable to find the reason for it

@soipray
Copy link

soipray commented Apr 1, 2019

i have some problem too.
x64 sometime works bad.
but you can run x86 pe in x64 process.

@arizvisa
Copy link

arizvisa commented Jan 3, 2022

I haven't tried it on x86 but currently on x64 it is unable to inject notepad.exe into calc.exe other combinations works as shown
Payload Target Success
Calc.exe Calc.exe Sucess
Calc.exe notepad.exe Fails
notepad.exe Calc.exe Sucess
notepad.exe notepad.exe Sucess

I have the same problem with my implementation and i'm unable to find the reason for it

not exactly sure what your issue is _specifically_, but if you're using suspendthread/setthreadcontext/resumethread on a process with a gui thread (as-if you're trying to steal a timeslice from a thread that doesn't belong to you and has other resources attached to it). keep in mind that messages can be queued to the thread prior to it executing your actual context. there's a comment at the end of https://zerosum0x0.blogspot.com/2017/07/threadcontinue-reflective-injection.html with a link which describes what I encountered back then while writing similar toys.

one way to test is to first verify if it works on both a non-gui and non-console process, and then once that's confirmed see if delivering various types of window messages (mouse will work) influences the stability or leaves any "droppings" below your target's stack pointer. you can try setting the program counter pointing at an empty loop or a breakpoint.

(also if you're linking other libraries into the address space, keep in mind that your export directory can contain a forward if its rva points within the directory)

@hasherezade
Copy link
Owner

hasherezade commented Aug 12, 2022

if you have problems with running a manually loaded instance of notepad it may be related to the properties of notepad itself (rather than any issue with the loader) more about it in this thread: #44

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

No branches or pull requests

4 participants