From 0f75701e65c9a9ac4ec5c3b3608db7ecfb7600f9 Mon Sep 17 00:00:00 2001 From: Muhammad Daffa Date: Thu, 21 Jul 2022 21:30:28 +0700 Subject: [PATCH] Fix broken link, sorting source, and fix bufferover --- README.md | 2 +- v2/pkg/passive/sources.go | 8 ++++---- v2/pkg/runner/config.go | 4 ++-- v2/pkg/subscraping/sources/bufferover/bufferover.go | 4 ---- v2/pkg/subscraping/types.go | 6 +++--- 5 files changed, 10 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index abda7623b..1421865fa 100644 --- a/README.md +++ b/README.md @@ -109,7 +109,7 @@ go install -v github.com/projectdiscovery/subfinder/v2/cmd/subfinder@latest Subfinder will work after using the installation instructions however to configure Subfinder to work with certain services, you will need to have setup API keys. The following services do not work without an API key: -[Binaryedge](https://binaryedge.io), [C99](https://api.c99.nl/), [Certspotter](https://sslmate.com/certspotter/api/), [Chinaz](http://my.chinaz.com/ChinazAPI/DataCenter/MyDataApi), [Censys](https://censys.io), [Chaos](https://chaos.projectdiscovery.io), [DnsDB](https://api.dnsdb.info), [Fofa](https://fofa.so/static_pages/api_help), [Github](https://github.com), [Intelx](https://intelx.io), [Passivetotal](http://passivetotal.org), [Robtex](https://www.robtex.com/api/), [SecurityTrails](http://securitytrails.com), [Shodan](https://shodan.io), [Threatbook](https://x.threatbook.cn/en), [Virustotal](https://www.virustotal.com), [Zoomeye](https://www.zoomeye.org) +[Binaryedge](https://binaryedge.io), [C99](https://api.c99.nl/), [Certspotter](https://sslmate.com/certspotter/api/), [Chinaz](http://my.chinaz.com/ChinazAPI/DataCenter/MyDataApi), [Censys](https://censys.io), [Chaos](https://chaos.projectdiscovery.io), [DnsDB](https://api.dnsdb.info), [Fofa](https://fofa.info/static_pages/api_help), [Github](https://github.com), [Intelx](https://intelx.io), [Passivetotal](http://passivetotal.org), [Robtex](https://www.robtex.com/api/), [SecurityTrails](http://securitytrails.com), [Shodan](https://shodan.io), [Threatbook](https://x.threatbook.cn/en), [Virustotal](https://www.virustotal.com), [Zoomeye](https://www.zoomeye.org) These values are stored in the `$HOME/.config/subfinder/provider-config.yaml` file which will be created when you run the tool for the first time. The configuration file uses the YAML format. Multiple API keys can be specified for each of these services from which one of them will be used for enumeration. diff --git a/v2/pkg/passive/sources.go b/v2/pkg/passive/sources.go index 209747799..d6ba66553 100644 --- a/v2/pkg/passive/sources.go +++ b/v2/pkg/passive/sources.go @@ -51,6 +51,8 @@ var DefaultSources = []string{ "chinaz", "crtsh", "dnsdumpster", + "fofa", + "fullhunt", "hackertarget", "intelx", "passivetotal", @@ -62,8 +64,6 @@ var DefaultSources = []string{ "threatcrowd", "threatminer", "virustotal", - "fofa", - "fullhunt", } // DefaultRecursiveSources contains list of default recursive sources @@ -97,6 +97,8 @@ var DefaultAllSources = []string{ "crtsh", "dnsdumpster", "dnsdb", + "fofa", + "fullhunt", "github", "hackertarget", "intelx", @@ -116,8 +118,6 @@ var DefaultAllSources = []string{ "waybackarchive", "zoomeye", "zoomeyeapi", - "fofa", - "fullhunt", } // Agent is a struct for running passive subdomain enumeration diff --git a/v2/pkg/runner/config.go b/v2/pkg/runner/config.go index d3cdc3a07..d6eed9e4a 100644 --- a/v2/pkg/runner/config.go +++ b/v2/pkg/runner/config.go @@ -23,6 +23,8 @@ type Providers struct { Chaos []string `yaml:"chaos"` Chinaz []string `yaml:"chinaz"` DNSDB []string `yaml:"dnsdb"` + Fofa []string `yaml:"fofa"` + FullHunt []string `json:"fullhunt"` GitHub []string `yaml:"github"` IntelX []string `yaml:"intelx"` PassiveTotal []string `yaml:"passivetotal"` @@ -34,8 +36,6 @@ type Providers struct { Virustotal []string `yaml:"virustotal"` ZoomEye []string `yaml:"zoomeye"` ZoomEyeApi []string `yaml:"zoomeyeapi"` - Fofa []string `yaml:"fofa"` - FullHunt []string `json:"fullhunt"` } // GetConfigDirectory gets the subfinder config directory for a user diff --git a/v2/pkg/subscraping/sources/bufferover/bufferover.go b/v2/pkg/subscraping/sources/bufferover/bufferover.go index 3f3fb2aa5..caea4d366 100644 --- a/v2/pkg/subscraping/sources/bufferover/bufferover.go +++ b/v2/pkg/subscraping/sources/bufferover/bufferover.go @@ -30,14 +30,10 @@ func (s *Source) Run(ctx context.Context, domain string, session *subscraping.Se go func() { defer close(results) - // DNS data does not rely on an API key. - s.getData(ctx, fmt.Sprintf("https://dns.bufferover.run/dns?q=.%s", domain), "", session, results) - if session.Keys.Bufferover == "" { return } - // TLS data relies on an API key. s.getData(ctx, fmt.Sprintf("https://tls.bufferover.run/dns?q=.%s", domain), session.Keys.Bufferover, session, results) }() diff --git a/v2/pkg/subscraping/types.go b/v2/pkg/subscraping/types.go index 9204c0375..0cc6415b4 100644 --- a/v2/pkg/subscraping/types.go +++ b/v2/pkg/subscraping/types.go @@ -48,6 +48,9 @@ type Keys struct { Chaos string `json:"chaos"` Chinaz string `json:"chinaz"` DNSDB string `json:"dnsdb"` + FofaUsername string `json:"fofa_username"` + FofaSecret string `json:"fofa_secret"` + FullHunt string `json:"fullhunt"` GitHub []string `json:"github"` IntelXHost string `json:"intelXHost"` IntelXKey string `json:"intelXKey"` @@ -62,9 +65,6 @@ type Keys struct { ZoomEyeUsername string `json:"zoomeye_username"` ZoomEyePassword string `json:"zoomeye_password"` ZoomEyeKey string `json:"zoomeye_key"` - FofaUsername string `json:"fofa_username"` - FofaSecret string `json:"fofa_secret"` - FullHunt string `json:"fullhunt"` } // Result is a result structure returned by a source