Install URLFinder
devURLFinder requires Go 1.21. You can install it directly using go install or download pre-compiled binaries from the GitHub releases page.
go install -v github.com/projectdiscovery/urlfinder/cmd/urlfinder@latestrepository·dev·Indexed 21 days ago
https://github.com/projectdiscovery/urlfinderA high-speed, passive URL discovery tool by projectdiscovery designed to gather URLs from various web sources without active scanning. It features pattern matching for including or excluding URLs, JSONL output format, and configurable rate-limiting and scoping for security researchers and penetration testers.
URLFinder requires Go 1.21. You can install it directly using go install or download pre-compiled binaries from the GitHub releases page.
go install -v github.com/projectdiscovery/urlfinder/cmd/urlfinder@latestYou can refine your results using pattern matching to include or exclude specific URLs.
-m): Include only URLs that match the provided patterns (comma-separated or from a file).-f): Exclude URLs that match the provided patterns (comma-separated or from a file).Patterns can be provided as a comma-separated list or by pointing to a text file containing the patterns.
# Include URLs containing 'shop' or 'model'
urlfinder -d tesla.com -m shop,model
# Exclude URLs containing 'privacy' or 'terms'
urlfinder -d tesla.com -f privacy,terms
# Combine both match and filter
urlfinder -d tesla.com -m support -f faq
# Use patterns from files
urlfinder -d tesla.com -m include-patterns.txt -f exclude-patterns.txtTo perform basic passive URL discovery for a specific domain, use the -d flag followed by the target domain.
urlfinder -d tesla.comUse the -j or -jsonl flag to output results in JSON Lines format. This is ideal for structured data processing. Each line in the output is a valid JSON object containing the url, the original input domain, and the source used for discovery.
urlfinder -d tesla.com -jThe following flags are available for controlling URLFinder behavior:
-d, -list string[]: target domain or list of domains-s, -sources string[]: specific sources for discovery (e.g., alienvault, commoncrawl)-es, -exclude-sources string[]: sources to exclude-all: use all sources (may be slower)-us, -url-scope string[]: in-scope URL regex to be followed-uos, -url-out-scope string[]: out-of-scope URL regex to be excluded-fs, -field-scope string: pre-defined scope field (dn, rdn, fqdn) or custom regex (default rdn)-ns, -no-scope: disables host-based default scope-do, -display-out-scope: display external endpoints from scoped crawling-m, -match string[]: URLs or list to match (file or comma-separated)-f, -filter string[]: URLs or list to filter (file or comma-separated)-rl, -rate-limit int: max HTTP requests per second (global)-rls, -rate-limits value: per-provider HTTP request limits (e.g., -rls waybackarchive=15/m)-o, -output string: specify output file-j, -jsonl: JSONL output format-od, -output-dir string: specify output directory-cs, -collect-sources: include all sources in JSON output-silent: show only URLs in output-v: verbose output-ls, -list-sources: list all available sources-stats: display source statistics-timeout int: timeout in seconds (default 30)-max-time int: max time in minutes for enumeration (default 10)Use the New() function to create a new Resolver instance. By default, the Resolvers slice is initialized as empty, allowing you to provide your own list of DNS resolver addresses.
import "github.com/projectdiscovery/projectdiscovery/urlfinder/pkg/resolve"
resolver := resolve.New()The DefaultResolvers variable provides a pre-defined list of reliable public DNS resolver addresses (including Cloudflare, Google, Quad9, Yandex, and OpenDNS) that can be used to populate a Resolver instance.
var DefaultResolvers = []string{
"1.1.1.1:53", // Cloudflare primary
"1.0.0.1:53", // Cloudflare secondary
"8.8.8.8:53", // Google primary
"8.8.4.4:53", // Google secondary
"9.9.9.9:53", // Quad9 Primary
"9.9.9.10:53", // Quad9 Secondary
"77.88.8.8:53", // Yandex Primary
"77.88.8.1:53", // Yandex Secondary
"208.67.222.222:53", // OpenDNS Primary
"208.67.220.220:53", // OpenDNS Secondary
}URLFinder is a command-line tool designed to find URLs. The execution flow involves parsing command-line flags and configuration files via runner.ParseOptions(), initializing a new runner instance with runner.NewRunner(options), and executing the enumeration process with newRunner.RunEnumeration().
Note: The tool attempts to automatically increase OS file descriptors via the autofdmax package to handle high concurrency, failing silently if it cannot do so.
// Conceptual execution flow of the URLFinder CLI
options := runner.ParseOptions()
newRunner, err := runner.NewRunner(options)
if err != nil {
gologger.Fatal().Msgf("Could not create runner: %s\n", err)
}
err = newRunner.RunEnumeration()
if err != nil {
gologger.Fatal().Msgf("Could not run enumeration: %s\n", err)
}The Resolver struct is used to perform DNS name resolution. It contains:
DNSClient: A pointer to a dnsx.DNSX instance used for the actual resolution logic.Resolvers: A slice of strings representing the DNS resolver addresses (e.g., "8.8.8.8:53") to be used during the process.type Resolver struct {
DNSClient *dnsx.DNSX
Resolvers []string
}