File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed
Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -210,7 +210,15 @@ impl Plugin for DNS {
210210 creds : & Credentials ,
211211 timeout : Duration ,
212212 ) -> Result < Option < Vec < Loot > > , Error > {
213- let subdomain = format ! ( "{}.{}" , creds. single( ) , & creds. target) . to_lowercase ( ) ;
213+ // make sure we only extract the host from the target
214+ let target_host = if let Ok ( url) = url:: Url :: parse ( & creds. target ) {
215+ url. host_str ( ) . unwrap_or ( & creds. target ) . to_string ( )
216+ } else {
217+ // If not a valid URL, treat as hostname directly
218+ creds. target . clone ( )
219+ } ;
220+
221+ let subdomain = format ! ( "{}.{}" , creds. single( ) , & target_host) . to_lowercase ( ) ;
214222 // skip domains that have already been processed
215223 if self . domains . contains ( & subdomain) {
216224 return Ok ( None ) ;
You can’t perform that action at this time.
0 commit comments