passive total bugfix

master
Mzack9999 2021-02-17 18:28:55 +01:00
parent e654b946d6
commit 63f39b65dc
1 changed files with 7 additions and 0 deletions

View File

@ -3,6 +3,7 @@ package passivetotal
import (
"bytes"
"context"
"regexp"
jsoniter "github.com/json-iterator/go"
"github.com/projectdiscovery/subfinder/v2/pkg/subscraping"
@ -54,6 +55,10 @@ func (s *Source) Run(ctx context.Context, domain string, session *subscraping.Se
resp.Body.Close()
for _, subdomain := range data.Subdomains {
// skip entries like xxx.xxx.xxx.xxx\032domain.tld
if passiveTotalFilterRegex.MatchString(subdomain) {
continue
}
finalSubdomain := subdomain + "." + domain
results <- subscraping.Result{Source: s.Name(), Type: subscraping.Subdomain, Value: finalSubdomain}
}
@ -66,3 +71,5 @@ func (s *Source) Run(ctx context.Context, domain string, session *subscraping.Se
func (s *Source) Name() string {
return "passivetotal"
}
var passiveTotalFilterRegex *regexp.Regexp = regexp.MustCompile(`^(?:[0-9]{1,3}\.){3}[0-9]{1,3}\\032`)