runner

package
v2.18.1 Latest Latest
Warning

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

Go to latest
Published: Aug 22, 2026 License: MIT Imports: 37 Imported by: 0

Documentation

Overview

Package runner implements the mechanism to drive the subdomain enumeration process

Index

Constants

This section is empty.

Variables

View Source
var FastSources = []string{"thc", "submd", "crt", "shodanct", "rapiddns", "hackertarget", "sitedossier"}

FastSources is the curated set of fast, productive keyless sources used by -fast.

Functions

func GetUpdateCallback

func GetUpdateCallback() func()

GetUpdateCallback returns a callback function that updates subfaster

func SearchBySubdomainWithCtx

func SearchBySubdomainWithCtx(ctx context.Context, options *Options) error

SearchBySubdomainWithCtx searches certificate transparency records for hostnames whose first label starts with the requested prefix.

func UnmarshalFrom

func UnmarshalFrom(file string) error

UnmarshalFrom writes the marshaled yaml config to disk

Types

type OnResultCallback

type OnResultCallback func(result *resolve.HostEntry)

OnResultCallback (hostResult)

type Options

type Options struct {
	Verbose            bool                // Verbose flag indicates whether to show verbose output or not
	NoColor            bool                // NoColor disables the colored output
	JSON               bool                // JSON specifies whether to use json for output format or text file
	HostIP             bool                // HostIP specifies whether to write subdomains in host:ip format
	Silent             bool                // Silent suppresses any extra text and only writes subdomains to screen
	ListSources        bool                // ListSources specifies whether to list all available sources
	RemoveWildcard     bool                // RemoveWildcard specifies whether to remove potential wildcard or dead subdomains from the results.
	CaptureSources     bool                // CaptureSources specifies whether to save all sources that returned a specific domains or just the first source
	Stdin              bool                // Stdin specifies whether stdin input was given to the process
	Version            bool                // Version specifies if we should just show version and exit
	OnlyRecursive      bool                // Recursive specifies whether to use only recursive subdomain enumeration sources
	All                bool                // All specifies whether to use all (slow) sources.
	Fast               bool                // Fast restricts enumeration to the curated fast keyless sources
	Statistics         bool                // Statistics specifies whether to report source statistics
	Threads            int                 // Threads controls the number of threads to use for active enumerations
	Timeout            int                 // Timeout is the seconds to wait for sources to respond
	MaxEnumerationTime int                 // MaxEnumerationTime is the maximum amount of time in minutes to wait for enumeration
	Search             string              // Search is a global first-label hostname pattern such as api*
	Domain             goflags.StringSlice // Domain is the domain to find subdomains for
	DomainsFile        string              // DomainsFile is the file containing list of domains to find subdomains for
	Output             io.Writer
	OutputFile         string              // Output is the file to write found subdomains to.
	OutputDirectory    string              // OutputDirectory is the directory to write results to in case list of domains is given
	Sources            goflags.StringSlice `yaml:"sources,omitempty"`         // Sources contains a comma-separated list of sources to use for enumeration
	ExcludeSources     goflags.StringSlice `yaml:"exclude-sources,omitempty"` // ExcludeSources contains the comma-separated sources to not include in the enumeration process
	Resolvers          goflags.StringSlice `yaml:"resolvers,omitempty"`       // Resolvers is the comma-separated resolvers to use for enumeration
	ResolverList       string              // ResolverList is a text file containing list of resolvers to use for enumeration
	Config             string              // Config contains the location of the config file
	ProviderConfig     string              // ProviderConfig contains the location of the provider config file
	Proxy              string              // HTTP proxy
	ExcludeIps         bool
	Match              goflags.StringSlice
	Filter             goflags.StringSlice

	ResultCallback     OnResultCallback // OnResult callback
	DisableUpdateCheck bool             // DisableUpdateCheck disable update checking
	// contains filtered or unexported fields
}

Options contains the configuration options for tuning the subdomain enumeration process.

func ParseOptions

func ParseOptions() *Options

ParseOptions parses the command line flags provided by a user

func (*Options) ConfigureOutput

func (options *Options) ConfigureOutput()

ConfigureOutput configures the output on the screen

type OutputWriter

type OutputWriter struct {
	JSON bool
}

OutputWriter outputs content to writers.

func NewOutputWriter

func NewOutputWriter(json bool) *OutputWriter

NewOutputWriter creates a new OutputWriter

func (*OutputWriter) WriteHost

func (o *OutputWriter) WriteHost(input string, results map[string]resolve.HostEntry, writer io.Writer) error

WriteHost writes the output list of subdomain to an io.Writer

func (*OutputWriter) WriteHostIP

func (o *OutputWriter) WriteHostIP(input string, results map[string]resolve.Result, writer io.Writer) error

WriteHostIP writes the output list of subdomain to an io.Writer

func (*OutputWriter) WriteHostNoWildcard

func (o *OutputWriter) WriteHostNoWildcard(input string, results map[string]resolve.Result, writer io.Writer) error

WriteHostNoWildcard writes the output list of subdomain with nW flag to an io.Writer

func (*OutputWriter) WriteSourceHost

func (o *OutputWriter) WriteSourceHost(input string, sourceMap map[string]map[string]struct{}, writer io.Writer) error

WriteSourceHost writes the output list of subdomain to an io.Writer

type Runner

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

Runner is an instance of the subdomain enumeration client used to orchestrate the whole process.

func NewRunner

func NewRunner(options *Options) (*Runner, error)

NewRunner creates a new runner struct instance by parsing the configuration options, configuring sources, reading lists and setting up loggers, etc.

func (*Runner) EnumerateMultipleDomainsWithCtx

func (r *Runner) EnumerateMultipleDomainsWithCtx(ctx context.Context, reader io.Reader, writers []io.Writer) error

EnumerateMultipleDomainsWithCtx enumerates subdomains for multiple domains We keep enumerating subdomains for a given domain until we reach an error

func (*Runner) EnumerateSingleDomainWithCtx

func (r *Runner) EnumerateSingleDomainWithCtx(ctx context.Context, domain string, writers []io.Writer) (map[string]map[string]struct{}, error)

EnumerateSingleDomainWithCtx performs subdomain enumeration against a single domain

func (*Runner) GetStatistics

func (r *Runner) GetStatistics() map[string]subscraping.Statistics

func (*Runner) RunEnumerationWithCtx

func (r *Runner) RunEnumerationWithCtx(ctx context.Context) error

RunEnumerationWithCtx runs the subdomain enumeration flow on the targets specified

Jump to

Keyboard shortcuts

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