Merge pull request #375 from projectdiscovery/bugfix-passive-total

passive total fix
master
PD-Team 2021-02-18 23:34:55 +05:30 committed by GitHub
commit 6dfdf088ac
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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(`^(?:\d{1,3}\.){3}\d{1,3}\\032`)