From 7da1ad62c9335e3319e9ff02425c8919352ed6eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Zamanillo?= Date: Wed, 9 Nov 2022 11:51:57 +0100 Subject: [PATCH] omnisint from Sonar Labs is dead, is not working anymore --- DISCLAIMER.md | 2 +- v2/pkg/passive/sources.go | 2 - v2/pkg/passive/sources_test.go | 3 - .../sources/sonarsearch/sonarsearch.go | 74 ------------------- 4 files changed, 1 insertion(+), 80 deletions(-) delete mode 100644 v2/pkg/subscraping/sources/sonarsearch/sonarsearch.go diff --git a/DISCLAIMER.md b/DISCLAIMER.md index 54da2a428..114a152ec 100644 --- a/DISCLAIMER.md +++ b/DISCLAIMER.md @@ -2,7 +2,7 @@ Subfinder leverages multiple open APIs, it is developed for individuals to help them for research or internal work. If you wish to incorporate this tool into a commercial offering or purposes, you must agree to the Terms of the leveraged services: -- Project Sonar / Bufferover: https://opendata.rapid7.com/about / [https://tls.bufferover.run](https://tls.bufferover.run/dns?q) +- Bufferover: https://tls.bufferover.run - CommonCrawl: https://commoncrawl.org/terms-of-use/full - certspotter: https://sslmate.com/terms - dnsdumpster: https://hackertarget.com/terms diff --git a/v2/pkg/passive/sources.go b/v2/pkg/passive/sources.go index 2544742f0..882aeee20 100644 --- a/v2/pkg/passive/sources.go +++ b/v2/pkg/passive/sources.go @@ -36,7 +36,6 @@ import ( "github.com/projectdiscovery/subfinder/v2/pkg/subscraping/sources/securitytrails" "github.com/projectdiscovery/subfinder/v2/pkg/subscraping/sources/shodan" "github.com/projectdiscovery/subfinder/v2/pkg/subscraping/sources/sitedossier" - "github.com/projectdiscovery/subfinder/v2/pkg/subscraping/sources/sonarsearch" "github.com/projectdiscovery/subfinder/v2/pkg/subscraping/sources/threatbook" "github.com/projectdiscovery/subfinder/v2/pkg/subscraping/sources/threatminer" "github.com/projectdiscovery/subfinder/v2/pkg/subscraping/sources/virustotal" @@ -74,7 +73,6 @@ var AllSources = [...]subscraping.Source{ &securitytrails.Source{}, &shodan.Source{}, &sitedossier.Source{}, - &sonarsearch.Source{}, &threatbook.Source{}, &threatminer.Source{}, &virustotal.Source{}, diff --git a/v2/pkg/passive/sources_test.go b/v2/pkg/passive/sources_test.go index 4ff093fc6..efa1db666 100644 --- a/v2/pkg/passive/sources_test.go +++ b/v2/pkg/passive/sources_test.go @@ -39,7 +39,6 @@ var ( "securitytrails", "shodan", "sitedossier", - "sonarsearch", "threatbook", "threatminer", "virustotal", @@ -87,7 +86,6 @@ var ( "hackertarget", "passivetotal", "securitytrails", - "sonarsearch", "virustotal", } ) @@ -114,7 +112,6 @@ func TestSourceCategorization(t *testing.T) { func TestSourceFiltering(t *testing.T) { someSources := []string{ "alienvault", - "sonarsearch", "chaos", "virustotal", } diff --git a/v2/pkg/subscraping/sources/sonarsearch/sonarsearch.go b/v2/pkg/subscraping/sources/sonarsearch/sonarsearch.go deleted file mode 100644 index 3b9c389bc..000000000 --- a/v2/pkg/subscraping/sources/sonarsearch/sonarsearch.go +++ /dev/null @@ -1,74 +0,0 @@ -// Package sonarsearch logic -package sonarsearch - -import ( - "context" - "encoding/json" - "fmt" - "strconv" - - "github.com/projectdiscovery/subfinder/v2/pkg/subscraping" -) - -// Source is the passive scraping agent -type Source struct{} - -// Run function returns all subdomains found with the service -func (s *Source) Run(ctx context.Context, domain string, session *subscraping.Session) <-chan subscraping.Result { - results := make(chan subscraping.Result) - go func() { - defer close(results) - - getURL := fmt.Sprintf("https://sonar.omnisint.io/subdomains/%s?page=", domain) - page := 0 - var subdomains []string - for { - resp, err := session.SimpleGet(ctx, getURL+strconv.Itoa(page)) - if err != nil { - results <- subscraping.Result{Source: s.Name(), Type: subscraping.Error, Error: err} - session.DiscardHTTPResponse(resp) - return - } - - if err := json.NewDecoder(resp.Body).Decode(&subdomains); err != nil { - results <- subscraping.Result{Source: s.Name(), Type: subscraping.Error, Error: err} - resp.Body.Close() - return - } - resp.Body.Close() - - if len(subdomains) == 0 { - return - } - - for _, subdomain := range subdomains { - results <- subscraping.Result{Source: s.Name(), Type: subscraping.Subdomain, Value: subdomain} - } - - page++ - } - }() - - return results -} - -// Name returns the name of the source -func (s *Source) Name() string { - return "sonarsearch" -} - -func (s *Source) IsDefault() bool { - return false -} - -func (s *Source) HasRecursiveSupport() bool { - return true -} - -func (s *Source) NeedsKey() bool { - return false -} - -func (s *Source) AddApiKeys(_ []string) { - // no key needed -}