Help us shape the future of Go! Take the 2026 Go Developer Survey

passive

package
v2.17.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 8, 2026 License: MIT Imports: 68 Imported by: 16

Documentation

Overview

Package passive provides capability for doing passive subdomain enumeration on targets.

Index

Constants

This section is empty.

Variables

View Source
var AllSources = newSources()
View Source
var NameSourceMap = make(map[string]subscraping.Source, len(AllSources))

Functions

This section is empty.

Types

type Agent

type Agent struct {
	// contains filtered or unexported fields
}

Agent is a struct for running passive subdomain enumeration against a given host. It wraps subscraping package and provides a layer to build upon.

func New

func New(sourceNames, excludedSourceNames []string, useAllSources, useSourcesSupportingRecurse bool) *Agent

New creates a new agent for passive subdomain discovery

func NewWithProviderConfig added in v2.17.0

func NewWithProviderConfig(sourceNames, excludedSourceNames []string, useAllSources, useSourcesSupportingRecurse bool, keys map[string][]string) *Agent

NewWithProviderConfig creates independently owned built-in sources using effective provider keys supplied by the caller. Registered custom sources are preserved and serialized across agents. It does not read environment variables. Register custom sources before constructing agents; registry mutation during enumeration is unsafe.

func (*Agent) EnumerateSubdomains

func (a *Agent) EnumerateSubdomains(domain string, proxy string, rateLimit int, timeout int, maxEnumTime time.Duration, options ...EnumerateOption) chan subscraping.Result

EnumerateSubdomains wraps EnumerateSubdomainsWithCtx with an empty context

func (*Agent) EnumerateSubdomainsWithCtx

func (a *Agent) EnumerateSubdomainsWithCtx(ctx context.Context, domain string, proxy string, rateLimit int, timeout int, maxEnumTime time.Duration, options ...EnumerateOption) chan subscraping.Result

EnumerateSubdomainsWithCtx enumerates all the subdomains for a given domain

func (*Agent) GetStatistics

func (a *Agent) GetStatistics() map[string]subscraping.Statistics

func (*Agent) NewRateLimiter added in v2.17.0

func (a *Agent) NewRateLimiter(ctx context.Context, globalRateLimit int, custom *subscraping.CustomRateLimit) (*RateLimiter, error)

NewRateLimiter creates provider budgets shared by a domain batch. Per-source settings override the global default, as for single-domain runs.

type EnumerateOption

type EnumerateOption func(opts *EnumerationOptions)

func WithCustomRateLimit

func WithCustomRateLimit(crl *subscraping.CustomRateLimit) EnumerateOption

func WithMaxResponseBodySize added in v2.16.0

func WithMaxResponseBodySize(maxResponseBodySize int64) EnumerateOption

WithMaxResponseBodySize sets a cap on bytes read from passive-source HTTP response bodies. A value of 0 (the default) means no limit.

func WithMaxResults added in v2.15.0

func WithMaxResults(maxResults int) EnumerateOption

WithMaxResults sets a per-source limit on the number of results emitted. A value of 0 (the default) means no limit. Sources that paginate can honor this to avoid unnecessary requests (e.g. to stay within API quotas).

func WithRateLimiter added in v2.17.0

func WithRateLimiter(limiter subscraping.RequestLimiter) EnumerateOption

WithRateLimiter borrows a request budget shared across enumerations. It overrides per-enumeration limits; sessions do not own its lifetime.

type EnumerationOptions

type EnumerationOptions struct {
	// contains filtered or unexported fields
}

type RateLimiter added in v2.17.0

type RateLimiter struct {
	// contains filtered or unexported fields
}

RateLimiter shares provider budgets across a domain batch. Built-in requests use cancellable fixed windows. Custom adapters retain one shared legacy limiter because they may access Session.MultiRateLimiter directly. Call Close after all enumerations finish.

func (*RateLimiter) Close added in v2.17.0

func (l *RateLimiter) Close() error

Close releases the legacy custom-source limiter, if any.

func (*RateLimiter) Wait added in v2.17.0

func (l *RateLimiter) Wait(ctx context.Context, source string) error

Wait waits for a source budget. Legacy custom adapters keep their original blocking Take behavior; their runs are serialized by the custom-source gate.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL