| Crates.io | rust_pwntools |
| lib.rs | rust_pwntools |
| version | 0.1.0 |
| created_at | 2025-03-12 16:25:28.141833+00 |
| updated_at | 2025-03-12 16:25:28.141833+00 |
| description | A Rust crate inspired by Pwntools, providing powerful tools for binary exploitation, reverse engineering, and CTF challenges. |
| homepage | https://github.com/sidudakid/rust_pwntools |
| repository | https://github.com/sidudakid/rust_pwntools |
| max_upload_size | |
| id | 1589985 |
| size | 25,469 |
Rust PwnTools is a Rust crate inspired by Pwntools in Python, providing powerful tools for binary exploitation, reverse engineering, and CTF challenges. The crate supports:
Add this to your Cargo.toml:
[dependencies]
rust_pwntools = "0.1.0"
use rust_pwntools::process::Process;
let mut process = Process::new("ls", &["-l"]).expect("Failed to spawn process");
let output = process.read_output().expect("Failed to read output");
println!("Output: {}", output);
use rust_pwntools::network::Remote;
use tokio::runtime::Runtime;
let rt = Runtime::new().unwrap();
rt.block_on(async {
let mut remote = Remote::connect_tcp("example.com:80").await.expect("Failed to connect");
remote.send(b"GET / HTTP/1.0\r\n\r\n").await.expect("Failed to send data");
let mut buffer = [0u8; 1024];
let n = remote.receive(&mut buffer).await.expect("Failed to receive data");
println!("Received {} bytes", n);
});
use rust_pwntools::binary::Binary;
use std::path::Path;
let binary = Binary::parse(Path::new("/bin/ls")).expect("Failed to parse binary");
for symbol in binary.symbols() {
println!("Symbol: {}", symbol);
}
use rust_pwntools::exploit::RopChain;
let mut rop_chain = RopChain::new();
rop_chain.add_gadget(0xdeadbeef);
let payload = rop_chain.generate_payload(4);
println!("Payload: {:?}", payload);
use rust_pwntools::memory::Memory;
let pid = 12345; // Replace with a real PID for testing
let memory = Memory::attach(pid).expect("Failed to attach to process");
let mut buffer = [0u8; 4];
memory.read(0x7fffffffdfd0, &mut buffer).expect("Failed to read memory");
println!("Memory: {:?}", buffer);
memory.detach().expect("Failed to detach from process");
This project is licensed under the MIT License.