Subfinder in Termux - Complete Installation and Usage Guide
What is subfinder
Subfinder is a subdomain discovery tool that discovers valid subdomains for websites by 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. In Termux, it provides security researchers with a fast and efficient way to map out an organization's attack surface directly from their mobile device.
Prerequisites
Before installing Subfinder, ensure your Termux environment is ready:
- Go Language: Subfinder is written in Go, so the Go compiler is required for installation.
- Network Access: Required to query various passive online sources.
- API Keys (Optional): While Subfinder works out of the box, adding API keys for services like BinaryEdge, Censys, and Shodan significantly improves results.
Installation Commands in Termux
The recommended way to install Subfinder in Termux is using the Go package manager.
1. Update and Install Go
Ensure your packages are fresh and install the Golang environment.
pkg update && pkg upgrade -y && pkg install golang -y
2. Install Subfinder
Use go install to fetch and compile the latest version of Subfinder.
go install -v github.com/projectdiscovery/subfinder/v2/cmd/subfinder@latest
3. Configure Environment Path
Ensure your Go binary path is added to your shell path to run subfinder from anywhere.
export PATH=$PATH:$(go env GOPATH)/bin
Basic Usage & Examples
Here are the most common commands to get started with subdomain discovery.
Basic Domain Enumeration
Find subdomains for a specific target domain.
subfinder -d example.com
Silent Mode (Output only)
Use silent mode if you want to pipe the output to other tools.
subfinder -d example.com -silent
Save Output to a File
Write the discovered subdomains to a text file for later analysis.
subfinder -d example.com -o results.txt
Using Multiple Domains
You can also provide a list of domains from a file.
subfinder -dL domains.txt