go install -v github.com/projectdiscovery/subfinder/v2/cmd/subfinder@latest
Subfinder requires the latest GO version to install successfully.

Installation notes

  • Subfinder requires the latest version of Go
  • Add the Go bin path to the system paths. On OSX or Linux, in your terminal use
echo export PATH=$PATH:$HOME/go/bin >> $home/.bashrc
source $home/.bashrc

Post install configuration

Subfinder is available immediately after installation, however the following services require the configuration of API keys to work:

BeVigil, BinaryEdge, BufferOver, C99, Censys, CertSpotter, Chaos, Chinaz, DNSDB, Fofa, FullHunt, GitHub, Intelx, PassiveTotal, quake, Robtex, SecurityTrails, Shodan, ThreatBook, VirusTotal, WhoisXML API, ZoomEye API china - worldwide, dnsrepo, Hunter, Facebook, BuiltWith

You can also use the subfinder -ls command to display all the available sources.

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.

Composite keys for sources like, Censys, PassiveTotal, Fofa, Intellix and 360quake, need to be separated with a colon (:).

Example provider config

An example provider config file:

binaryedge:
  - 0bf8919b-aab9-42e4-9574-d3b639324597
  - ac244e2f-b635-4581-878a-33f4e79a2c13
censys:
  - ac244e2f-b635-4581-878a-33f4e79a2c13:dd510d6e-1b6e-4655-83f6-f347b363def9
certspotter: []
passivetotal:
  - sample-email@user.com:sample_password
redhuntlabs:
  - ENDPOINT:API_TOKEN
  - https://reconapi.redhuntlabs.com/community/v1/domains/subdomains:joEPzJJp2AuOCw7teAj63HYrPGnsxuPQ
securitytrails: []
shodan:
  - AAAAClP1bJJSRMEYJazgwhJKrggRwKA
github:
  - ghp_lkyJGU3jv1xmwk4SDXavrLDJ4dl2pSJMzj4X
  - ghp_gkUuhkIYdQPj13ifH4KA3cXRn8JD2lqir2d4
zoomeyeapi:
  - zoomeye.hk:4f73021d-ff95-4f53-937f-83d6db719eec
quake:
  - 0cb9030c-0a40-48a3-b8c4-fca28e466ba3
facebook:
  - APP_ID:APP_SECRET
intelx:
  - HOST:API_KEY
  - 2.intelx.io:s4324-b98b-41b2-220e8-3320f6a1284d

RedHunt Lab Attack Surface Recon API

RedHunt Labs’s Attack Surface Recon API has different API endpoints depending on the user’s subscription. Make sure to add the appropriate endpoint before running any scans.

ZoomEye API

Before conducting any scans, please ensure you are using the correct host to comply with geographical access restrictions of the ZoomEye API:

  • zoomeye.org is exclusively for users within China.
  • zoomeye.hk is for users outside China.