From efa1a6ecc8202e71d8180ae9803ff3933c8445b8 Mon Sep 17 00:00:00 2001 From: Dwi Siswanto Date: Wed, 2 Oct 2024 04:13:01 +0700 Subject: [PATCH] fix(shodan): incorrect subdomains concatenate (#1392) * fix: shodan source filter subdomains properly * Update v2/pkg/subscraping/sources/shodan/shodan.go Co-authored-by: Dwi Siswanto * Revert "Update v2/pkg/subscraping/sources/shodan/shodan.go" This reverts commit 556df0266223933b41662d112c609391e0800f3c. * feat(shodan): rm `strings.HasSuffix` filter Signed-off-by: Dwi Siswanto --------- Signed-off-by: Dwi Siswanto Co-authored-by: Gby56 Co-authored-by: Gabriel Marquet --- v2/pkg/subscraping/sources/shodan/shodan.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/v2/pkg/subscraping/sources/shodan/shodan.go b/v2/pkg/subscraping/sources/shodan/shodan.go index 688f07bee..8d4925d79 100644 --- a/v2/pkg/subscraping/sources/shodan/shodan.go +++ b/v2/pkg/subscraping/sources/shodan/shodan.go @@ -75,8 +75,9 @@ func (s *Source) Run(ctx context.Context, domain string, session *subscraping.Se } for _, data := range response.Subdomains { + value := fmt.Sprintf("%s.%s", data, response.Domain) results <- subscraping.Result{ - Source: s.Name(), Type: subscraping.Subdomain, Value: fmt.Sprintf("%s.%s", data, domain), + Source: s.Name(), Type: subscraping.Subdomain, Value: value, } s.results++ }