diff --git a/src/filters.rs b/src/filters.rs index 1244215..6b5e5a4 100644 --- a/src/filters.rs +++ b/src/filters.rs @@ -53,7 +53,7 @@ impl FeroxFilter for WildcardFilter { /// Examine size, dynamic, and content_len to determine whether or not the response received /// is a wildcard response and therefore should be filtered out fn should_filter_response(&self, response: &FeroxResponse) -> bool { - log::trace!("enter: should_filter_response({:?} {:?})", self, response); + log::trace!("enter: should_filter_response({:?} {})", self, response); // quick return if dont_filter is set if CONFIGURATION.dont_filter { @@ -114,7 +114,7 @@ pub struct StatusCodeFilter { impl FeroxFilter for StatusCodeFilter { /// Check `filter_code` against what was passed in via -C|--filter-status fn should_filter_response(&self, response: &FeroxResponse) -> bool { - log::trace!("enter: should_filter_response({:?} {:?})", self, response); + log::trace!("enter: should_filter_response({:?} {})", self, response); if response.status().as_u16() == self.filter_code { log::debug!( diff --git a/src/heuristics.rs b/src/heuristics.rs index 8675f9d..260a376 100644 --- a/src/heuristics.rs +++ b/src/heuristics.rs @@ -229,7 +229,7 @@ async fn make_wildcard_request( } } } - log::trace!("exit: make_wildcard_request -> {:?}", ferox_response); + log::trace!("exit: make_wildcard_request -> {}", ferox_response); return Some(ferox_response); } } diff --git a/src/lib.rs b/src/lib.rs index 8051d86..518bf7e 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -103,6 +103,13 @@ pub struct FeroxResponse { headers: HeaderMap, } +/// Implement Display for FeroxResponse +impl fmt::Display for FeroxResponse { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + write!(f, "FeroxResponse {{ url: {}, status: {}, content-length: {} }}", self.url(), self.status(), self.content_length()) + } +} + /// `FeroxResponse` implementation impl FeroxResponse { /// Get the `StatusCode` of this `FeroxResponse` diff --git a/src/logger.rs b/src/logger.rs index f3bc726..c8fc902 100644 --- a/src/logger.rs +++ b/src/logger.rs @@ -19,8 +19,8 @@ pub fn initialize(verbosity: u8) { 0 => (), 1 => env::set_var("RUST_LOG", "warn"), 2 => env::set_var("RUST_LOG", "info"), - 3 => env::set_var("RUST_LOG", "debug,hyper=info,reqwest=info"), - _ => env::set_var("RUST_LOG", "trace,hyper=info,reqwest=info"), + 3 => env::set_var("RUST_LOG", "feroxbuster=debug,info"), + _ => env::set_var("RUST_LOG", "feroxbuster=trace,info"), } } } @@ -55,12 +55,12 @@ pub fn initialize(verbosity: u8) { }; let msg = format!( - "{} {:10.03} {}\n", + "{} {:10.03} {} {}\n", style(level_name).bg(level_color).black(), style(t).dim(), + record.target(), style(record.args()).dim(), ); - PROGRESS_PRINTER.println(&msg); if let Some(buffered_file) = locked_file.clone() { diff --git a/src/parser.rs b/src/parser.rs index ab545d4..e4fc9e7 100644 --- a/src/parser.rs +++ b/src/parser.rs @@ -55,7 +55,7 @@ pub fn initialize() -> App<'static, 'static> { .long("verbosity") .takes_value(false) .multiple(true) - .help("Increase verbosity level (use -vv or more for greater effect)"), + .help("Increase verbosity level (use -vv or more for greater effect. [CAUTION] 4 -v's is probably too much)"), ) .arg( Arg::with_name("proxy") diff --git a/src/scanner.rs b/src/scanner.rs index eb727aa..9b73e22 100644 --- a/src/scanner.rs +++ b/src/scanner.rs @@ -285,7 +285,7 @@ fn create_urls(target_url: &str, word: &str, extensions: &[String]) -> Vec /// handles 2xx and 3xx responses by either checking if the url ends with a / (2xx) /// or if the Location header is present and matches the base url + / (3xx) fn response_is_directory(response: &FeroxResponse) -> bool { - log::trace!("enter: is_directory({:?})", response); + log::trace!("enter: is_directory({})", response); if response.status().is_redirection() { // status code is 3xx @@ -312,7 +312,7 @@ fn response_is_directory(response: &FeroxResponse) -> bool { } None => { log::debug!( - "expected Location header, but none was found: {:?}", + "expected Location header, but none was found: {}", response ); log::trace!("exit: is_directory -> false"); @@ -370,7 +370,7 @@ async fn try_recursion( transmitter: UnboundedSender, ) { log::trace!( - "enter: try_recursion({:?}, {}, {:?})", + "enter: try_recursion({}, {}, {:?})", response, base_depth, transmitter @@ -523,11 +523,7 @@ async fn make_requests( if new_ferox_response.is_file() { // very likely a file, simply request and report - log::debug!( - "Singular extraction: {} ({})", - new_ferox_response.url(), - new_ferox_response.status().as_str(), - ); + log::debug!("Singular extraction: {}", new_ferox_response); send_report(report_chan.clone(), new_ferox_response); @@ -535,11 +531,7 @@ async fn make_requests( } if !CONFIGURATION.no_recursion { - log::debug!( - "Recursive extraction: {} ({})", - new_ferox_response.url(), - new_ferox_response.status().as_str() - ); + log::debug!("Recursive extraction: {}", new_ferox_response); if new_ferox_response.status().is_success() && !new_ferox_response.url().as_str().ends_with('/') @@ -565,7 +557,7 @@ async fn make_requests( /// Simple helper to send a `FeroxResponse` over the tx side of an `mpsc::unbounded_channel` fn send_report(report_sender: UnboundedSender, response: FeroxResponse) { - log::trace!("enter: send_report({:?}, {:?}", report_sender, response); + log::trace!("enter: send_report({:?}, {}", report_sender, response); match report_sender.send(response) { Ok(_) => {}