Documentation
¶
Overview ¶
Package runner implements the mechanism to drive the url enumeration process
Index ¶
- Constants
- Variables
- func GetUpdateCallback() func()
- func UnmarshalFrom(file string) error
- type OnResultCallback
- type Options
- type OutputWriter
- func (o *OutputWriter) WriteHost(input string, results map[string]resolve.HostEntry, writer io.Writer) error
- func (o *OutputWriter) WriteHostIP(input string, results map[string]resolve.Result, writer io.Writer) error
- func (o *OutputWriter) WriteHostNoWildcard(input string, results map[string]resolve.Result, writer io.Writer) error
- func (o *OutputWriter) WriteSourceHost(input string, sourceMap map[string]map[string]struct{}, writer io.Writer) error
- type Runner
- func (r *Runner) EnumerateMultipleUrls(reader io.Reader, writers []io.Writer) error
- func (r *Runner) EnumerateMultipleUrlsWithCtx(ctx context.Context, reader io.Reader, writers []io.Writer) error
- func (r *Runner) EnumerateSingleQuery(query string, writers []io.Writer) error
- func (r *Runner) EnumerateSingleQueryWithCtx(ctx context.Context, query string, writers []io.Writer) error
- func (r *Runner) RunEnumeration() error
- func (r *Runner) RunEnumerationWithCtx(ctx context.Context) error
- func (r *Runner) ValidateScope(absURL, rootHostname string) (bool, error)
Constants ¶
const ToolName = `urlfinder`
Name
Variables ¶
var (
ErrEmptyInput = errors.New("empty data")
)
Functions ¶
func GetUpdateCallback ¶
func GetUpdateCallback() func()
GetUpdateCallback returns a callback function that updates urlfinder
func UnmarshalFrom ¶
UnmarshalFrom writes the marshaled yaml config to disk
Types ¶
type OnResultCallback ¶
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.
UrlScope goflags.StringSlice // UrlScope is the list of urls to follow
UrlOutOfScope goflags.StringSlice // UrlOutOfScope is the list of urls to exclude
FieldScope string // FieldScope is the field to use for scope
NoScope bool // NoScope disables host based default scope
DisplayOutScope bool // DisplayOutScope displays external endpoint from scoped crawling
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 ¶
NewRunner creates a new runner struct instance by parsing the configuration options, configuring sources, reading lists and setting up loggers, etc.
func (*Runner) EnumerateMultipleUrls ¶
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 ¶
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 ¶
RunEnumeration wraps RunEnumerationWithCtx with an empty context
func (*Runner) RunEnumerationWithCtx ¶
RunEnumerationWithCtx runs the url enumeration flow on the targets specified