From cb2f069c336ea45ee1c832cec6a5ebb8fe05e43e Mon Sep 17 00:00:00 2001 From: Teofilo Monteiro Date: Fri, 2 Oct 2020 14:37:05 +0200 Subject: [PATCH 1/2] Update documentation include greppable --- README.md | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 4902c073f..cd487de5e 100644 --- a/README.md +++ b/README.md @@ -225,10 +225,11 @@ USAGE: FLAGS: --accessible Accessible mode. Turns off features which negatively affect screen readers + -g, --greppable Greppable mode. Only output the ports. No Nmap. Useful for grep or outputting to a file -h, --help Prints help information -n, --no-config Whether to ignore the configuration file or not --no-nmap Turns off Nmap - -q, --quiet Quiet mode. Only output the ports. No Nmap. Useful for grep or outputting to a file + --top Use the top 1000 ports -V, --version Prints version information OPTIONS: @@ -246,7 +247,7 @@ OPTIONS: ARGS: ... A list of comma separated CIDRs, IPs, or hosts to be scanned ... The Nmap arguments to run. To use the argument -A, end RustScan's args with '-- -A'. Example: - 'rustscan -t 1500 127.0.0.1 -- -A -sC'. This command adds -Pn -vvv -p $PORTS automatically to + 'rustscan -T 1500 127.0.0.1 -- -A -sC'. This command adds -Pn -vvv -p $PORTS automatically to nmap. For things like --script '(safe and vuln)' enclose it in quotations marks \"'(safe and vuln)'\"") ``` @@ -268,7 +269,7 @@ and accepts the following fields: - `scan_order` - `command` - `accessible` -- `quiet` +- `greppable` - `batch-size` - `timeout` - `ulimit` @@ -280,7 +281,7 @@ addresses = ["127.0.0.1", "192.168.0.0/30", "www.google.com"] command = ["-A"] ports = [80, 443, 8080] range = { start = 1, end = 10 } -quiet = false +greppable = false accessible = true scan_order = "Serial" batch_size = 1000 From 22e8c46e0669f2f7d6ce9f105386b62e5578e4ea Mon Sep 17 00:00:00 2001 From: Teofilo Monteiro Date: Fri, 2 Oct 2020 14:45:49 +0200 Subject: [PATCH 2/2] Replace quiet mode for greppable mode --- src/input.rs | 2 +- src/main.rs | 2 +- src/scanner/mod.rs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/input.rs b/src/input.rs index f2eb6eb38..dcfb0773d 100644 --- a/src/input.rs +++ b/src/input.rs @@ -210,7 +210,7 @@ impl Config { /// /// addresses = ["127.0.0.1", "127.0.0.1"] /// ports = [80, 443, 8080] - /// quiet = true + /// greppable = true /// scan_order: "Serial" /// pub fn read() -> Self { diff --git a/src/main.rs b/src/main.rs index 1f0ee9585..03eefadc8 100644 --- a/src/main.rs +++ b/src/main.rs @@ -121,7 +121,7 @@ fn main() { // nmap port style is 80,443. Comma separated with no spaces. let ports_str = nmap_str_ports.join(","); - // if quiet mode is on nmap should not be spawned + // if greppable mode is on nmap should not be spawned if opts.greppable || opts.no_nmap { println!("{} -> [{}]", &ip, ports_str); continue; diff --git a/src/scanner/mod.rs b/src/scanner/mod.rs index 3fdcf4a73..2bc800167 100644 --- a/src/scanner/mod.rs +++ b/src/scanner/mod.rs @@ -19,7 +19,7 @@ use std::{ /// start & end is where the port scan starts and ends /// batch_size is how many ports at a time should be scanned /// Timeout is the time RustScan should wait before declaring a port closed. As datatype Duration. -/// Quiet is whether or not RustScan should print things, or wait until the end to print only open ports. +/// greppable is whether or not RustScan should print things, or wait until the end to print only the ip and open ports. #[cfg(not(tarpaulin_include))] #[derive(Debug)] pub struct Scanner {