Skip to content

How do i use this library? #1

@muhammadn

Description

@muhammadn

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);
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions