runner

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2024 License: MIT Imports: 34 Imported by: 0

Documentation

Overview

Package runner implements the mechanism to drive the url enumeration process

Index

Constants

View Source
const ToolName = `urlfinder`

Name

Variables

View Source
var (
	ErrEmptyInput = errors.New("empty data")
)

Functions

func GetUpdateCallback

func GetUpdateCallback() func()

GetUpdateCallback returns a callback function that updates urlfinder

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
	Silent             bool                // Silent suppresses any extra text and only writes urls to screen
	ListSources        bool                // ListSources specifies whether to list all available sources
	CaptureSources     bool                // CaptureSources specifies whether to save all sources that returned a specific urls 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
	All                bool                // All specifies whether to use all (slow) sources.
	Statistics         bool                // Statistics specifies whether to report source statistics
	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
	URLs               goflags.StringSlice // URLs is the url to find urls for
	Output             io.Writer
	OutputFile         string               // Output is the file to write found urls to.
	OutputDirectory    string               // OutputDirectory is the directory to write results to in case list of urls 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
	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
	RateLimit          int                  // Global maximum number of HTTP requests to send per second
	RateLimits         goflags.RateLimitMap // Maximum number of HTTP requests to send per second
	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 url enumeration process.

func ParseOptions

func ParseOptions() *Options

ParseOptions parses the command line flags provided by a user

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 url 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 url 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 url 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 url to an io.Writer

type Runner

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

Runner is an instance of the url 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) EnumerateMultipleUrls

func (r *Runner) EnumerateMultipleUrls(reader io.Reader, writers []io.Writer) error

EnumerateMultipleUrls wraps EnumerateMultipleUrlsWithCtx with an empty context

func (*Runner) EnumerateMultipleUrlsWithCtx

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

EnumerateMultipleUrlsWithCtx enumerates urls for multiple queries We keep enumerating urls for a given query until we reach an error

func (*Runner) EnumerateSingleQuery

func (r *Runner) EnumerateSingleQuery(query string, writers []io.Writer) error

EnumerateSingleQuery wraps EnumerateSingleQuerynWithCtx with an empty context

func (*Runner) EnumerateSingleQueryWithCtx

func (r *Runner) EnumerateSingleQueryWithCtx(ctx context.Context, query string, writers []io.Writer) error

EnumerateSingleQueryWithCtx performs url enumeration against a single query

func (*Runner) RunEnumeration

func (r *Runner) RunEnumeration() error

RunEnumeration wraps RunEnumerationWithCtx with an empty context

func (*Runner) RunEnumerationWithCtx

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

RunEnumerationWithCtx runs the url enumeration flow on the targets specified

Jump to

Keyboard shortcuts

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