diff --git a/pkg/scraper/sources/crtsh/crtsh.go b/pkg/scraper/sources/crtsh/crtsh.go index fa8df28..0d1af49 100644 --- a/pkg/scraper/sources/crtsh/crtsh.go +++ b/pkg/scraper/sources/crtsh/crtsh.go @@ -81,19 +81,22 @@ func (source *Source) Run(_ *sources.Configuration, domain string) <-chan source for index := range getNameValuesResData { record := getNameValuesResData[index] + subdomains := strings.Split(record.NameValue, "\n") - for _, value := range strings.Split(record.NameValue, "\n") { - match := regex.FindAllString(value, -1) + for index := range subdomains { + subdomain := subdomains[index] - for _, subdomain := range match { - result := sources.Result{ - Type: sources.Subdomain, - Source: source.Name(), - Value: subdomain, - } + if !regex.MatchString(subdomain) { + continue + } - results <- result + result := sources.Result{ + Type: sources.Subdomain, + Source: source.Name(), + Value: subdomain, } + + results <- result } } }()