Convert Figma logo to code with AI

projectdiscovery logosubfinder

Fast passive subdomain enumeration tool.

10,098
1,268
10,098
11

Top Related Projects

Find domains and subdomains related to a given domain

11,936

In-depth attack surface mapping and asset discovery

Fast subdomains enumeration tool for penetration testers

3,923

Fetch known URLs from AlienVault's Open Threat Exchange, the Wayback Machine, and Common Crawl.

OneForAll是一款功能强大的子域收集工具

The fastest and complete solution for domain recognition. Supports screenshoting, port scan, HTTP check, data import from other tools, subdomain monitoring, alerts via Discord, Slack and Telegram, multiple API Keys for sources and much more.

Quick Overview

Subfinder is a subdomain discovery tool designed to enumerate subdomains of websites using passive online sources. It is fast, accurate, and can handle multiple targets simultaneously. Subfinder is part of the ProjectDiscovery toolkit and is widely used in bug bounty and penetration testing scenarios.

Pros

  • Fast and efficient subdomain enumeration
  • Supports multiple passive sources for comprehensive results
  • Easy to integrate into existing workflows and automation scripts
  • Actively maintained and regularly updated

Cons

  • Limited to passive enumeration techniques
  • May miss some subdomains that are only discoverable through active scanning
  • Requires API keys for some sources to function optimally
  • Can be rate-limited by some passive sources

Getting Started

To get started with Subfinder, follow these steps:

  1. Install Subfinder:

    GO111MODULE=on go get -v github.com/projectdiscovery/subfinder/v2/cmd/subfinder
    
  2. Basic usage:

    subfinder -d example.com
    
  3. Use multiple domains:

    subfinder -d example.com,example.org
    
  4. Output results to a file:

    subfinder -d example.com -o output.txt
    
  5. Use all sources including optional ones (may require API keys):

    subfinder -d example.com -all
    

For more advanced usage and configuration options, refer to the official documentation on the GitHub repository.

Competitor Comparisons

Find domains and subdomains related to a given domain

Pros of assetfinder

  • Lightweight and fast execution
  • Simple to use with minimal configuration
  • Supports multiple sources for subdomain discovery

Cons of assetfinder

  • Limited customization options
  • Fewer built-in data sources compared to subfinder
  • Less frequent updates and maintenance

Code Comparison

assetfinder:

func main() {
    domain := flag.String("d", "", "The domain to find assets for")
    flag.Parse()
    if *domain == "" {
        fmt.Println("Please provide a domain")
        os.Exit(1)
    }
    for result := range assetfinder.Run(*domain) {
        fmt.Println(result)
    }
}

subfinder:

func main() {
    options := &runner.Options{
        Threads:            10,
        Timeout:            30,
        MaxEnumerationTime: 10,
        Resolvers:          resolve.DefaultResolvers,
        Sources:            passive.DefaultSources,
        AllSources:         passive.DefaultAllSources,
        Recursive:          false,
        Providers:          &providers.Providers{},
    }
    runner, err := runner.NewRunner(options)
    if err != nil {
        gologger.Fatal().Msgf("Could not create runner: %s\n", err)
    }
    runner.RunEnumeration()
}

Both tools are effective for subdomain discovery, but subfinder offers more advanced features and customization options, while assetfinder is simpler and faster for basic use cases.

11,936

In-depth attack surface mapping and asset discovery

Pros of Amass

  • More comprehensive subdomain enumeration with advanced techniques like DNS zone transfers and certificate transparency logs
  • Supports graph database integration for visualizing relationships between discovered assets
  • Offers a wider range of data sources and APIs for gathering information

Cons of Amass

  • Slower performance due to its extensive feature set and data sources
  • Steeper learning curve with more complex configuration options
  • Higher resource consumption, especially for large-scale scans

Code Comparison

Subfinder:

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)
        // Subdomain enumeration logic
    }()
    return results
}

Amass:

func (e *Enumeration) executeEnumeration(ctx context.Context) {
    var wg sync.WaitGroup
    for _, src := range e.srcs {
        wg.Add(1)
        go func(s service.Service) {
            defer wg.Done()
            // Enumeration logic for each data source
        }(src)
    }
    wg.Wait()
}

Both tools use Go for implementation, but Amass employs a more complex architecture with multiple services and data sources, while Subfinder focuses on a simpler, modular approach for subdomain enumeration.

Fast subdomains enumeration tool for penetration testers

Pros of Sublist3r

  • Simpler to use and set up, with fewer dependencies
  • Supports multiple search engines and APIs out of the box
  • Includes a built-in DNS resolver for subdomain validation

Cons of Sublist3r

  • Less actively maintained, with fewer recent updates
  • Limited configuration options compared to Subfinder
  • May miss some subdomains due to a more limited set of sources

Code Comparison

Sublist3r:

def main(domain, threads, savefile, ports, silent, verbose, enable_bruteforce, engines):
    bruteforce_list = []
    subdomains = []
    search_list = []

    if is_windows():
        subdomains = subdomains_queue.get()
        subdomains = sorted(set(subdomains))

Subfinder:

func (r *Runner) EnumerateSubdomains() chan *resolve.HostEntry {
    results := make(chan *resolve.HostEntry)
    go func() {
        defer close(results)

        for source := range r.sources {
            for domain := range source.Run(r.options.Domain, r.options.Context)

Both tools aim to enumerate subdomains, but Subfinder offers more advanced features and is actively maintained. Sublist3r is easier to use for beginners but may lack some of the more comprehensive subdomain discovery capabilities of Subfinder. The code snippets show the different approaches: Sublist3r uses Python and focuses on simplicity, while Subfinder uses Go and provides more extensive options for customization and parallel processing.

3,923

Fetch known URLs from AlienVault's Open Threat Exchange, the Wayback Machine, and Common Crawl.

Pros of gau

  • Focuses on URL discovery from various sources, including the Wayback Machine
  • Can find historical and potentially hidden URLs
  • Lightweight and fast execution

Cons of gau

  • Limited to URL discovery, doesn't perform active subdomain enumeration
  • May return outdated or irrelevant URLs
  • Less comprehensive in terms of overall attack surface mapping

Code Comparison

gau:

func getWaybackUrls(domain string, includeSubs bool) ([]string, error) {
    var urls []string
    waybackUrl := fmt.Sprintf("http://web.archive.org/cdx/search/cdx?url=%s/*&output=json&fl=original&collapse=urlkey", domain)
    // ... (implementation details)
}

subfinder:

func (a *Agent) enumerate(ctx context.Context, domain string) chan Result {
    results := make(chan Result)
    go func() {
        defer close(results)
        // ... (implementation details)
    }()
    return results
}

While both tools are written in Go, gau focuses on retrieving URLs from various sources, particularly the Wayback Machine. Subfinder, on the other hand, is designed for active subdomain enumeration using multiple techniques and sources. The code snippets reflect these different approaches, with gau querying web archives and subfinder implementing a more complex enumeration process.

OneForAll是一款功能强大的子域收集工具

Pros of OneForAll

  • Supports multiple subdomain enumeration techniques, including DNS, web crawling, and certificate transparency
  • Offers a web-based GUI for easier use and result visualization
  • Includes built-in subdomain takeover detection capabilities

Cons of OneForAll

  • Written in Python, which may be slower compared to Subfinder's Go implementation
  • Less frequently updated and maintained compared to Subfinder
  • May require more setup and dependencies due to its broader feature set

Code Comparison

OneForAll (Python):

def main():
    module = AliasModule(domain)
    module.run()
    results = module.results
    save_db(results, domain)

Subfinder (Go):

func main() {
    runner, err := runner.NewRunner(&options)
    if err != nil {
        gologger.Fatal().Msgf("Could not create runner: %s\n", err)
    }
    runner.RunEnumeration()
}

Both tools aim to perform subdomain enumeration, but their implementations differ in language and structure. OneForAll offers a more comprehensive approach with multiple techniques, while Subfinder focuses on speed and simplicity with its Go implementation.

The fastest and complete solution for domain recognition. Supports screenshoting, port scan, HTTP check, data import from other tools, subdomain monitoring, alerts via Discord, Slack and Telegram, multiple API Keys for sources and much more.

Pros of Findomain

  • Written in Rust, potentially offering better performance and memory safety
  • Supports multiple output formats (JSON, CSV, Quiet)
  • Includes a monitoring feature for continuous subdomain discovery

Cons of Findomain

  • Fewer data sources compared to Subfinder
  • Less active development and community support
  • Limited configuration options for fine-tuning the discovery process

Code Comparison

Subfinder (Go):

subdomains, err := subfinder.New(config)
if err != nil {
    return err
}
results := subdomains.Run(context.Background(), domain)

Findomain (Rust):

let subdomains = Findomain::new(config)?;
let results = subdomains.run(domain)?;

Both tools offer simple APIs for subdomain enumeration, but Subfinder's implementation in Go may be more familiar to some developers. Findomain's Rust implementation could potentially offer better performance, although this would depend on specific use cases and configurations.

While both tools serve similar purposes, Subfinder generally offers more flexibility and a wider range of data sources. However, Findomain's Rust implementation and additional features like monitoring make it an attractive alternative for certain scenarios.

Convert Figma logo designs to code with AI

Visual Copilot

Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.

Try Visual Copilot

README

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,zoomeyeapi)

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 for 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 "$CONFIG/subfinder/config.yaml")
  -pc, -provider-config string  provider config file (default "$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.21 to install successfully. Run the following command to install the latest version:

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

Learn about more ways to install subfinder here: https://docs.projectdiscovery.io/tools/subfinder/install.

Post Installation Instructions

subfinder can be used right after the installation, however many sources required API keys to work. Learn more here: https://docs.projectdiscovery.io/tools/subfinder/install#post-install-configuration.

Running Subfinder

Learn about how to run Subfinder here: https://docs.projectdiscovery.io/tools/subfinder/running.

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.