diff --git a/Cargo.lock b/Cargo.lock index 9e50c2a..46ac55a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -116,13 +116,12 @@ dependencies = [ [[package]] name = "assert_cmd" -version = "2.0.17" +version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2bd389a4b2970a01282ee455294913c0a43724daedcd1a24c3eb0ec1c1320b66" +checksum = "bcbb6924530aa9e0432442af08bbcafdad182db80d2e560da42a6d442535bf85" dependencies = [ "anstyle", "bstr", - "doc-comment", "libc", "predicates", "predicates-core", @@ -790,12 +789,6 @@ dependencies = [ "syn 2.0.104", ] -[[package]] -name = "doc-comment" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fea41bba32d969b513997752735605054bc0dfa92b4c56bf1189f2e174be7a10" - [[package]] name = "dtoa" version = "1.0.10" diff --git a/Cargo.toml b/Cargo.toml index 727bbfc..ce13553 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -69,7 +69,7 @@ self_update = { version = "0.40", features = [ [dev-dependencies] tempfile = "3.20" httpmock = "0.7" -assert_cmd = "2.0" +assert_cmd = "2.1" predicates = "3.1" [profile.release] diff --git a/tests/test_banner.rs b/tests/test_banner.rs index d5720d2..544a77e 100644 --- a/tests/test_banner.rs +++ b/tests/test_banner.rs @@ -1,6 +1,8 @@ mod utils; -use assert_cmd::Command; +use assert_cmd::cargo_bin; +use assert_cmd::prelude::*; use predicates::prelude::*; +use std::process::Command; use utils::{setup_tmp_directory, teardown_tmp_directory}; #[test] @@ -13,15 +15,13 @@ fn banner_prints_proxy() -> Result<(), Box> { ]; let (tmp_dir, file) = setup_tmp_directory(&urls, "wordlist")?; - Command::cargo_bin("feroxbuster") - .unwrap() + Command::new(cargo_bin!("feroxbuster")) .arg("--stdin") .arg("--proxy") .arg("http://127.0.0.1:8080") .arg("--wordlist") .arg("/definitely/doesnt/exist/0cd7fed0-47f4-4b18-a1b0-ac39708c1676") - .pipe_stdin(file) - .unwrap() + .stdin(std::fs::File::open(file)?) .assert() .success() .stderr( @@ -53,15 +53,13 @@ fn banner_prints_replay_proxy() -> Result<(), Box> { ]; let (tmp_dir, file) = setup_tmp_directory(&urls, "wordlist")?; - Command::cargo_bin("feroxbuster") - .unwrap() + Command::new(cargo_bin!("feroxbuster")) .arg("--stdin") .arg("--wordlist") .arg("/definitely/doesnt/exist/0cd7fed0-47f4-4b18-a1b0-ac39708c1676") .arg("--replay-proxy") .arg("http://127.0.0.1:8081") - .pipe_stdin(file) - .unwrap() + .stdin(std::fs::File::open(file)?) .assert() .success() .stderr( @@ -87,8 +85,7 @@ fn banner_prints_replay_proxy() -> Result<(), Box> { /// test allows non-existent wordlist to trigger the banner printing to stderr /// expect to see all mandatory prints + multiple headers fn banner_prints_headers() { - Command::cargo_bin("feroxbuster") - .unwrap() + Command::new(cargo_bin!("feroxbuster")) .arg("--url") .arg("http://localhost") .arg("--headers") @@ -119,8 +116,7 @@ fn banner_prints_headers() { /// test allows non-existent wordlist to trigger the banner printing to stderr /// expect to see all mandatory prints + multiple dont scan url & regex entries fn banner_prints_denied_urls() { - Command::cargo_bin("feroxbuster") - .unwrap() + Command::new(cargo_bin!("feroxbuster")) .arg("--url") .arg("http://localhost") .arg("--dont-scan") @@ -155,8 +151,7 @@ fn banner_prints_denied_urls() { /// test allows non-existent wordlist to trigger the banner printing to stderr /// expect to see all mandatory prints + multiple scope url entries fn banner_prints_scope_urls() { - Command::cargo_bin("feroxbuster") - .unwrap() + Command::new(cargo_bin!("feroxbuster")) .arg("--url") .arg("http://localhost") .arg("--scope") @@ -188,8 +183,7 @@ fn banner_prints_scope_urls() { /// test allows non-existent wordlist to trigger the banner printing to stderr /// expect to see all mandatory prints + multiple headers fn banner_prints_random_agent() { - Command::cargo_bin("feroxbuster") - .unwrap() + Command::new(cargo_bin!("feroxbuster")) .arg("--url") .arg("http://localhost") .arg("--random-agent") @@ -215,8 +209,7 @@ fn banner_prints_random_agent() { /// test allows non-existent wordlist to trigger the banner printing to stderr /// expect to see all mandatory prints + multiple size filters fn banner_prints_filter_sizes() { - Command::cargo_bin("feroxbuster") - .unwrap() + Command::new(cargo_bin!("feroxbuster")) .arg("--url") .arg("http://localhost") .arg("-S") @@ -261,8 +254,7 @@ fn banner_prints_filter_sizes() { /// test allows non-existent wordlist to trigger the banner printing to stderr /// expect to see all mandatory prints + queries fn banner_prints_queries() { - Command::cargo_bin("feroxbuster") - .unwrap() + Command::new(cargo_bin!("feroxbuster")) .arg("--url") .arg("http://localhost") .arg("-Q") @@ -293,8 +285,7 @@ fn banner_prints_queries() { /// test allows non-existent wordlist to trigger the banner printing to stderr /// expect to see all mandatory prints + status codes fn banner_prints_status_codes() { - Command::cargo_bin("feroxbuster") - .unwrap() + Command::new(cargo_bin!("feroxbuster")) .arg("--url") .arg("http://localhost") .arg("-s") @@ -321,8 +312,7 @@ fn banner_prints_status_codes() { /// test allows non-existent wordlist to trigger the banner printing to stderr /// expect to see all mandatory prints + replay codes fn banner_prints_replay_codes() { - Command::cargo_bin("feroxbuster") - .unwrap() + Command::new(cargo_bin!("feroxbuster")) .arg("--url") .arg("http://localhost") .arg("--replay-codes") @@ -353,8 +343,7 @@ fn banner_prints_replay_codes() { /// test allows non-existent wordlist to trigger the banner printing to stderr /// expect to see all mandatory prints + output file fn banner_prints_output_file() { - Command::cargo_bin("feroxbuster") - .unwrap() + Command::new(cargo_bin!("feroxbuster")) .arg("--url") .arg("http://localhost") .arg("--output") @@ -385,8 +374,7 @@ fn banner_prints_output_file() { /// test allows non-existent wordlist to trigger the banner printing to stderr /// expect to see all mandatory prints + insecure fn banner_prints_insecure() { - Command::cargo_bin("feroxbuster") - .unwrap() + Command::new(cargo_bin!("feroxbuster")) .arg("--url") .arg("http://localhost") .arg("-k") @@ -413,8 +401,7 @@ fn banner_prints_insecure() { /// test allows non-existent wordlist to trigger the banner printing to stderr /// expect to see all mandatory prints + follow redirects fn banner_prints_redirects() { - Command::cargo_bin("feroxbuster") - .unwrap() + Command::new(cargo_bin!("feroxbuster")) .arg("--url") .arg("http://localhost") .arg("-r") @@ -441,8 +428,7 @@ fn banner_prints_redirects() { /// test allows non-existent wordlist to trigger the banner printing to stderr /// expect to see all mandatory prints + extensions fn banner_prints_extensions() { - Command::cargo_bin("feroxbuster") - .unwrap() + Command::new(cargo_bin!("feroxbuster")) .arg("--url") .arg("http://localhost") .arg("-x") @@ -472,8 +458,7 @@ fn banner_prints_extensions() { /// test allows non-existent wordlist to trigger the banner printing to stderr /// expect to see all mandatory prints + dont_filter fn banner_prints_dont_filter() { - Command::cargo_bin("feroxbuster") - .unwrap() + Command::new(cargo_bin!("feroxbuster")) .arg("--url") .arg("http://localhost") .arg("--dont-filter") @@ -500,8 +485,7 @@ fn banner_prints_dont_filter() { /// test allows non-existent wordlist to trigger the banner printing to stderr /// expect to see all mandatory prints + verbosity=1 fn banner_prints_verbosity_one() { - Command::cargo_bin("feroxbuster") - .unwrap() + Command::new(cargo_bin!("feroxbuster")) .arg("--url") .arg("http://localhost") .arg("-v") @@ -528,8 +512,7 @@ fn banner_prints_verbosity_one() { /// test allows non-existent wordlist to trigger the banner printing to stderr /// expect to see all mandatory prints + verbosity=2 fn banner_prints_verbosity_two() { - Command::cargo_bin("feroxbuster") - .unwrap() + Command::new(cargo_bin!("feroxbuster")) .arg("--url") .arg("http://localhost") .arg("-vv") @@ -556,8 +539,7 @@ fn banner_prints_verbosity_two() { /// test allows non-existent wordlist to trigger the banner printing to stderr /// expect to see all mandatory prints + verbosity=3 fn banner_prints_verbosity_three() { - Command::cargo_bin("feroxbuster") - .unwrap() + Command::new(cargo_bin!("feroxbuster")) .arg("--url") .arg("http://localhost") .arg("-vvv") @@ -584,8 +566,7 @@ fn banner_prints_verbosity_three() { /// test allows non-existent wordlist to trigger the banner printing to stderr /// expect to see all mandatory prints + verbosity=4 fn banner_prints_verbosity_four() { - Command::cargo_bin("feroxbuster") - .unwrap() + Command::new(cargo_bin!("feroxbuster")) .arg("--url") .arg("http://localhost") .arg("-vvvv") @@ -612,8 +593,7 @@ fn banner_prints_verbosity_four() { /// test allows non-existent wordlist to trigger the banner printing to stderr /// expect to see all mandatory prints + add slash fn banner_prints_add_slash() { - Command::cargo_bin("feroxbuster") - .unwrap() + Command::new(cargo_bin!("feroxbuster")) .arg("--url") .arg("http://localhost") .arg("-f") @@ -640,8 +620,7 @@ fn banner_prints_add_slash() { /// test allows non-existent wordlist to trigger the banner printing to stderr /// expect to see all mandatory prints + INFINITE recursion fn banner_prints_infinite_depth() { - Command::cargo_bin("feroxbuster") - .unwrap() + Command::new(cargo_bin!("feroxbuster")) .arg("--url") .arg("http://localhost") .arg("--depth") @@ -669,8 +648,7 @@ fn banner_prints_infinite_depth() { /// test allows non-existent wordlist to trigger the banner printing to stderr /// expect to see all mandatory prints + recursion depth fn banner_prints_recursion_depth() { - Command::cargo_bin("feroxbuster") - .unwrap() + Command::new(cargo_bin!("feroxbuster")) .arg("--url") .arg("http://localhost") .arg("--depth") @@ -698,8 +676,7 @@ fn banner_prints_recursion_depth() { /// test allows non-existent wordlist to trigger the banner printing to stderr /// expect to see all mandatory prints + server certs fn banner_prints_server_certs() { - Command::cargo_bin("feroxbuster") - .unwrap() + Command::new(cargo_bin!("feroxbuster")) .arg("--url") .arg("http://localhost") .arg("--server-certs") @@ -729,8 +706,7 @@ fn banner_prints_server_certs() { /// test allows non-existent wordlist to trigger the banner printing to stderr /// expect to see all mandatory prints + server certs fn banner_prints_client_cert_and_key() { - Command::cargo_bin("feroxbuster") - .unwrap() + Command::new(cargo_bin!("feroxbuster")) .arg("--url") .arg("http://localhost") .arg("--client-cert") @@ -762,8 +738,7 @@ fn banner_prints_client_cert_and_key() { /// test allows non-existent wordlist to trigger the banner printing to stderr /// expect to see all mandatory prints + no recursion fn banner_prints_no_recursion() { - Command::cargo_bin("feroxbuster") - .unwrap() + Command::new(cargo_bin!("feroxbuster")) .arg("--url") .arg("http://localhost") .arg("-n") @@ -790,8 +765,7 @@ fn banner_prints_no_recursion() { /// test allows non-existent wordlist to trigger the banner printing to stderr /// expect to see nothing fn banner_doesnt_print() { - Command::cargo_bin("feroxbuster") - .unwrap() + Command::new(cargo_bin!("feroxbuster")) .arg("--url") .arg("http://localhost") .arg("-q") @@ -808,8 +782,7 @@ fn banner_doesnt_print() { /// test allows non-existent wordlist to trigger the banner printing to stderr /// expect to see all mandatory prints + extract-links fn banner_prints_extract_links() { - Command::cargo_bin("feroxbuster") - .unwrap() + Command::new(cargo_bin!("feroxbuster")) .arg("--url") .arg("http://localhost") .arg("-e") @@ -836,8 +809,7 @@ fn banner_prints_extract_links() { /// test allows non-existent wordlist to trigger the banner printing to stderr /// expect to see all mandatory prints + scan-limit fn banner_prints_scan_limit() { - Command::cargo_bin("feroxbuster") - .unwrap() + Command::new(cargo_bin!("feroxbuster")) .arg("--url") .arg("http://localhost") .arg("-L") @@ -865,8 +837,7 @@ fn banner_prints_scan_limit() { /// test allows non-existent wordlist to trigger the banner printing to stderr /// expect to see all mandatory prints + response-size-limit fn banner_prints_response_size_limit() { - Command::cargo_bin("feroxbuster") - .unwrap() + Command::new(cargo_bin!("feroxbuster")) .arg("--url") .arg("http://localhost") .arg("--response-size-limit") @@ -894,8 +865,7 @@ fn banner_prints_response_size_limit() { /// test allows non-existent wordlist to trigger the banner printing to stderr /// expect to see all mandatory prints + filter-status fn banner_prints_filter_status() { - Command::cargo_bin("feroxbuster") - .unwrap() + Command::new(cargo_bin!("feroxbuster")) .arg("--url") .arg("http://localhost") .arg("-C") @@ -922,8 +892,7 @@ fn banner_prints_filter_status() { /// test allows non-existent wordlist to trigger the banner printing to stderr /// expect to see all mandatory prints + json fn banner_prints_json() { - Command::cargo_bin("feroxbuster") - .unwrap() + Command::new(cargo_bin!("feroxbuster")) .arg("--url") .arg("http://localhost") .arg("--json") @@ -952,8 +921,7 @@ fn banner_prints_json() { /// test allows non-existent wordlist to trigger the banner printing to stderr /// expect to see all mandatory prints + json fn banner_prints_debug_log() { - Command::cargo_bin("feroxbuster") - .unwrap() + Command::new(cargo_bin!("feroxbuster")) .arg("--url") .arg("http://localhost") .arg("--debug-log") @@ -981,8 +949,7 @@ fn banner_prints_debug_log() { /// test allows non-existent wordlist to trigger the banner printing to stderr /// expect to see all mandatory prints + regex filters fn banner_prints_filter_regex() { - Command::cargo_bin("feroxbuster") - .unwrap() + Command::new(cargo_bin!("feroxbuster")) .arg("--url") .arg("http://localhost") .arg("--filter-regex") @@ -1010,8 +977,7 @@ fn banner_prints_filter_regex() { /// test allows non-existent wordlist to trigger the banner printing to stderr /// expect to see all mandatory prints + time limit fn banner_prints_time_limit() { - Command::cargo_bin("feroxbuster") - .unwrap() + Command::new(cargo_bin!("feroxbuster")) .arg("--url") .arg("http://localhost") .arg("--time-limit") @@ -1039,8 +1005,7 @@ fn banner_prints_time_limit() { /// test allows non-existent wordlist to trigger the banner printing to stderr /// expect to see all mandatory prints + similarity filter fn banner_prints_similarity_filter() { - Command::cargo_bin("feroxbuster") - .unwrap() + Command::new(cargo_bin!("feroxbuster")) .arg("--url") .arg("http://localhost") .arg("--filter-similar-to") @@ -1068,8 +1033,7 @@ fn banner_prints_similarity_filter() { /// test allows non-existent wordlist to trigger the banner printing to stderr /// expect to see all mandatory prints + rate limit fn banner_prints_rate_limit() { - Command::cargo_bin("feroxbuster") - .unwrap() + Command::new(cargo_bin!("feroxbuster")) .arg("--url") .arg("http://localhost") .arg("--rate-limit") @@ -1097,8 +1061,7 @@ fn banner_prints_rate_limit() { /// test allows non-existent wordlist to trigger the banner printing to stderr /// expect to see all mandatory prints + auto tune fn banner_prints_auto_tune() { - Command::cargo_bin("feroxbuster") - .unwrap() + Command::new(cargo_bin!("feroxbuster")) .arg("--url") .arg("http://localhost") .arg("--auto-tune") @@ -1125,8 +1088,7 @@ fn banner_prints_auto_tune() { /// test allows non-existent wordlist to trigger the banner printing to stderr /// expect to see all mandatory prints + auto bail fn banner_prints_auto_bail() { - Command::cargo_bin("feroxbuster") - .unwrap() + Command::new(cargo_bin!("feroxbuster")) .arg("--url") .arg("http://localhost") .arg("--auto-bail") @@ -1153,8 +1115,7 @@ fn banner_prints_auto_bail() { /// test allows non-existent wordlist to trigger the banner printing to stderr /// expect to see no banner output fn banner_doesnt_print_when_silent() { - Command::cargo_bin("feroxbuster") - .unwrap() + Command::new(cargo_bin!("feroxbuster")) .arg("--url") .arg("http://localhost") .arg("--silent") @@ -1179,8 +1140,7 @@ fn banner_doesnt_print_when_silent() { /// test allows non-existent wordlist to trigger the banner printing to stderr /// expect to see no banner output fn banner_doesnt_print_when_quiet() { - Command::cargo_bin("feroxbuster") - .unwrap() + Command::new(cargo_bin!("feroxbuster")) .arg("--url") .arg("http://localhost") .arg("--quiet") @@ -1205,8 +1165,7 @@ fn banner_doesnt_print_when_quiet() { /// test allows non-existent wordlist to trigger the banner printing to stderr /// expect to see nothing as --parallel forces --silent to be true fn banner_prints_parallel() { - Command::cargo_bin("feroxbuster") - .unwrap() + Command::new(cargo_bin!("feroxbuster")) .arg("--stdin") .arg("--quiet") .arg("--parallel") @@ -1231,8 +1190,7 @@ fn banner_prints_parallel() { /// test allows non-existent wordlist to trigger the banner printing to stderr /// expect to see all mandatory prints + methods fn banner_prints_methods() { - Command::cargo_bin("feroxbuster") - .unwrap() + Command::new(cargo_bin!("feroxbuster")) .arg("--url") .arg("http://localhost") .arg("-m") @@ -1262,8 +1220,7 @@ fn banner_prints_methods() { /// test allows non-existent wordlist to trigger the banner printing to stderr /// expect to see all mandatory prints + data body fn banner_prints_data() { - Command::cargo_bin("feroxbuster") - .unwrap() + Command::new(cargo_bin!("feroxbuster")) .arg("--url") .arg("http://localhost") .arg("-m") @@ -1295,8 +1252,7 @@ fn banner_prints_data() { /// test allows non-existent wordlist to trigger the banner printing to stderr /// expect to see all mandatory prints + ignored extensions fn banner_prints_collect_extensions_and_dont_collect_default() { - Command::cargo_bin("feroxbuster") - .unwrap() + Command::new(cargo_bin!("feroxbuster")) .arg("--url") .arg("http://localhost") .arg("--collect-extensions") @@ -1324,8 +1280,7 @@ fn banner_prints_collect_extensions_and_dont_collect_default() { /// test allows non-existent wordlist to trigger the banner printing to stderr /// expect to see all mandatory prints + collect extensions fn banner_prints_collect_extensions_and_dont_collect_with_input() { - Command::cargo_bin("feroxbuster") - .unwrap() + Command::new(cargo_bin!("feroxbuster")) .arg("--url") .arg("http://localhost") .arg("--collect-extensions") @@ -1356,8 +1311,7 @@ fn banner_prints_collect_extensions_and_dont_collect_with_input() { /// test allows non-existent wordlist to trigger the banner printing to stderr /// expect to see all mandatory prints + collect backups fn banner_prints_collect_backups() { - Command::cargo_bin("feroxbuster") - .unwrap() + Command::new(cargo_bin!("feroxbuster")) .arg("--url") .arg("http://localhost") .arg("--collect-backups") @@ -1383,8 +1337,7 @@ fn banner_prints_collect_backups() { /// test allows non-existent wordlist to trigger the banner printing to stderr /// expect to see all mandatory prints + collect words fn banner_prints_collect_words() { - Command::cargo_bin("feroxbuster") - .unwrap() + Command::new(cargo_bin!("feroxbuster")) .arg("--url") .arg("http://localhost") .arg("--collect-words") @@ -1410,8 +1363,7 @@ fn banner_prints_collect_words() { /// test allows non-existent wordlist to trigger the banner printing to stderr /// expect to see all mandatory prints + collect words fn banner_prints_all_composite_settings_smart() { - Command::cargo_bin("feroxbuster") - .unwrap() + Command::new(cargo_bin!("feroxbuster")) .arg("--url") .arg("http://localhost") .arg("--smart") @@ -1440,8 +1392,7 @@ fn banner_prints_all_composite_settings_smart() { /// test allows non-existent wordlist to trigger the banner printing to stderr /// expect to see all mandatory prints + collect words fn banner_prints_all_composite_settings_thorough() { - Command::cargo_bin("feroxbuster") - .unwrap() + Command::new(cargo_bin!("feroxbuster")) .arg("--url") .arg("http://localhost") .arg("--thorough") @@ -1470,8 +1421,7 @@ fn banner_prints_all_composite_settings_thorough() { /// test allows non-existent wordlist to trigger the banner printing to stderr /// expect to see all mandatory prints + collect words fn banner_prints_all_composite_settings_burp() { - Command::cargo_bin("feroxbuster") - .unwrap() + Command::new(cargo_bin!("feroxbuster")) .arg("--url") .arg("http://localhost") .arg("--burp") @@ -1498,8 +1448,7 @@ fn banner_prints_all_composite_settings_burp() { /// test allows non-existent wordlist to trigger the banner printing to stderr /// expect to see all mandatory prints + collect words fn banner_prints_all_composite_settings_data_json_stdin() { - Command::cargo_bin("feroxbuster") - .unwrap() + Command::new(cargo_bin!("feroxbuster")) .arg("--url") .arg("http://localhost") .arg("--data-json") @@ -1525,8 +1474,7 @@ fn banner_prints_all_composite_settings_data_json_stdin() { #[test] fn banner_prints_all_composite_settings_data_json_file() { - Command::cargo_bin("feroxbuster") - .unwrap() + Command::new(cargo_bin!("feroxbuster")) .arg("--url") .arg("http://localhost") .arg("-m") @@ -1555,8 +1503,7 @@ fn banner_prints_all_composite_settings_data_json_file() { #[test] fn banner_prints_all_composite_settings_data_urlencoded_stdin() { - Command::cargo_bin("feroxbuster") - .unwrap() + Command::new(cargo_bin!("feroxbuster")) .arg("--url") .arg("http://localhost") .arg("-m") @@ -1590,8 +1537,7 @@ fn banner_prints_all_composite_settings_data_urlencoded_stdin() { /// test allows non-existent wordlist to trigger the banner printing to stderr /// expect to see all mandatory prints + collect words fn banner_prints_all_composite_settings_data_urlencoded_file() { - Command::cargo_bin("feroxbuster") - .unwrap() + Command::new(cargo_bin!("feroxbuster")) .arg("--url") .arg("http://localhost") .arg("--data-urlencoded") @@ -1622,8 +1568,7 @@ fn banner_prints_all_composite_settings_data_urlencoded_file() { /// test allows non-existent wordlist to trigger the banner printing to stderr /// expect to see all mandatory prints + collect words fn banner_prints_all_composite_settings_burp_replay() { - Command::cargo_bin("feroxbuster") - .unwrap() + Command::new(cargo_bin!("feroxbuster")) .arg("--url") .arg("http://localhost") .arg("--burp-replay") @@ -1650,8 +1595,7 @@ fn banner_prints_all_composite_settings_burp_replay() { /// test allows non-existent wordlist to trigger the banner printing to stderr /// expect to see all mandatory prints + force recursion fn banner_prints_force_recursion() { - Command::cargo_bin("feroxbuster") - .unwrap() + Command::new(cargo_bin!("feroxbuster")) .arg("--url") .arg("http://localhost") .arg("--force-recursion") @@ -1677,8 +1621,7 @@ fn banner_prints_force_recursion() { /// test allows non-existent wordlist to trigger the banner printing to stderr /// expect to see all mandatory prints + scan-dir-listings fn banner_prints_scan_dir_listings() { - Command::cargo_bin("feroxbuster") - .unwrap() + Command::new(cargo_bin!("feroxbuster")) .arg("--url") .arg("http://localhost") .arg("--scan-dir-listings") @@ -1704,8 +1647,7 @@ fn banner_prints_scan_dir_listings() { /// test allows non-existent wordlist to trigger the banner printing to stderr /// expect to see all mandatory prints + protocol fn banner_prints_limit_dirs() { - Command::cargo_bin("feroxbuster") - .unwrap() + Command::new(cargo_bin!("feroxbuster")) .arg("--url") .arg("localhost") .arg("--limit-bars") @@ -1732,8 +1674,7 @@ fn banner_prints_limit_dirs() { /// test allows non-existent wordlist to trigger the banner printing to stderr /// expect to see all mandatory prints + force recursion fn banner_prints_update_app() { - Command::cargo_bin("feroxbuster") - .unwrap() + Command::new(cargo_bin!("feroxbuster")) .arg("--update") .assert() .success() @@ -1744,8 +1685,7 @@ fn banner_prints_update_app() { /// test allows non-existent wordlist to trigger the banner printing to stderr /// expect to see all mandatory prints + unique fn banner_prints_unique() { - Command::cargo_bin("feroxbuster") - .unwrap() + Command::new(cargo_bin!("feroxbuster")) .arg("--url") .arg("http://localhost") .arg("--unique") diff --git a/tests/test_config.rs b/tests/test_config.rs index 7b0cd04..b350522 100644 --- a/tests/test_config.rs +++ b/tests/test_config.rs @@ -1,4 +1,5 @@ mod utils; +use assert_cmd::cargo_bin; use assert_cmd::prelude::*; use httpmock::MockServer; use predicates::prelude::*; @@ -12,8 +13,7 @@ fn read_in_config_file_for_settings() -> Result<(), Box> let (tmp_dir, file) = setup_tmp_directory(&["threads = 37".to_string()], "ferox-config.toml")?; - Command::cargo_bin("feroxbuster") - .unwrap() + Command::new(cargo_bin!("feroxbuster")) .current_dir(&tmp_dir) .arg("--url") .arg(srv.url("/")) diff --git a/tests/test_deny_list.rs b/tests/test_deny_list.rs index 668117b..5bba87f 100644 --- a/tests/test_deny_list.rs +++ b/tests/test_deny_list.rs @@ -1,9 +1,10 @@ mod utils; +use assert_cmd::cargo_bin; use assert_cmd::prelude::*; -use assert_cmd::Command; use httpmock::Method::GET; use httpmock::MockServer; use predicates::prelude::*; +use std::process::Command; use utils::{setup_tmp_directory, teardown_tmp_directory}; #[test] @@ -17,8 +18,7 @@ fn deny_list_works_during_with_a_normal_scan() { then.status(200).body("this is a test"); }); - let cmd = Command::cargo_bin("feroxbuster") - .unwrap() + let cmd = Command::new(cargo_bin!("feroxbuster")) .arg("--url") .arg(srv.url("/")) .arg("--wordlist") @@ -54,8 +54,7 @@ fn deny_list_works_during_extraction() { then.status(200); }); - let cmd = Command::cargo_bin("feroxbuster") - .unwrap() + let cmd = Command::new(cargo_bin!("feroxbuster")) .arg("--url") .arg(srv.url("/")) .arg("--wordlist") @@ -109,8 +108,7 @@ fn deny_list_works_during_recursion() { .body("this is a test and is more bytes than other ones"); }); - let cmd = Command::cargo_bin("feroxbuster") - .unwrap() + let cmd = Command::new(cargo_bin!("feroxbuster")) .arg("--url") .arg(srv.url("/")) .arg("--wordlist") @@ -179,8 +177,7 @@ fn deny_list_works_during_recursion_with_inverted_parents() { .body("this is a test and is more bytes than other ones"); }); - let cmd = Command::cargo_bin("feroxbuster") - .unwrap() + let cmd = Command::new(cargo_bin!("feroxbuster")) .arg("--url") .arg(srv.url("/js")) .arg("--wordlist") @@ -222,8 +219,7 @@ fn deny_list_prevents_regex_that_denies_base_url() { then.status(200).body("this is a test"); }); - let cmd = Command::cargo_bin("feroxbuster") - .unwrap() + let cmd = Command::new(cargo_bin!("feroxbuster")) .arg("--url") .arg(srv.url("/")) .arg("--wordlist") @@ -256,8 +252,7 @@ fn deny_list_prevents_url_that_denies_base_url() { then.status(200).body("this is a test"); }); - let cmd = Command::cargo_bin("feroxbuster") - .unwrap() + let cmd = Command::new(cargo_bin!("feroxbuster")) .arg("--url") .arg(srv.url("/")) .arg("--wordlist") diff --git a/tests/test_extractor.rs b/tests/test_extractor.rs index 4581678..4e75d13 100644 --- a/tests/test_extractor.rs +++ b/tests/test_extractor.rs @@ -1,4 +1,5 @@ mod utils; +use assert_cmd::cargo_bin; use assert_cmd::prelude::*; use httpmock::Method::GET; use httpmock::MockServer; @@ -25,8 +26,7 @@ fn extractor_finds_absolute_url() -> Result<(), Box> { then.status(200); }); - let cmd = Command::cargo_bin("feroxbuster") - .unwrap() + let cmd = Command::new(cargo_bin!("feroxbuster")) .arg("--url") .arg(srv.url("/")) .arg("--wordlist") @@ -61,8 +61,7 @@ fn extractor_finds_absolute_url_to_different_domain() -> Result<(), Box Result<(), Box> { then.status(200); }); - let cmd = Command::cargo_bin("feroxbuster") - .unwrap() + let cmd = Command::new(cargo_bin!("feroxbuster")) .arg("--url") .arg(srv.url("/")) .arg("--wordlist") @@ -151,8 +149,7 @@ fn extractor_finds_same_relative_url_twice() { then.status(200); }); - let cmd = Command::cargo_bin("feroxbuster") - .unwrap() + let cmd = Command::new(cargo_bin!("feroxbuster")) .arg("--url") .arg(srv.url("/")) .arg("--wordlist") @@ -194,8 +191,7 @@ fn extractor_finds_filtered_content() -> Result<(), Box> then.status(200).body("im a little teapot"); }); - let cmd = Command::cargo_bin("feroxbuster") - .unwrap() + let cmd = Command::new(cargo_bin!("feroxbuster")) .arg("--url") .arg(srv.url("/")) .arg("--wordlist") @@ -266,8 +262,7 @@ fn extractor_finds_robots_txt_links_and_displays_files_or_scans_directories() { then.status(403); }); - let cmd = Command::cargo_bin("feroxbuster") - .unwrap() + let cmd = Command::new(cargo_bin!("feroxbuster")) .arg("--url") .arg(srv.url("/")) .arg("--wordlist") @@ -341,8 +336,7 @@ fn extractor_finds_robots_txt_links_and_displays_files_non_recursive() { then.status(404); }); - let cmd = Command::cargo_bin("feroxbuster") - .unwrap() + let cmd = Command::new(cargo_bin!("feroxbuster")) .arg("--url") .arg(srv.url("/")) .arg("--wordlist") @@ -448,8 +442,7 @@ fn extractor_finds_directory_listing_links_and_displays_files() { then.status(200).body("im a little teapot too"); // 22 }); - let cmd = Command::cargo_bin("feroxbuster") - .unwrap() + let cmd = Command::new(cargo_bin!("feroxbuster")) .arg("--url") .arg(srv.url("/")) .arg("--wordlist") @@ -557,8 +550,7 @@ fn extractor_finds_directory_listing_links_and_displays_files_non_recursive() { then.status(200).body("im a little teapot too"); // 22 }); - let cmd = Command::cargo_bin("feroxbuster") - .unwrap() + let cmd = Command::new(cargo_bin!("feroxbuster")) .arg("--url") .arg(srv.url("/")) .arg("--wordlist") @@ -613,8 +605,7 @@ fn extractor_recurses_into_403_directories() -> Result<(), Box Result<(), Box> { let (tmp_dir, file) = setup_tmp_directory(&["LICENSE".to_string()], "wordlist")?; - Command::cargo_bin("feroxbuster") - .unwrap() + Command::new(cargo_bin!("feroxbuster")) .arg("--url") .arg("http://fjdksafjkdsajfkdsajkfdsajkfsdjkdsfdsafdsafdsajkr3l2ajfdskafdsjk") .arg("--wordlist") @@ -37,12 +37,11 @@ fn test_two_targets_cannot_connect() -> Result<(), Box> { let urls = vec![not_real.clone(), not_real]; let (tmp_dir, file) = setup_tmp_directory(&urls, "wordlist")?; - Command::cargo_bin("feroxbuster") - .unwrap() + Command::new(cargo_bin!("feroxbuster")) .arg("--stdin") .arg("--wordlist") .arg(file.as_os_str()) - .pipe_stdin(file) + .stdin(std::fs::File::open(file)?) .unwrap() .assert() .success() @@ -70,12 +69,11 @@ fn test_one_good_and_one_bad_target_scan_succeeds() -> Result<(), Box Result<(), Box Result<(), Box> { let (tmp_dir, file) = setup_tmp_directory(&["LICENSE".to_string()], "wordlist")?; - Command::cargo_bin("feroxbuster") - .unwrap() + Command::new(cargo_bin!("feroxbuster")) .arg("--url") .arg("https://expired.badssl.com") .arg("--wordlist") @@ -132,13 +129,11 @@ fn test_two_good_targets_scan_succeeds() -> Result<(), Box Result<(), Box then.status(200).body("this is a test"); }); - let cmd = Command::cargo_bin("feroxbuster") - .unwrap() + let cmd = Command::new(cargo_bin!("feroxbuster")) .arg("--url") .arg(srv.url("/")) .arg("--wordlist") @@ -205,8 +199,7 @@ fn heuristics_static_wildcard_request_with_dont_filter() -> Result<(), Box Result<(), Box> { then.status(200).body("this is a test"); }); - Command::cargo_bin("feroxbuster") - .unwrap() + Command::new(cargo_bin!("feroxbuster")) .arg("--url") .arg(srv.url("/")) .arg("--wordlist") @@ -65,14 +65,12 @@ fn main_use_empty_stdin_targets() -> Result<(), Box> { // get_targets is called before scan, so the empty wordlist shouldn't trigger // the 'Did not find any words' error - Command::cargo_bin("feroxbuster") - .unwrap() + Command::new(cargo_bin!("feroxbuster")) .arg("--stdin") .arg("--wordlist") .arg(file.as_os_str()) .arg("-vvv") - .pipe_stdin(file) - .unwrap() + .stdin(std::fs::File::open(file)?) .assert() .success() .stderr( @@ -106,8 +104,7 @@ fn main_parallel_spawns_children() -> Result<(), Box> { let (tgt_tmp_dir, targets) = setup_tmp_directory(&[t1.url("/"), t2.url("/"), t3.url("/")], "targets")?; - Command::cargo_bin("feroxbuster") - .unwrap() + Command::new(cargo_bin!("feroxbuster")) .env("RUST_LOG", "trace") .arg("--stdin") .arg("--parallel") @@ -117,8 +114,7 @@ fn main_parallel_spawns_children() -> Result<(), Box> { .arg(outfile.as_os_str()) .arg("--wordlist") .arg(wordlist.as_os_str()) - .pipe_stdin(targets) - .unwrap() + .stdin(std::fs::File::open(targets)?) .assert() .success() .stderr( @@ -170,8 +166,7 @@ fn main_parallel_creates_output_directory() -> Result<(), Box Result<(), Box Result<(), Box> { then.status(200); }); - Command::cargo_bin("feroxbuster") - .unwrap() + Command::new(cargo_bin!("feroxbuster")) .current_dir(&tmp_dir) .arg("--url") .arg(srv.url("/")) diff --git a/tests/test_parser.rs b/tests/test_parser.rs index 1ca5596..b96f6c9 100644 --- a/tests/test_parser.rs +++ b/tests/test_parser.rs @@ -1,5 +1,7 @@ -use assert_cmd::Command; +use assert_cmd::cargo_bin; +use assert_cmd::prelude::*; use predicates::prelude::*; +use std::process::Command; #[test] /// specify an incorrect param (-fc) with --help after it on the command line @@ -14,8 +16,7 @@ use predicates::prelude::*; /// the new behavior we expect to see is to print the long form help message, of which /// Ludicrous speed... go! is near the bottom of that output, so we can test for that fn parser_incorrect_param_with_tack_tack_help() { - Command::cargo_bin("feroxbuster") - .unwrap() + Command::new(cargo_bin!("feroxbuster")) .arg("-fc") .arg("--help") .assert() @@ -36,8 +37,7 @@ fn parser_incorrect_param_with_tack_tack_help() { /// the new behavior we expect to see is to print the short form help message, of which /// "[CAUTION] 4 -v's is probably too much" is near the bottom of that output, so we can test for that fn parser_incorrect_param_with_tack_h() { - Command::cargo_bin("feroxbuster") - .unwrap() + Command::new(cargo_bin!("feroxbuster")) .arg("-fc") .arg("-h") .assert() diff --git a/tests/test_policies.rs b/tests/test_policies.rs index e09e9e3..2e51cde 100644 --- a/tests/test_policies.rs +++ b/tests/test_policies.rs @@ -1,4 +1,5 @@ mod utils; +use assert_cmd::cargo_bin; use assert_cmd::prelude::*; use httpmock::Method::GET; use httpmock::MockServer; @@ -48,8 +49,7 @@ fn auto_bail_cancels_scan_with_403s() { .body("these guys need to be 403 in order to trigger 90% threshold"); }); - Command::cargo_bin("feroxbuster") - .unwrap() + Command::new(cargo_bin!("feroxbuster")) .arg("--url") .arg(srv.url("/")) .arg("--wordlist") @@ -130,8 +130,7 @@ fn auto_bail_cancels_scan_with_429s() { .body("these guys need to be 403 in order to trigger 90% threshold"); }); - Command::cargo_bin("feroxbuster") - .unwrap() + Command::new(cargo_bin!("feroxbuster")) .arg("--url") .arg(srv.url("/")) .arg("--wordlist") @@ -213,8 +212,7 @@ fn auto_tune_slows_scan_with_429s() { let start = Instant::now(); - Command::cargo_bin("feroxbuster") - .unwrap() + Command::new(cargo_bin!("feroxbuster")) .arg("--url") .arg(srv.url("/")) .arg("--wordlist") @@ -277,8 +275,7 @@ fn auto_tune_slows_scan_with_403s() { let start = Instant::now(); - Command::cargo_bin("feroxbuster") - .unwrap() + Command::new(cargo_bin!("feroxbuster")) .arg("--url") .arg(srv.url("/")) .arg("--wordlist") @@ -342,8 +339,7 @@ fn auto_tune_slows_scan_with_general_errors() { let start = Instant::now(); - Command::cargo_bin("feroxbuster") - .unwrap() + Command::new(cargo_bin!("feroxbuster")) .arg("--url") .arg(srv.url("/")) .arg("--wordlist") diff --git a/tests/test_rate_limiting.rs b/tests/test_rate_limiting.rs index a04314a..61cdbf6 100644 --- a/tests/test_rate_limiting.rs +++ b/tests/test_rate_limiting.rs @@ -1,10 +1,12 @@ mod utils; -use assert_cmd::Command; +use assert_cmd::cargo_bin; +use assert_cmd::prelude::*; use httpmock::prelude::*; use httpmock::MockServer; use regex::Regex; use std::fs::{read_to_string, write}; +use std::process::Command; use utils::{setup_tmp_directory, teardown_tmp_directory}; /// Helper to create a test wordlist with controllable patterns @@ -63,8 +65,7 @@ fn scenario_high_403_rate() { then.status(403).body("Forbidden"); }); - Command::cargo_bin("feroxbuster") - .unwrap() + Command::new(cargo_bin!("feroxbuster")) .arg("--url") .arg(srv.url("/")) .arg("--wordlist") @@ -124,8 +125,7 @@ fn scenario_high_429_rate() { then.status(429).body("Too Many Requests"); }); - Command::cargo_bin("feroxbuster") - .unwrap() + Command::new(cargo_bin!("feroxbuster")) .arg("--url") .arg(srv.url("/")) .arg("--wordlist") @@ -191,8 +191,7 @@ fn scenario_recovery_pattern() { then.status(403).body("Forbidden"); }); - Command::cargo_bin("feroxbuster") - .unwrap() + Command::new(cargo_bin!("feroxbuster")) .arg("--url") .arg(srv.url("/")) .arg("--wordlist") @@ -267,8 +266,7 @@ fn scenario_mixed_steady_state() { then.status(429).body("Too Many Requests"); }); - Command::cargo_bin("feroxbuster") - .unwrap() + Command::new(cargo_bin!("feroxbuster")) .arg("--url") .arg(srv.url("/")) .arg("--wordlist") @@ -340,8 +338,7 @@ fn scenario_capped_auto_tune() { then.status(403).body("Forbidden"); }); - Command::cargo_bin("feroxbuster") - .unwrap() + Command::new(cargo_bin!("feroxbuster")) .arg("--url") .arg(srv.url("/")) .arg("--wordlist") diff --git a/tests/test_response_size_limit.rs b/tests/test_response_size_limit.rs index 8d0ef45..a4eb0e4 100644 --- a/tests/test_response_size_limit.rs +++ b/tests/test_response_size_limit.rs @@ -1,4 +1,5 @@ mod utils; +use assert_cmd::cargo_bin; use assert_cmd::prelude::*; use httpmock::Method::GET; use httpmock::MockServer; @@ -19,8 +20,7 @@ fn response_size_limit_small_response_not_truncated() { then.status(200).body(small_body); }); - let cmd = Command::cargo_bin("feroxbuster") - .unwrap() + let cmd = Command::new(cargo_bin!("feroxbuster")) .arg("--url") .arg(srv.url("/")) .arg("--wordlist") @@ -55,8 +55,7 @@ fn response_size_limit_large_response_truncated() { then.status(200).body(&large_body); }); - let cmd = Command::cargo_bin("feroxbuster") - .unwrap() + let cmd = Command::new(cargo_bin!("feroxbuster")) .arg("--url") .arg(srv.url("/")) .arg("--wordlist") @@ -109,8 +108,7 @@ fn response_size_limit_mixed_response_sizes() { then.status(200).body(&large_body); }); - let cmd = Command::cargo_bin("feroxbuster") - .unwrap() + let cmd = Command::new(cargo_bin!("feroxbuster")) .arg("--url") .arg(srv.url("/")) .arg("--wordlist") @@ -173,8 +171,7 @@ fn response_size_limit_default_4mb() { then.status(200).body(&body); }); - let cmd = Command::cargo_bin("feroxbuster") - .unwrap() + let cmd = Command::new(cargo_bin!("feroxbuster")) .arg("--url") .arg(srv.url("/")) .arg("--wordlist") @@ -206,8 +203,7 @@ fn response_size_limit_very_small_limit() { then.status(200).body(body); }); - let cmd = Command::cargo_bin("feroxbuster") - .unwrap() + let cmd = Command::new(cargo_bin!("feroxbuster")) .arg("--url") .arg(srv.url("/")) .arg("--wordlist") @@ -242,8 +238,7 @@ fn response_size_limit_with_redirects() { .body(&large_redirect_body); }); - let cmd = Command::cargo_bin("feroxbuster") - .unwrap() + let cmd = Command::new(cargo_bin!("feroxbuster")) .arg("--url") .arg(srv.url("/")) .arg("--wordlist") @@ -281,8 +276,7 @@ fn response_size_limit_with_error_responses() { then.status(500).body(&large_error_body); }); - let cmd = Command::cargo_bin("feroxbuster") - .unwrap() + let cmd = Command::new(cargo_bin!("feroxbuster")) .arg("--url") .arg(srv.url("/")) .arg("--wordlist") @@ -318,8 +312,7 @@ fn response_size_limit_json_output_includes_truncated_field() { then.status(200).body(&large_body); }); - let cmd = Command::cargo_bin("feroxbuster") - .unwrap() + let cmd = Command::new(cargo_bin!("feroxbuster")) .arg("--url") .arg(srv.url("/")) .arg("--wordlist") @@ -350,8 +343,7 @@ fn response_size_limit_json_output_includes_truncated_field() { fn response_size_limit_shows_in_banner() { let (tmp_dir, file) = setup_tmp_directory(&["test".to_string()], "wordlist").unwrap(); - let cmd = Command::cargo_bin("feroxbuster") - .unwrap() + let cmd = Command::new(cargo_bin!("feroxbuster")) .arg("--url") .arg("http://127.0.0.1:1") // Non-existent server to trigger quick exit .arg("--wordlist") @@ -385,8 +377,7 @@ fn response_size_limit_exact_limit() { then.status(200).body(&exact_body); }); - let cmd = Command::cargo_bin("feroxbuster") - .unwrap() + let cmd = Command::new(cargo_bin!("feroxbuster")) .arg("--url") .arg(srv.url("/")) .arg("--wordlist") @@ -425,8 +416,7 @@ fn response_size_limit_from_config_file() { then.status(200).body(&large_body); }); - let cmd = Command::cargo_bin("feroxbuster") - .unwrap() + let cmd = Command::new(cargo_bin!("feroxbuster")) .current_dir(tmp_dir.path()) .arg("--url") .arg(srv.url("/")) diff --git a/tests/test_scan_manager.rs b/tests/test_scan_manager.rs index c0758fd..ba668b6 100644 --- a/tests/test_scan_manager.rs +++ b/tests/test_scan_manager.rs @@ -1,10 +1,12 @@ mod utils; -use assert_cmd::Command; +use assert_cmd::cargo_bin; +use assert_cmd::prelude::*; use httpmock::Method::GET; use httpmock::MockServer; use predicates::prelude::*; use std::fs::{read_to_string, write}; use std::path::Path; +use std::process::Command; use std::time; use utils::{setup_tmp_directory, teardown_tmp_directory}; @@ -67,8 +69,7 @@ fn resume_scan_works() { let (tmp_dir2, state_file) = setup_tmp_directory(&[state_file_contents], "state-file").unwrap(); - Command::cargo_bin("feroxbuster") - .unwrap() + Command::new(cargo_bin!("feroxbuster")) .arg("-vvv") .arg("--resume-from") .arg(state_file.as_os_str()) @@ -115,16 +116,14 @@ fn time_limit_enforced_when_specified() { let lower_bound = time::Duration::new(5, 0); let upper_bound = time::Duration::new(6, 0); - Command::cargo_bin("feroxbuster") - .unwrap() + Command::new(cargo_bin!("feroxbuster")) .arg("--stdin") .arg("-vv") .arg("--wordlist") .arg(file.as_os_str()) .arg("--time-limit") .arg("5s") - .pipe_stdin(targets) - .unwrap() + .stdin(std::fs::File::open(targets).unwrap()) .assert() .failure(); diff --git a/tests/test_scanner.rs b/tests/test_scanner.rs index 058029d..612009e 100644 --- a/tests/test_scanner.rs +++ b/tests/test_scanner.rs @@ -1,4 +1,5 @@ mod utils; +use assert_cmd::cargo_bin; use assert_cmd::prelude::*; use httpmock::Method::GET; use httpmock::MockServer; @@ -19,8 +20,7 @@ fn scanner_single_request_scan() -> Result<(), Box> { then.status(200).body("this is a test"); }); - let cmd = Command::cargo_bin("feroxbuster") - .unwrap() + let cmd = Command::new(cargo_bin!("feroxbuster")) .arg("--url") .arg(srv.url("/")) .arg("--wordlist") @@ -72,8 +72,7 @@ fn scanner_recursive_request_scan() -> Result<(), Box> { .body("this is a test and is more bytes than other ones"); }); - let cmd = Command::cargo_bin("feroxbuster") - .unwrap() + let cmd = Command::new(cargo_bin!("feroxbuster")) .arg("--url") .arg(srv.url("/")) .arg("--wordlist") @@ -135,8 +134,7 @@ fn scanner_recursive_request_scan_using_only_success_responses( .body("this is a test and is more bytes than other ones"); }); - let cmd = Command::cargo_bin("feroxbuster") - .unwrap() + let cmd = Command::new(cargo_bin!("feroxbuster")) .arg("--url") .arg(srv.url("/")) .arg("--wordlist") @@ -178,8 +176,7 @@ fn scanner_single_request_scan_with_file_output() -> Result<(), Box Result<(), Box Result<(), Box> then.status(200).body("this is a test"); }); - let cmd = Command::cargo_bin("feroxbuster") - .unwrap() + let cmd = Command::new(cargo_bin!("feroxbuster")) .arg("--url") .arg(srv.url("/")) .arg("--wordlist") @@ -317,8 +311,7 @@ fn scanner_single_request_returns_301_without_location_header( then.status(301).body("this is a test"); }); - let cmd = Command::cargo_bin("feroxbuster") - .unwrap() + let cmd = Command::new(cargo_bin!("feroxbuster")) .arg("--url") .arg(srv.url("/")) .arg("--wordlist") @@ -358,8 +351,7 @@ fn scanner_single_request_replayed_to_proxy() -> Result<(), Box Result<(), Box Result<(), Box Result<(), Box