• Stars
    star
    9,100
  • Rank 3,749 (Top 0.08 %)
  • Language
    Go
  • License
    MIT License
  • Created about 6 years ago
  • Updated about 2 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Fast passive subdomain enumeration tool.

subfinder

Fast passive subdomain enumeration tool.

Features • Install • Usage • API Setup • Library • Join Discord


subfinder is a subdomain discovery tool that returns valid subdomains for websites, using passive online sources. It has a simple, modular architecture and is optimized for speed. subfinder is built for doing one thing only - passive subdomain enumeration, and it does that very well.

We have made it to comply with all the used passive source licenses and usage restrictions. The passive model guarantees speed and stealthiness that can be leveraged by both penetration testers and bug bounty hunters alike.

Features

subfinder

  • Fast and powerful resolution and wildcard elimination modules
  • Curated passive sources to maximize results
  • Multiple output formats supported (JSON, file, stdout)
  • Optimized for speed and lightweight on resources
  • STDIN/OUT support enables easy integration into workflows

Usage

subfinder -h

This will display help for the tool. Here are all the switches it supports.

Usage:
  ./subfinder [flags]

Flags:
INPUT:
  -d, -domain string[]  domains to find subdomains for
  -dL, -list string     file containing list of domains for subdomain discovery

SOURCE:
  -s, -sources string[]           specific sources to use for discovery (-s crtsh,github). Use -ls to display all available sources.
  -recursive                      use only sources that can handle subdomains recursively (e.g. subdomain.domain.tld vs domain.tld)
  -all                            use all sources for enumeration (slow)
  -es, -exclude-sources string[]  sources to exclude from enumeration (-es alienvault,zoomeye)

FILTER:
  -m, -match string[]   subdomain or list of subdomain to match (file or comma separated)
  -f, -filter string[]   subdomain or list of subdomain to filter (file or comma separated)

RATE-LIMIT:
  -rl, -rate-limit int  maximum number of http requests to send per second
  -rls value            maximum number of http requests to send per second four providers in key=value format (-rls "hackertarget=10/s,shodan=15/s")
  -t int                number of concurrent goroutines for resolving (-active only) (default 10)

UPDATE:
   -up, -update                 update subfinder to latest version
   -duc, -disable-update-check  disable automatic subfinder update check

OUTPUT:
  -o, -output string       file to write output to
  -oJ, -json               write output in JSONL(ines) format
  -oD, -output-dir string  directory to write output (-dL only)
  -cs, -collect-sources    include all sources in the output (-json only)
  -oI, -ip                 include host IP in output (-active only)

CONFIGURATION:
  -config string                flag config file (default "$HOME/.config/subfinder/config.yaml")
  -pc, -provider-config string  provider config file (default "$HOME/.config/subfinder/provider-config.yaml")
  -r string[]                   comma separated list of resolvers to use
  -rL, -rlist string            file containing list of resolvers to use
  -nW, -active                  display active subdomains only
  -proxy string                 http proxy to use with subfinder
  -ei, -exclude-ip              exclude IPs from the list of domains

DEBUG:
  -silent             show only subdomains in output
  -version            show version of subfinder
  -v                  show verbose output
  -nc, -no-color      disable color in output
  -ls, -list-sources  list all available sources

OPTIMIZATION:
  -timeout int   seconds to wait before timing out (default 30)
  -max-time int  minutes to wait for enumeration results (default 10)

Installation

subfinder requires go1.20 to install successfully. Run the following command to install the latest version:

go install -v github.com/projectdiscovery/subfinder/v2/cmd/subfinder@latest

Post Installation Instructions

subfinder can be used right after the installation, however the following services require configuring 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, ZoomEye API, dnsrepo, Hunter, Facebook

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, 360quake and ZoomEye, need to be separated with a colon (:).

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:
  - [email protected]:sample_password
securitytrails: []
shodan:
  - AAAAClP1bJJSRMEYJazgwhJKrggRwKA
github:
  - ghp_lkyJGU3jv1xmwk4SDXavrLDJ4dl2pSJMzj4X
  - ghp_gkUuhkIYdQPj13ifH4KA3cXRn8JD2lqir2d4
zoomeye:
  - ZOOMEYE_USERNAME:ZOOMEYE_PASSWORD
quake:
  - 0cb9030c-0a40-48a3-b8c4-fca28e466ba3
facebook:
  - APP_ID:APP_SECRET
intelx:
  - HOST:API_KEY
  - 2.intelx.io:s4324-b98b-41b2-220e8-3320f6a1284d

Running Subfinder

To run the tool on a target, just use the following command.

subfinder -d hackerone.com

               __    _____           __         
   _______  __/ /_  / __(_)___  ____/ /__  _____
  / ___/ / / / __ \/ /_/ / __ \/ __  / _ \/ ___/
 (__  ) /_/ / /_/ / __/ / / / / /_/ /  __/ /    
/____/\__,_/_.___/_/ /_/_/ /_/\__,_/\___/_/ v2.4.9

		projectdiscovery.io

