internal

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2022 License: GPL-3.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CheckSource sourceType = iota + 1
	InitRandomSource
	InitIndexSource
	RedirectSource
	WordSource
	WafSource
)

Variables

View Source
var (
	WhiteStatus = []int{200}
	BlackStatus = []int{400, 404, 410}
	FuzzyStatus = []int{403, 500, 501, 502, 503}
	WAFStatus   = []int{493, 418}
)
View Source
var (
	CheckRedirect func(string) bool
)

Functions

func IntsContains added in v0.1.1

func IntsContains(s []int, e int) bool

func StringsContains added in v0.1.1

func StringsContains(s []string, e string) bool

Types

type CheckPool added in v0.1.2

type CheckPool struct {
	*pkg.Config
	// contains filtered or unexported fields
}

func NewCheckPool added in v0.1.2

func NewCheckPool(ctx context.Context, config *pkg.Config) (*CheckPool, error)

func (*CheckPool) Close added in v0.1.2

func (p *CheckPool) Close()

func (*CheckPool) Run added in v0.1.2

func (p *CheckPool) Run(ctx context.Context, offset, limit int)

type ErrorType added in v0.1.0

type ErrorType uint
const (
	ErrBadStatus ErrorType = iota
	ErrSameStatus
	ErrRequestFailed
	ErrWaf
	ErrRedirect
	ErrCompareFailed
	ErrFuzzyCompareFailed
	ErrCustomCompareFailed
	ErrCustomFilter
)

func (ErrorType) Error added in v0.1.0

func (e ErrorType) Error() string

type InputOptions

type InputOptions struct {
	ResumeFrom        string            `short:"r" long:"resume-from"`
	URL               string            `short:"u" long:"url" description:"String, input baseurl (separated by commas), e.g.: http://google.com, http://baidu.com"`
	URLFile           string            `short:"l" long:"list" description:"File, input filename"`
	Offset            int               `long:"offset" description:"Int, wordlist offset"`
	Limit             int               `long:"limit" description:"Int, wordlist limit, start with offset. e.g.: --offset 1000 --limit 100"`
	Dictionaries      []string          `short:"d" long:"dict" description:"Files, dict files, e.g.: -d 1.txt -d 2.txt"`
	Word              string            `short:"w" long:"word" description:"String, word generate dsl, e.g.: -w test{?ld#4}"`
	Extensions        string            `short:"e" long:"extension" description:"String, add extensions (separated by commas), e.g.: -e jsp,jspx"`
	ExcludeExtensions string            `long:"exclude-extension" description:"String, exclude extensions (separated by commas), e.g.: --exclude-extension jsp,jspx"`
	RemoveExtensions  string            `long:"remove-extension" description:"String, remove extensions (separated by commas), e.g.: --remove-extension jsp,jspx"`
	Uppercase         bool              `short:"U" long:"uppercase" description:"Bool, upper wordlist, e.g.: --uppercase"`
	Lowercase         bool              `short:"L" long:"lowercase" description:"Bool, lower wordlist, e.g.: --lowercase"`
	Prefixes          []string          `long:"prefix" description:"Strings, add prefix, e.g.: --prefix aaa --prefix bbb"`
	Suffixes          []string          `long:"suffix" description:"Strings, add suffix, e.g.: --suffix aaa --suffix bbb"`
	Replaces          map[string]string `long:"replace" description:"Strings, replace string, e.g.: --replace aaa:bbb --replace ccc:ddd"`
}

type MiscOptions

type MiscOptions struct {
	Deadline int    `long:"deadline" default:"999999" description:"Int, deadline (seconds)"` // todo 总的超时时间,适配云函数的deadline
	Timeout  int    `long:"timeout" default:"2" description:"Int, timeout with request (seconds)"`
	PoolSize int    `short:"p" long:"pool" default:"5" description:"Int, Pool size"`
	Threads  int    `short:"t" long:"thread" default:"20" description:"Int, number of threads per pool (seconds)"`
	Debug    bool   `long:"debug" description:"Bool, output debug info"`
	Quiet    bool   `short:"q" long:"quiet" description:"Bool, Quiet"`
	NoBar    bool   `long:"no-bar"`
	Mod      string `short:"m" long:"mod" default:"path" choice:"path" choice:"host" description:"String, path/host spray"`
	Client   string `short:"c" long:"client" default:"auto" choice:"fast" choice:"standard" choice:"auto" description:"String, Client type"`
}

