Skip to content

Commit

Permalink
passive total bugfix
Browse files Browse the repository at this point in the history
  • Loading branch information
Mzack9999 committed Feb 17, 2021
1 parent e654b94 commit 63f39b6
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions v2/pkg/subscraping/sources/passivetotal/passivetotal.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package passivetotal
import (
"bytes"
"context"
"regexp"

jsoniter "github.com/json-iterator/go"
"github.com/projectdiscovery/subfinder/v2/pkg/subscraping"
Expand Down Expand Up @@ -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}
}
Expand All @@ -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`)

0 comments on commit 63f39b6

Please sign in to comment.