Use with caution. You are responsible for your actions
Developers assume no liability and are not responsible for any misuse or damage.
By using subfinder, you also agree to the terms of the APIs used.

[INF] Enumerating subdomains for hackerone.com

www.hackerone.com
support.hackerone.com
links.hackerone.com
api.hackerone.com
o1.email.hackerone.com
go.hackerone.com
3d.hackerone.com
resources.hackerone.com
a.ns.hackerone.com
b.ns.hackerone.com
mta-sts.hackerone.com
docs.hackerone.com
mta-sts.forwarding.hackerone.com
gslink.hackerone.com
hackerone.com
info.hackerone.com
mta-sts.managed.hackerone.com
events.hackerone.com

[INF] Found 18 subdomains for hackerone.com in 3 seconds 672 milliseconds

The subdomains discovered can be piped to other tools too. For example, you can pipe the discovered subdomains to httpx which will then find running HTTP servers on the host.

echo hackerone.com | subfinder -silent | httpx -silent

http://hackerone.com
http://www.hackerone.com
http://docs.hackerone.com
http://api.hackerone.com
https://docs.hackerone.com
http://mta-sts.managed.hackerone.com

Subfinder with docker

Pull the latest tagged subfinder docker image:

docker pull projectdiscovery/subfinder:latest

Running subfinder using the docker image:

docker run projectdiscovery/subfinder:latest -d hackerone.com

Running subfinder using the docker image, with a local config file:

docker run -v $HOME/.config/subfinder:/root/.config/subfinder -t projectdiscovery/subfinder -d hackerone.com

Subfinder Go library

Subfinder can also be used as library and a minimal examples of using subfinder SDK is available here

Resources

License

subfinder is made with 🖤 by the projectdiscovery team. Community contributions have made the project what it is. See the THANKS.md file for more details.

Read the usage disclaimer at DISCLAIMER.md and contact us for any API removal.

More Repositories

1

nuclei

Fast and customizable vulnerability scanner based on simple YAML based DSL.
Go
14,482
star
2

katana

A next-generation crawling and spidering framework.
Go
8,492
star
3

nuclei-templates

Community curated list of templates for the nuclei engine to find security vulnerabilities.
6,913
star
4

httpx

httpx is a fast and multi-purpose HTTP toolkit that allows running multiple probes using the retryablehttp library.
Go
5,706
star
5

naabu

A fast port scanner written in go with a focus on reliability and simplicity. Designed to be used in combination with other tools for attack surface discovery in bug bounties and pentests
Go
3,657
star
6

interactsh

An OOB interaction gathering server and client library
Go
2,818
star
7

proxify

A versatile and portable proxy for capturing, manipulating, and replaying HTTP/HTTPS traffic on the go.
Go
2,362
star
8

uncover

Quickly discover exposed hosts on the internet using multiple search engines.
Go
2,026
star
9

dnsx

dnsx is a fast and multi-purpose DNS toolkit allow to run multiple DNS queries of your choice with a list of user-supplied resolvers.
Go
1,708
star
10

shuffledns

MassDNS wrapper written in go that allows you to enumerate valid subdomains using active bruteforce as well as resolve subdomains with wildcard handling and easy input-output support.
Go
1,119
star
11

nuclei-burp-plugin

Nuclei plugin for BurpSuite
Java
1,042
star
12

notify

Notify is a Go-based assistance package that enables you to stream the output of several tools (or read from a file) and publish it to a variety of supported platforms.
Go
951
star
13

public-bugbounty-programs

Community curated list of public bug bounty and responsible disclosure programs.
Go
876
star
14

mapcidr

Small utility program to perform multiple operations for a given subnet/CIDR ranges.
Go
811
star
15

cloudlist

Cloudlist is a tool for listing Assets from multiple Cloud Providers.
Go
691
star
16

fuzzing-templates

Community curated list of nuclei templates for finding "unknown" security vulnerabilities.
668
star
17

tlsx

Fast and configurable TLS grabber focused on TLS based data collection.
Go
654
star
18

pdtm

ProjectDiscovery's Open Source Tool Manager
Go
521
star
19

asnmap

Go CLI and Library for quickly mapping organization network ranges using ASN information.
Go
516
star
20

wappalyzergo

A high performance go implementation of Wappalyzer Technology Detection Library
Go
498
star
21

chaos-client

Go client to communicate with Chaos DB API.
Go
498
star
22

alterx

Fast and customizable subdomain wordlist generator using DSL
Go
480
star
23

cdncheck

A utility to detect various technology for a given IP address.
Go
463
star
24

simplehttpserver

Go alternative of python SimpleHTTPServer
Go
418
star
25

nuclei-ai-extension

Nuclei AI - Browser Extension for Rapid Nuclei Template Generation
JavaScript
351
star
26

dnsprobe

DNSProb is a tool built on top of retryabledns that allows you to perform multiple dns queries of your choice with a list of user supplied resolvers.
Go
269
star
27

aix

AIx is a cli tool to interact with Large Language Models (LLM) APIs.
Go
200
star
28

nuclei-action

Vulnerability Scan with Nuclei
JavaScript
199
star
29

interactsh-web

Web dashboard for Interactsh client
TypeScript
162
star
30

openrisk

openrisk is a tool that generates a risk score based on the results of a Nuclei scan.
Go
156
star
31

rawhttp

Raw HTTP client in Go for complete request control and customization.
Go
120
star
32

retryabledns

Retryable DNS client in Go
Go
103
star
33

retryablehttp-go

Package retryablehttp provides a familiar HTTP client interface with automatic retries and exponential backoff
Go
92
star
34

nuclei-docs

Nuclei documentation
HTML
84
star
35

gologger

A simple layer for leveled logging in go
Go
66
star
36

utils

Helper Libraries
Go
65
star
37

network-fingerprint

A fingerprint generation helper for nuclei network templates
Go
61
star
38

goflags

A go flag wrapper with convenience helpers
Go
59
star
39

awesome-search-queries

Community curated list of search queries for various products across multiple search engines.
46
star
40

fastdialer

Dialer with DNS Cache + Dial History
Go
45
star
41

ipranger

IP/FQDN data structure helper with randomization of hosts and ports based on masscan internal logic
Go
43
star
42

dsl

DSL engine
Go
38
star
43

hmap

Hybrid memory/disk map
Go
35
star
44

useragent

Curated list of categorized User Agents
Go
30
star
45

wallpapers

Collection of ProjectDiscovery wallpapers
26
star
46

collaborator

BurpSuite Standard/Private Collaborator Library
Go
22
star
47

tinydns

Tiny embeddable dns server
Go
22
star
48

blackrock

blackrock cipher based on masscan
Go
21
star
49

fdmax

Small Helper Library to increase automatically the file descriptors limits for the current process
Go
21
star
50

ratelimit

A Golang blocking rate limit implementation
Go
20
star
51

php-app-race-condition

Vulnerable demo application for the race condition
PHP
17
star
52

yamldoc-go

A documentation generator for YAML as code
Go
16
star
53

freeport

Free listening port from the OS
Go
16
star
54

clistats

A command based package for simple display of statistics
Go
15
star
55

sqlc-go-builder

sqlc-go-builder
Go
13
star
56

notify-action

Notify is a helper utility written in Go that allows you to post output to multiple platforms.
12
star
57

naabu-action

A fast port scanner written in go with a focus on reliability and simplicity.
12
star
58

fileutil

File helpers - Moved at https://github.com/projectdiscovery/utils
Go
12
star
59

subfinder-action

Fast and passive subdomain enumeration.
12
star
60

roundrobin

roundrobin with configurable rotating strategies
Go
11
star
61

executil

Exec helpers - Moved at https://github.com/projectdiscovery/utils
Go
11
star
62

networkpolicy

Network Policy Helper
Go
10
star
63

resolvercache-go

A DNS response caching library in go
Go
10
star
64

gozero

gozero: the wannabe zero dependency [language-here] runtime for Go developers - Experimental
Go
9
star
65

iputil

ip helpers - Moved at https://github.com/projectdiscovery/utils
Go
8
star
66

dnsx-action

Fast and multi-purpose DNS toolkit allow to run multiple DNS queries.
8
star
67

expirablelru

A TTL expiring LRU cache in go
Go
7
star
68

sslcert

Reworked version of https://golang.org/src/crypto/tls/generate_cert.go
Go
7
star
69

tailwindcss

Design system config file
JavaScript
7
star
70

goconfig

Helper library to save/restore internal values across multiple runs
Go
7
star
71

httpx-action

HTTP Web Server probing
7
star
72

cryptoutil

Library containing various crypto helpers
Go
7
star
73

stringsutil

Strings helper - Moved at https://github.com/projectdiscovery/utils
Go
6
star
74

nuclei-updatecheck-api

Nuclei UpdateChecking API caching github releases for update check
Go
5
star
75

filekv

File based kv store
Go
5
star
76

sarif

Sarif exporter
Go
5
star
77

sliceutil

sliceutils helpers - Moved at https://github.com/projectdiscovery/utils
Go
5
star
78

cloudlist-action

Cloudlist is a tool for listing Assets from multiple Cloud Providers.
5
star
79

mapsutil

Go maps helper functions - Moved at https://github.com/projectdiscovery/utils
Go
4
star
80

gostruct

Python like library to Interpret bytes as packed binary data
Go
4
star
81

folderutil

Package containing various folder helpers
Go
3
star
82

httputil

Http helper library
Go
3
star
83

templates-stats

A utility for extracting various meta data from nuclei-templates.
Go
3
star
84

reflectutil

Library containing reflection helpers
Go
2
star
85

urlutil

Helper library handling edge cases URLs - Moved at https://github.com/projectdiscovery/utils
Go
2
star
86

.github

Community health files for the @projectdiscovery organization
2
star
87

docs

Centralized docs of ProjectDiscovery
MDX
2
star
88

eslint-config

ESLint Configurations
JavaScript
1
star