From bb01c3b5ee678537991093d52af3cc4e7ebec499 Mon Sep 17 00:00:00 2001 From: "Autumn (Bee)" Date: Mon, 25 Nov 2024 10:03:38 +0000 Subject: [PATCH 1/2] Add documentation to RustScan library Our library is sorely lacking docs. I read this https://docs.rs/rustscan/latest/rustscan/ and had no idea what the arguments are. These comments should hopefully show up :) --- src/lib.rs | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index e8601285f..63f79c976 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -23,15 +23,15 @@ //! }; //! let strategy = PortStrategy::pick(&Some(range), None, ScanOrder::Random); //! let scanner = Scanner::new( -//! &addrs, -//! 10, -//! Duration::from_millis(100), -//! 1, -//! true, -//! strategy, -//! true, -//! vec![9000], -//! false, +//! &addrs, // the addresses to scan +//! 10, // batch_size is how many ports at a time should be scanned +//! Duration::from_millis(100), //T imeout is the time RustScan should wait before declaring a port closed. As datatype Duration. +//! 1, // Tries, how many retries should RustScan do? +//! true, // greppable is whether or not RustScan should print things, or wait until the end to print only the ip +//! strategy, // the port strategy used +//! true, // accessible, should the output be A11Y compliant? +//! vec![9000], // What ports should RustScan exclude? +//! false, // is this a UDP scan? //! ); //! //! let scan_result = block_on(scanner.run()); From 387edc7b05740a8a60a9844de55b862fc82e6d18 Mon Sep 17 00:00:00 2001 From: "Autumn (Bee)" Date: Mon, 25 Nov 2024 10:05:43 +0000 Subject: [PATCH 2/2] Add port strat --- src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib.rs b/src/lib.rs index 63f79c976..e335de58a 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -21,7 +21,7 @@ //! start: 1, //! end: 1_000, //! }; -//! let strategy = PortStrategy::pick(&Some(range), None, ScanOrder::Random); +//! let strategy = PortStrategy::pick(&Some(range), None, ScanOrder::Random); // can be serial, random or manual https://github.com/RustScan/RustScan/blob/master/src/port_strategy/mod.rs //! let scanner = Scanner::new( //! &addrs, // the addresses to scan //! 10, // batch_size is how many ports at a time should be scanned