Can you inject / exe code into a process using python?

I have seen several sites talking about how to enter DLLs (for example, http://www.codeproject.com/KB/DLL/DLL_Injection_tutorial.aspx ), but I'm struggling with how to get the EXE to work. Any help / advice would be appreciated.

The best way to find out how to explain this is with RunPE, where you execute exe in memory. Does it help at all?

+3
source share
4 answers

If you are asking how to inject code into a running Python process, then you want to https://fedorahosted.org/pyrasite/ .

+2
source

Reflective DLL Injector, . Metasploit -. AFAIK DLL, MS "" , .

, , .

, Python Python - win32.

+1

What you're talking about is re-deploying UPX in python with lots of stuff. What you need to do to do this: Change all VirtualAlloc calls to VirtualAllocEx calls. Change all Loadlibrary calls to loadlibraryEX calls. Implement move fixes.

The best approach would probably be to configure UPX to output the DLL instead of the executable. Then using some python dll injection code to transfer it to another process. You will work a lot with CTypes if you want to do this. Fair warning ...

0
source

All Articles