Documentation ¶
Overview ¶
Package settings provides a central interface to webborer settings.
Package settings provides a central interface to webborer settings.
Package settings provides a central interface to webborer settings.
Package settings provides a central interface to webborer settings.
Package settings provides a central interface to webborer settings.
Package settings provides a central interface to webborer settings.
Package settings provides a central interface to webborer settings.
Index ¶
- Constants
- Variables
- func SetOutputFormats(formats []string)
- type DurationFlag
- type HeaderFlag
- type IntSliceFlag
- type RobotsModeOption
- type RunModeOption
- type ScanSettings
- func (settings *ScanSettings) GetScopes() ([]*url.URL, error)
- func (settings *ScanSettings) InitFlags()
- func (settings *ScanSettings) LoadFromConfigFile(path string)
- func (settings *ScanSettings) LoadFromDefaultConfigFiles()
- func (settings *ScanSettings) ParseFlags()
- func (settings *ScanSettings) String() string
- func (settings *ScanSettings) Validate() error
- type StringSliceFileFlag
- type StringSliceFlag
Constants ¶
const ( IgnoreRobots = iota ObeyRobots SeedRobots )
We handle Robots.txt in various ways
const ( RunModeEnumeration = iota RunModeDotProduct RunModeLinkCheck )
We have a couple of different runmodes
Variables ¶
var DefaultUserAgent = "WebBorer 0.01"
Functions ¶
Types ¶
type DurationFlag ¶
type DurationFlag struct {
// contains filtered or unexported fields
}
DurationFlag is a flag.Value that takes a Duration spec (see time.Duration) and parses it and stores the Duration.
func (DurationFlag) Set ¶
func (f DurationFlag) Set(value string) error
func (DurationFlag) String ¶
func (f DurationFlag) String() string
Satisfies flag.Value interface and converts to a duration based on seconds
type HeaderFlag ¶
HeaderFlag is an http.Header wrapped in the flag.Value interface.
func (*HeaderFlag) Header ¶
func (f *HeaderFlag) Header() http.Header
func (*HeaderFlag) Set ¶
func (f *HeaderFlag) Set(value string) error
func (*HeaderFlag) String ¶
func (f *HeaderFlag) String() string
type IntSliceFlag ¶
type IntSliceFlag []int
IntSliceFlag is a flag.Value that takes a comma-separated string and turns it into a slice of ints.
func (*IntSliceFlag) Set ¶
func (f *IntSliceFlag) Set(value string) error
func (*IntSliceFlag) String ¶
func (f *IntSliceFlag) String() string
type RobotsModeOption ¶
type RobotsModeOption int
Control how we handle robots.txt
func (*RobotsModeOption) Set ¶
func (f *RobotsModeOption) Set(value string) error
func (*RobotsModeOption) String ¶
func (f *RobotsModeOption) String() string
type RunModeOption ¶
type RunModeOption int
Run mode specifies a couple of different ways for handling general operations.
func (*RunModeOption) Set ¶
func (f *RunModeOption) Set(value string) error
func (*RunModeOption) String ¶
func (f *RunModeOption) String() string
type ScanSettings ¶
type ScanSettings struct { // Starting point and scope of scan BaseURLs StringSliceFlag // Number of threads to run Threads int // Number of workers to run Workers int // Exclusions ExcludePaths StringSliceFlag // Proxies Proxies StringSliceFlag // Operating mode RunMode RunModeOption // Parse HTML for links? ParseHTML bool // Time to sleep between requests, per thread SleepTime time.Duration // Log file path LogfilePath string // Level of logging LogLevel string // Wordlist for scanning WordlistPath string // Extensions for mangling Extensions StringSliceFlag // Whether or not to mangle by adding extensions Mangle bool // How long should internal queues be sized QueueSize int // Timeout for network requests Timeout time.Duration // Output type OutputFormat string // Output path OutputPath string // User-Agent for requests UserAgent string // HTTP Method to use Method string // Whether to include redirects in reporting IncludeRedirects bool // How to handle Robots.txt RobotsMode RobotsModeOption // Whether to allow upgrade from http to https AllowHTTPSUpgrade bool // Spider which http response codes SpiderCodes IntSliceFlag // HTTP Auth Username HTTPUsername string // HTTP Auth Password HTTPPassword string // Headers *always* sent Header HeaderFlag // Headers sometimes sent OptionalHeader HeaderFlag // Progress bar ProgressBar bool // Add slashes AddSlashes bool // MangleCases MangleCases bool // Whether or not to do CPU Profiling DebugCPUProf bool // contains filtered or unexported fields }
ScanSettings store all of the settings for the running scan. It's basically a mapping from command-line flags into a single struct that can be passed into setup functions to get the desired behavior.
func GetScanSettings ¶
func GetScanSettings() (*ScanSettings, error)
Create settings that includes configuration files and command line flags. Generally, this should be called very early and is the best way to get the settings.
func NewScanSettings ¶
func NewScanSettings() *ScanSettings
Constructs a ScanSettings struct with all of the defaults to be used.
func (*ScanSettings) GetScopes ¶
func (settings *ScanSettings) GetScopes() ([]*url.URL, error)
Convert BaseURL strings to URLs
func (*ScanSettings) InitFlags ¶
func (settings *ScanSettings) InitFlags()
Setup all of the flags. Should be called *early*
func (*ScanSettings) LoadFromConfigFile ¶
func (settings *ScanSettings) LoadFromConfigFile(path string)
Load from the specified file
func (*ScanSettings) LoadFromDefaultConfigFiles ¶
func (settings *ScanSettings) LoadFromDefaultConfigFiles()
Load settings from the first file found in searchPaths
func (*ScanSettings) ParseFlags ¶
func (settings *ScanSettings) ParseFlags()
Parse command line flags into settings
type StringSliceFileFlag ¶
type StringSliceFileFlag struct {
// contains filtered or unexported fields
}
StringSliceFileFlag is flag.Value that loads from a file into a wrapped StringSliceFlag
func (*StringSliceFileFlag) Set ¶
func (f *StringSliceFileFlag) Set(value string) error
func (*StringSliceFileFlag) String ¶
func (f *StringSliceFileFlag) String() string
type StringSliceFlag ¶
type StringSliceFlag []string
StringSliceFlag is a flag.Value that takes a comma-separated or repeated string and turns it into a slice of strings.
func (*StringSliceFlag) Set ¶
func (f *StringSliceFlag) Set(value string) error
func (*StringSliceFlag) String ¶
func (f *StringSliceFlag) String() string
Satisfies flag.Value interface and splits value on commas