Skip to content

Commit 82f75f1

Browse files
committed
REpo Structure
Made a Huge changes. Especially at DLL Section
1 parent 42aa2c4 commit 82f75f1

File tree

24 files changed

+1741
-254
lines changed

24 files changed

+1741
-254
lines changed

DLL_Injector/Cargo.toml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
[package]
2+
name = "DLL_Injector"
3+
version = "0.1.0"
4+
edition = "2021"
5+
authors = ["5mukx", "https://x.com/5mukx"]
6+
7+
[dependencies]
8+
winapi = { version = "0.3.9", features = [
9+
"winuser",
10+
"setupapi",
11+
"dbghelp",
12+
"wlanapi",
13+
"winnls",
14+
"wincon",
15+
"fileapi",
16+
"sysinfoapi",
17+
"fibersapi",
18+
"debugapi",
19+
"winerror",
20+
"wininet",
21+
"winhttp",
22+
"synchapi",
23+
"securitybaseapi",
24+
"wincrypt",
25+
"psapi",
26+
"tlhelp32",
27+
"heapapi",
28+
"shellapi",
29+
"memoryapi",
30+
"processthreadsapi",
31+
"errhandlingapi",
32+
"winbase",
33+
"handleapi",
34+
"synchapi",
35+
] }
36+
ntapi = "0.4.1"
37+
user32-sys = "0.2.0"

DLL_Injector/README.md

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
# DLL Injector
2+
3+
A powerful and versatile DLL injector written in rust, designed for injecting dynamic link libraries (DLLs) into running Windows processes. This tool supports multiple injection methods and process targeting by name, making it suitable for advanced users and developers exploring process manipulation.
4+
5+
![PoC](./image1.png)
6+
7+
Download DLL Injector: [Download](https://github.com/Whitecat18/Rust-for-Malware-Development/tree/main/DLL_Injector)
8+
9+
## Features
10+
11+
- **Multiple DLL Support**: Inject one or more DLLs into a target process in a single execution.
12+
- **Flexible Injection Methods**: Choose between two injection techniques:
13+
- **CRT (CreateRemoteThread)**: Uses `CreateRemoteThread` to load the DLL via `LoadLibraryA`.
14+
- **APC (QueueUserAPC)**: Queues an asynchronous procedure call to all threads of the target process for stealthier injection.
15+
- **Process Name Targeting**: Specify the target process by name (e.g., `Notepad.exe`) instead of PID, with automatic PID resolution.
16+
- **DLL Load Verification**: Checks if the injected DLL is successfully loaded into the target process’s module list.
17+
- **Robust Error Handling**: Provides detailed error messages with Windows error codes for troubleshooting.
18+
- **Colored Output**: Uses ANSI color codes for clear, readable logging (DEBUG, INFO, WARN, ERROR).
19+
- **Timeout Protection**: Implements a 30-second timeout for CRT injection to prevent hangs.
20+
- **Resource Management**: Ensures proper cleanup of handles and allocated memory.
21+
22+
## Execution Methods
23+
24+
### Prerequisites
25+
- Required dependencies in `Cargo.toml`:
26+
```rust
27+
[dependencies]
28+
winapi = { version = "0.3", features = ["errhandlingapi", "handleapi", "libloaderapi", "memoryapi", "processthreadsapi", "synchapi", "winnt", "winbase", "tlhelp32", "minwindef"] }
29+
```
30+
## Usage
31+
32+
```powershell
33+
injector.exe <PID> [DLL Path 1] [DLL Path 2] ... [--method CRT|APC]
34+
```
35+
36+
Example:
37+
38+
* Inject one DLL:
39+
```powershell
40+
dll_inject.exe 1234 path\to\dll1.dll
41+
```
42+
43+
* Inject multiple DLLs:
44+
```powershell
45+
dll_inject.exe 1234 dll1.dll dll2.dll
46+
```
47+
48+
* Use APC method:
49+
```powershell
50+
dll_inject.exe 1234 dll1.dll --method APC
51+
```
52+
53+
54+
55+
## Author
56+
57+
By:
58+
* [@5mukx](https://x.com/5mukx)

DLL_Injector/dll_file.dll

120 KB
Binary file not shown.

DLL_Injector/image1.png

68.7 KB
Loading

0 commit comments

Comments
 (0)