diff --git a/Cargo.toml b/Cargo.toml index 2a848fb..26960ce 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -6,3 +6,6 @@ edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] +# packet = "0.1.4" +anyhow = "1" +log = "0.4" diff --git a/src/ipv4_gen.rs b/src/ipv4_gen.rs new file mode 100644 index 0000000..a7f2a16 --- /dev/null +++ b/src/ipv4_gen.rs @@ -0,0 +1,4 @@ + +pub fn generate_ips() -> Vec> { + +} diff --git a/src/main.rs b/src/main.rs index e7a11a9..1756a81 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,3 +1,12 @@ +#![allow( + dead_code, + unused_variables, + //unused_imports, // TODO: rm +)] + +mod scanner; +mod ipv4_gen; + fn main() { println!("Hello, world!"); } diff --git a/src/scanner.rs b/src/scanner.rs new file mode 100644 index 0000000..1f62648 --- /dev/null +++ b/src/scanner.rs @@ -0,0 +1,35 @@ +use std::{net::{TcpStream, SocketAddr}, thread::JoinHandle}; +use log::info; +use std::thread; +use crate::ipv4_gen; + +async fn check_ack(dest: &SocketAddr) -> bool { + if let Ok(res) = TcpStream::connect(dest) { + info!("Got TCP ack from: {:?}", dest); + return true; + } + return false; +} + +pub fn start_scan(depth: u32) { + let threads: Vec> = Vec::new(); + + for i in 0..depth { + let thread = thread::spawn(|| { + println!("hi"); + }); + } +} + + +/* + +depth: u32 +blacklist_ips: Vec + +pre: + # generate IPs + ALL_IPS: Vec> = ... + +*/ +