Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How do i use this library? #1

Open
muhammadn opened this issue Oct 30, 2023 · 0 comments
Open

How do i use this library? #1

muhammadn opened this issue Oct 30, 2023 · 0 comments

Comments

@muhammadn
Copy link

Hi, it seems there is a lack of documentation of how to use this library.

I've tried this but no packet is sent out while doing tcpdump (lo and ethernet interfaces):

    extern crate lib_blaster;
    extern crate pnet;

    use lib_blaster::builder::Pkt;
    use lib_blaster::collector::Collector;
    use lib_blaster::sender::Sender;
    use lib_blaster::tools::{fast_random, rand_ipv4};
    use std::net::Ipv4Addr;

fn main() {

        let packet = Pkt::new(&Collector {
            src_ip: Ipv4Addr::new(127, 0, 0, 1),
            dst_ip: Ipv4Addr::new(127, 0, 0, 1),
            src_port: fast_random::<u16>().unwrap(),
            dst_port: 1,
        }).unwrap();

        let mut sender = Sender::new().unwrap();
        let _ = sender.send_syn(&packet);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant