Skip to content

Commit

Permalink
Do not force insert of root target.
Browse files Browse the repository at this point in the history
Forcing the insert lead to false positives when you search for a invalid subdomain because there are not checks but just force the insert so, we never had a target with no subdomains found.
  • Loading branch information
Edu4rdSHL committed Mar 27, 2020
1 parent 6f90161 commit 0c8a87d
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
1 change: 0 additions & 1 deletion src/lib.rs
Expand Up @@ -157,7 +157,6 @@ fn search_subdomains(args: &mut args::Args) -> HashSet<String> {
].into_iter().map(|j| j.join().unwrap()).collect::<Vec<_>>().into_iter().flatten().flatten().collect();

all_subdomains.retain(|sub| misc::validate_subdomain(&base_target, &sub));
all_subdomains.insert(args.target.clone());
all_subdomains
}

Expand Down
2 changes: 1 addition & 1 deletion src/misc.rs
Expand Up @@ -215,7 +215,7 @@ pub fn return_facebook_token() -> String {
pub fn validate_subdomain(base_target: &str, subdomain: &str) -> bool {
!subdomain.is_empty()
&& !subdomain.starts_with('.')
&& subdomain.ends_with(base_target)
&& (subdomain.ends_with(base_target) || subdomain == args.target)
&& !subdomain.contains(&SPECIAL_CHARS[..])
&& subdomain.chars().all(|c| c.is_ascii())
}
Expand Down

0 comments on commit 0c8a87d

Please sign in to comment.