passive total bugfix
parent
e654b946d6
commit
63f39b65dc
|
@ -3,6 +3,7 @@ package passivetotal
|
||||||
import (
|
import (
|
||||||
"bytes"
|
"bytes"
|
||||||
"context"
|
"context"
|
||||||
|
"regexp"
|
||||||
|
|
||||||
jsoniter "github.com/json-iterator/go"
|
jsoniter "github.com/json-iterator/go"
|
||||||
"github.com/projectdiscovery/subfinder/v2/pkg/subscraping"
|
"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()
|
resp.Body.Close()
|
||||||
|
|
||||||
for _, subdomain := range data.Subdomains {
|
for _, subdomain := range data.Subdomains {
|
||||||
|
// skip entries like xxx.xxx.xxx.xxx\032domain.tld
|
||||||
|
if passiveTotalFilterRegex.MatchString(subdomain) {
|
||||||
|
continue
|
||||||
|
}
|
||||||
finalSubdomain := subdomain + "." + domain
|
finalSubdomain := subdomain + "." + domain
|
||||||
results <- subscraping.Result{Source: s.Name(), Type: subscraping.Subdomain, Value: finalSubdomain}
|
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 {
|
func (s *Source) Name() string {
|
||||||
return "passivetotal"
|
return "passivetotal"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var passiveTotalFilterRegex *regexp.Regexp = regexp.MustCompile(`^(?:[0-9]{1,3}\.){3}[0-9]{1,3}\\032`)
|
||||||
|
|
Loading…
Reference in New Issue