mirror of
https://github.com/epi052/feroxbuster.git
synced 2026-06-01 13:01:19 -03:00
Remove iis heuristic, fix test cases
This commit is contained in:
@@ -413,14 +413,13 @@ impl<'a> Extractor<'a> {
|
||||
// Index of /: apache
|
||||
// Directory Listing for /: tomcat,
|
||||
// Directory Listing -- /: ASP.NET
|
||||
// <host> - /: iis, azure
|
||||
// <host> - /: iis, azure, skipping due to loose heuristic
|
||||
let title_selector = Selector::parse("title").unwrap();
|
||||
for t in html.select(&title_selector) {
|
||||
let title = t.inner_html().to_lowercase();
|
||||
if title.contains("directory listing for /")
|
||||
|| title.contains("index of /")
|
||||
|| title.contains("directory listing -- /")
|
||||
|| title.contains(&format!("{} - /", url.host_str().unwrap().to_lowercase()))
|
||||
{
|
||||
log::debug!("Directory listing heuristic detection from \"{}\"", title);
|
||||
let msg = format!(
|
||||
|
||||
@@ -466,7 +466,7 @@ fn extractor_finds_directory_listing_links_and_displays_files() {
|
||||
.and(predicate::str::contains("22c"))
|
||||
.and(predicate::str::contains("/misc/LICENSE"))
|
||||
.and(predicate::str::contains("29c"))
|
||||
.and(predicate::str::contains("200").count(3)),
|
||||
.and(predicate::str::contains("200").count(5)),
|
||||
);
|
||||
|
||||
assert_eq!(mock_root.hits(), 2);
|
||||
@@ -577,7 +577,7 @@ fn extractor_finds_directory_listing_links_and_displays_files_non_recursive() {
|
||||
.not()
|
||||
.and(predicate::str::contains("/misc/LICENSE").not())
|
||||
.and(predicate::str::contains("29c").not())
|
||||
.and(predicate::str::contains("200").count(1)),
|
||||
.and(predicate::str::contains("200").count(2)),
|
||||
);
|
||||
|
||||
assert_eq!(mock_root.hits(), 2);
|
||||
|
||||
Reference in New Issue
Block a user