PyInjector - Inject python-code into any python process or spawn interactive python-shell inside the target process. Based on PyInjector by @call-042PE
-
Find out what platform uses the target process (where you will inject your python code or in which context you want to spawn shell).
You can find out it by checking "Platform" column in the task manager.
Then select the correct version of the PyInjector:- on 64-bit platform
- PyInjector_x64.dll to inject you own python code
- PyInjector_x64_shell.dll to spawn shell in the context of the target process
- on 32-bit platform
- PyInjector_x86.dll to inject you own python code
- PyInjector_x86_shell.dll to spawn shell in the context of the target process
- on ARM64 platform
- PyInjector_arm.dll to inject you own python code
- PyInjector_arm_shell.dll to spawn shell in the context of the target process
- on 64-bit platform
-
If you want to inject your own custom python code, write it into a file called code.py and place it in the same folder where PyInjector DLLs are located or in the current folder of the target app.
-
Inject PyInjector DLL into the target process by using:
- Injector (Download)
- System Informer (Download)
- Process Hacker (Download)
- or any other DLL injection tool
This project is made for reverse-engineer and malware analyst, the main aspect of this project is to reverse-engineer any python script/executable easily.
I put some usefull script in the py-code-examples/ folder that can be used to reverse-engineer any script (even with pyarmor).
You have prepared your own code.py and placed it in the same folder where PyInjector DLLs are located or in the current folder of the target app?
Perfect! Now just inject (load) PyInjector_x64.dll in the target process and and code.py will be executed.
Reminder: if the target process have no console window, do not try to print something on the screen, you will see nothing. Just open the file and write output there.
Spawning interactive python shell in the any python process is easy - just inject PyInjector_x64_shell.dll / PyInjector_x86_shell.dll DLL in the target process. It should be enough to see interactive console window with python shell.
You can spawn interactive python shell even in GUI applications.
Requirements:
- OS: Windows 7 or later.
- Target process must use Python3 (any version)
In this video @call-042PE is unpacking a function in a pyarmor protected script with PyInjector.