type ModeOptions

type ModeOptions struct {
	Force          bool   `long:"force"`
	CheckOnly      bool   `long:"check-only"`
	CheckPeriod    int    `long:"check-period" default:"100"`
	ErrPeriod      int    `long:"error-period" default:"10"`
	BreakThreshold int    `long:"error-threshold" default:"20"`
	BlackStatus    string `long:"black-status" default:"404,400,410"`
	WhiteStatus    string `long:"white-status" default:"200"`
	FuzzyStatus    string `long:"fuzzy-status" default:"403,500,501,502,503"`
}

type Option

func (*Option) PrepareRunner added in v0.1.0

func (opt *Option) PrepareRunner() (*Runner, error)

func (*Option) Validate

func (opt *Option) Validate() bool

type OutputOptions

type OutputOptions struct {
	Match       string   `long:"match" description:"String, "`
	Filter      string   `long:"filter" description:"String, "`
	Extracts    []string `long:"extract" description:"String, "`
	OutputFile  string   `short:"f" description:"String, output filename"`
	FuzzyFile   string   `long:"fuzzy-file" description:"String, fuzzy output filename"`
	Fuzzy       bool     `long:"fuzzy" description:"String, open fuzzy output"`
	OutputProbe string   `long:"probe" description:"String, output format"`
}

type Pool added in v0.1.0

type Pool struct {
	*pkg.Config
	Statistor *pkg.Statistor
	// contains filtered or unexported fields
}

func NewPool added in v0.1.0

func NewPool(ctx context.Context, config *pkg.Config) (*Pool, error)

func (*Pool) BaseCompare added in v0.1.1

func (p *Pool) BaseCompare(bl *pkg.Baseline) bool

func (*Pool) Close added in v0.1.0

func (p *Pool) Close()

func (*Pool) CompareWithExpr added in v0.2.0

func (p *Pool) CompareWithExpr(exp *vm.Program, other *pkg.Baseline) bool

func (*Pool) Init added in v0.1.0

func (p *Pool) Init() error

func (*Pool) PreCompare added in v0.1.0

func (p *Pool) PreCompare(resp *ihttp.Response) error

func (*Pool) PutToFuzzy added in v0.1.1

func (p *Pool) PutToFuzzy(bl *pkg.Baseline)

func (*Pool) PutToInvalid added in v0.1.1

func (p *Pool) PutToInvalid(bl *pkg.Baseline, reason string)

func (*Pool) Run added in v0.1.0

func (p *Pool) Run(ctx context.Context, offset, limit int)

type RequestOptions

type RequestOptions struct {
	Headers         []string `long:"header"`
	Method          string   `long:"method"`
	Cookie          string   `long:"cookie"`
	SimhashDistance int      `long:"distance" default:"5"`
}

type Runner

type Runner struct {
	Tasks          []*Task
	URLList        []string
	Wordlist       []string
	Headers        http.Header
	Fns            []func(string) string
	FilterExpr     *vm.Program
	MatchExpr      *vm.Program
	Threads        int
	PoolSize       int
	Pools          *ants.PoolWithFunc
	Timeout        int
	Mod            string
	Probes         []string
	OutputCh       chan *pkg.Baseline
	FuzzyCh        chan *pkg.Baseline
	Fuzzy          bool
	OutputFile     *files.File
	FuzzyFile      *files.File
	StatFile       *files.File
	Force          bool
	Progress       *uiprogress.Progress
	Offset         int
	Total          int
	Deadline       int
	CheckPeriod    int
	ErrPeriod      int
	BreakThreshold int
	CheckOnly      bool
	// contains filtered or unexported fields
}

func (*Runner) Done

func (r *Runner) Done()

func (*Runner) Outputting added in v0.1.0

func (r *Runner) Outputting()

func (*Runner) Prepare

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

func (*Runner) PrepareConfig

func (r *Runner) PrepareConfig() *pkg.Config

func (*Runner) Run

func (r *Runner) Run(ctx context.Context)

func (*Runner) RunWithCheck

func (r *Runner) RunWithCheck(ctx context.Context)

type Task

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

type Unit added in v0.1.0

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

Jump to

Keyboard shortcuts

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