Classic DLL injection POC in Rust leveraging Windows API hashing.
Injection approach:
OpenProcess
for the given process IDVirtualAllocEx
to allocate RW memory in the target process to write the DLL pathWriteProcessMemory
to write the DLL path into the buffer allocated byVirtualAllocEx
CreateRemoteThread
to create a remote thread in the target process that will executeLoadLibraryW
using the DLL path from the buffer as the argument
Usage:
rust_classic_dll_injection.exe [target PID] [DLL path]
# debug
cargo build
# release
cargo build --release