Documentation ¶
Index ¶
- Constants
- func FileExists(path string) bool
- func GetDbClient() *scribble.Driver
- func RandomString(n int) string
- func ReturnAll(db *scribble.Driver, folder string) []string
- func ReturnTmpFolder(conf *Config) string
- func UniqStringSlice(inslice []string) []string
- func UpdateDB(db *scribble.Driver, folder string, name string, results ResultDB)
- type Config
- type ConfigOptions
- type FilterOptions
- type FilterProvider
- type GeneralOptions
- type HTTPOptions
- type InputOptions
- type InputProvider
- type InputProviderConfig
- type InternalInputProvider
- type Job
- type MatcherOptions
- type Multierror
- type OutputOptions
- type OutputProvider
- type Progress
- type QueueJob
- type RateThrottle
- type Request
- type Response
- type ResultDB
- type RunnerProvider
- type ValueRange
Constants ¶
const (
//VERSION holds the current version number
VERSION = "1.2.0-git"
)
Variables ¶
This section is empty.
Functions ¶
func FileExists ¶
FileExists checks if the filepath exists and is not a directory
func GetDbClient ¶
func GetDbClient() *scribble.Driver
func RandomString ¶
RandomString returns a random string of length of parameter n
func ReturnTmpFolder ¶
func UniqStringSlice ¶
UniqStringSlice returns an unordered slice of unique strings. The duplicates are dropped
Types ¶
type Config ¶
type Config struct { AutoCalibration bool `json:"autocalibration"` AutoCalibrationStrings []string `json:"autocalibration_strings"` Cancel context.CancelFunc `json:"-"` Colors bool `json:"colors"` CommandKeywords []string `json:"-"` CommandLine string `json:"cmdline"` ConfigFile string `json:"configfile"` Context context.Context `json:"-"` Data string `json:"postdata"` Delay optRange `json:"delay"` DirSearchCompat bool `json:"dirsearch_compatibility"` Extensions []string `json:"extensions"` Filters map[string]FilterProvider `json:"filters"` FollowRedirects bool `json:"follow_redirects"` Headers map[string]string `json:"headers"` IgnoreBody bool `json:"ignorebody"` IgnoreWordlistComments bool `json:"ignore_wordlist_comments"` InputMode string `json:"inputmode"` InputNum int `json:"cmd_inputnum"` InputProviders []InputProviderConfig `json:"inputproviders"` Matchers map[string]FilterProvider `json:"matchers"` MaxTime int `json:"maxtime"` MaxTimeJob int `json:"maxtime_job"` Method string `json:"method"` OutputDirectory string `json:"outputdirectory"` OutputFile string `json:"outputfile"` OutputFormat string `json:"outputformat"` OutputCreateEmptyFile bool `json:"OutputCreateEmptyFile"` OutputSaveToDB bool `json:"OutputSaveToDB"` OutputFilter bool `json:"OutputFilter"` ProgressFrequency int `json:"-"` ProxyURL string `json:"proxyurl"` Quiet bool `json:"quiet"` Rate int64 `json:"rate"` Recursion bool `json:"recursion"` RecursionDepth int `json:"recursion_depth"` ReplayProxyURL string `json:"replayproxyurl"` StopOn403 bool `json:"stop_403"` StopOnAll bool `json:"stop_all"` StopOnErrors bool `json:"stop_errors"` Threads int `json:"threads"` Timeout int `json:"timeout"` Url string `json:"url"` Verbose bool `json:"verbose"` Waf1 bool `json:"waf1"` Waf2 bool `json:"waf2"` }
func ConfigFromOptions ¶
func ConfigFromOptions(parseOpts *ConfigOptions, ctx context.Context, cancel context.CancelFunc) (*Config, error)
ConfigFromOptions parses the values in ConfigOptions struct, ensures that the values are sane, and creates a Config struct out of them.
func (*Config) SetContext ¶
func (c *Config) SetContext(ctx context.Context, cancel context.CancelFunc)
type ConfigOptions ¶
type ConfigOptions struct { Filter FilterOptions General GeneralOptions HTTP HTTPOptions Input InputOptions Matcher MatcherOptions Output OutputOptions }
func NewConfigOptions ¶
func NewConfigOptions() *ConfigOptions
NewConfigOptions returns a newly created ConfigOptions struct with default values
func ReadConfig ¶
func ReadConfig(configFile string) (*ConfigOptions, error)
func ReadDefaultConfig ¶
func ReadDefaultConfig() (*ConfigOptions, error)
type FilterOptions ¶
type FilterProvider ¶
FilterProvider is a generic interface for both Matchers and Filters
type GeneralOptions ¶
type GeneralOptions struct { AutoCalibration bool AutoCalibrationStrings []string Colors bool ConfigFile string `toml:"-"` Delay string MaxTime int MaxTimeJob int Quiet bool Rate int ShowVersion bool `toml:"-"` StopOn403 bool StopOnAll bool StopOnErrors bool Threads int Verbose bool Waf1 bool Waf2 bool }
type HTTPOptions ¶
type InputOptions ¶
type InputProvider ¶
type InputProvider interface { AddProvider(InputProviderConfig) error Next() bool Position() int Reset() Value() map[string][]byte Total() int }
InputProvider interface handles the input data for RunnerProvider
type InputProviderConfig ¶
type InternalInputProvider ¶
type InternalInputProvider interface { Keyword() string Next() bool Position() int ResetPosition() IncrementPosition() Value() []byte Total() int }
InternalInputProvider interface handles providing input data to InputProvider
type Job ¶
type Job struct { Config *Config ErrorMutex sync.Mutex Input InputProvider Runner RunnerProvider ReplayRunner RunnerProvider Output OutputProvider Counter int ErrorCounter int SpuriousErrorCounter int Total int Running bool RunningJob bool Count403 int Count429 int Error string Rate *RateThrottle // contains filtered or unexported fields }
Job ties together Config, Runner, Input and Output
func (*Job) CalibrateResponses ¶
CalibrateResponses returns slice of Responses for randomly generated filter autocalibration requests
type MatcherOptions ¶
type Multierror ¶
type Multierror struct {
// contains filtered or unexported fields
}
func (*Multierror) Add ¶
func (m *Multierror) Add(err error)
func (*Multierror) ErrorOrNil ¶
func (m *Multierror) ErrorOrNil() error
type OutputOptions ¶
type OutputProvider ¶
type OutputProvider interface { Banner() Finalize() error Progress(status Progress) Info(infostring string) Error(errstring string) Warning(warnstring string) Result(resp Response) SaveToUseLater(resp Response) }
OutputProvider is responsible of providing output from the RunnerProvider
type RateThrottle ¶
type RateThrottle struct { RateAdjustment float64 RateAdjustmentPos int Config *Config RateMutex sync.Mutex // contains filtered or unexported fields }
func NewRateThrottle ¶
func NewRateThrottle(conf *Config) *RateThrottle
func (*RateThrottle) Adjust ¶
func (r *RateThrottle) Adjust()
Adjust changes the RateAdjustment value, which is multiplier of second to pause between requests in a thread
func (*RateThrottle) CurrentRate ¶
func (r *RateThrottle) CurrentRate() int64
CurrentRate calculates requests/second value from circular list of rate
func (*RateThrottle) Throttle ¶
func (r *RateThrottle) Throttle()
func (*RateThrottle) Tick ¶
func (r *RateThrottle) Tick(start, end time.Time)
rateTick adds a new duration measurement tick to rate counter
type Request ¶
type Request struct { Method string Host string Url string Headers map[string]string Data []byte Input map[string][]byte Position int Raw string }
Request holds the meaningful data that is passed for runner for making the query
func NewRequest ¶
type Response ¶
type Response struct { StatusCode int64 Headers map[string][]string Data []byte ContentLength int64 ContentWords int64 ContentLines int64 ContentClean int64 Cancelled bool Request *Request Raw string ResultFile string }
Response struct holds the meaningful data returned from request and is meant for passing to filters
func (*Response) GetRedirectLocation ¶
GetRedirectLocation returns the redirect location for a 3xx redirect HTTP response
type RunnerProvider ¶
type RunnerProvider interface { Prepare(input map[string][]byte) (Request, error) Execute(req *Request) (Response, error) }
RunnerProvider is an interface for request executors
type ValueRange ¶
type ValueRange struct {
Min, Max int64
}
func ValueRangeFromString ¶
func ValueRangeFromString(instr string) (ValueRange, error)