runner

package
v1.4.3 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2023 License: MIT Imports: 58 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// HTTP defines the plain http scheme
	HTTP = "http"
	// HTTPS defines the secure http scheme
	HTTPS = "https"
	// HTTPorHTTPS defines both http and https scheme in mutual exclusion
	HTTPorHTTPS = "http|https"
	// HTTPandHTTPS defines both http and https scheme
	HTTPandHTTPS = "http&https"
)
View Source
const (
	HeaderKeyUserAgent     = "User-Agent"
	HeaderKeyCookie        = "Cookie"
	HeaderKeyAuthorization = "Authorization"
)
View Source
const (
	Version = `1.4.3`
)

Variables

View Source
var (
	PathScanMatchVersion, _ = util.GetMatchVersion(defaultMatchDir)
)

Functions

func CheckMatchVersion added in v1.2.1

func CheckMatchVersion() (error, bool)

func CheckVersion

func CheckVersion() error

func DecodeData added in v1.4.2

func DecodeData(data []byte, headers http.Header) ([]byte, error)

ExtractTitle from a response

func DecodeKorean added in v1.4.2

func DecodeKorean(s []byte) ([]byte, error)

func Decodebig5 added in v1.4.2

func Decodebig5(s []byte) ([]byte, error)

Decodebig5 converts BIG5 to UTF-8

func Decodegbk added in v1.4.2

func Decodegbk(s []byte) ([]byte, error)

Decodegbk converts GBK to UTF-8

func DefaultResumeFilePath

func DefaultResumeFilePath(filename string) string

func DefaultResumeFolderPath

func DefaultResumeFolderPath() string

func DownloadDict

func DownloadDict() error

func Encodebig5 added in v1.4.2

func Encodebig5(s []byte) ([]byte, error)

Encodebig5 converts UTF-8 to BIG5

func InitConfig

func InitConfig() error

func InitJs

func InitJs() error

func InitMatch

func InitMatch() error

func InitPathDict

func InitPathDict() error

func InitPathScan

func InitPathScan() error

func Match

func Match(data map[string]interface{}, matcher *matchers.Matcher) (bool, []string)

func UpdateHTMLTemplate added in v1.3.1

func UpdateHTMLTemplate() (bool, error)

func UpdateMatch

func UpdateMatch() (bool, error)

func UpdateVersion

func UpdateVersion() (bool, error)

Types

type Cached added in v1.4.0

type Cached struct {
	CachedString map[string]struct{} `json:"cached-string"`
	Lock         sync.RWMutex        `json:"-"`
}

func NewCached added in v1.4.0

func NewCached() *Cached

func (*Cached) HasInCached added in v1.4.0

func (c *Cached) HasInCached(path string) (ok bool)

func (*Cached) Set added in v1.4.0

func (c *Cached) Set(path string)

type Options

type Options struct {
	Url                       goflags.StringSlice         `json:"url"`
	UrlFile                   goflags.StringSlice         `json:"url-file"`
	UrlRemote                 string                      `json:"url-remote"`
	UrlChannel                bool                        `json:"url-channel"`
	Path                      goflags.StringSlice         `json:"path"`
	PathFile                  goflags.StringSlice         `json:"path-file"`
	PathRemote                string                      `json:"path-remote"`
	Subdomain                 bool                        `json:"subdomain"`
	ResumeCfg                 string                      `json:"resume-cfg"`
	Output                    string                      `json:"output"`
	RateLimit                 int                         `json:"rate-http"`
	Threads                   int                         `json:"thread"`
	Retries                   int                         `json:"retries"`
	Proxy                     string                      `json:"proxy"`
	ProxyAuth                 string                      `json:"proxy-auth"`
	NoColor                   bool                        `json:"no-color"`
	Verbose                   bool                        `json:"verbose"`
	Silent                    bool                        `json:"silent"`
	OnlyTargets               bool                        `json:"only-targets_"`
	SkipUrl                   goflags.StringSlice         `json:"skip-url"`
	SkipCode                  goflags.StringSlice         `json:"skip-code"`
	SkipHash                  string                      `json:"skip-hash"`
	SkipBodyLen               int                         `json:"skip-body-len"`
	SkipHashMethod            string                      `json:"skip-hash-method"`
	ErrUseLastResponse        bool                        `json:"err-use-last-response"`
	Csv                       bool                        `json:"csv,omitempty"`
	ClearResume               bool                        `json:"clear-resume"`
	Html                      bool                        `json:"html,omitempty"`
	Version                   bool                        `json:"version"`
	Uncover                   bool                        `json:"uncover"`
	UncoverQuery              goflags.StringSlice         `json:"uncover-query"`
	UncoverEngine             goflags.StringSlice         `json:"uncover-engine"`
	UncoverDelay              int                         `json:"uncover-delay"`
	UncoverLimit              int                         `json:"uncover-limit"`
	UncoverField              string                      `json:"uncover-field"`
	UncoverOutput             string                      `json:"uncover-output"`
	UpdatePathScanVersion     bool                        `json:"update"`
	UpdatePathDictVersion     bool                        `json:"update-path-dict-version"`
	UserAgent                 goflags.StringSlice         `json:"user-agent"`
	Cookie                    string                      `json:"cookie"`
	Authorization             string                      `json:"authorization"`
	Header                    goflags.StringSlice         `json:"header"`
	HeaderFile                goflags.StringSlice         `json:"header-file"`
	Timeout                   int                         `json:"timeout"`
	UpdateMatchVersion        bool                        `json:"update-match-version"`
	UpdateHTMLTemplateVersion bool                        `json:"update-html-template-version"`
	Method                    goflags.StringSlice         `json:"method"`
	MatchPath                 string                      `json:"match-path"`
	RecursiveRun              bool                        `json:"recursive-run"`
	RecursiveRunTimes         int                         `json:"recursive-run-times"`
	GetHash                   bool                        `json:"get-hash"`
	FindOtherDomainList       goflags.StringSlice         `json:"find-other-domain-list"`
	ResultBack                func(result *result.Result) `json:"-"`
	NotInit                   bool                        `json:"not-init"`
	Body                      string                      `json:"body"`
	FindOtherDomain           bool                        `json:"find-other-domain"`
	SkipAutoUpdateMatch       bool                        `json:"skip-auto-update-match"`
	SubdomainLimit            int                         `json:"subdomain-limit"`
	SubdomainQuery            goflags.StringSlice         `json:"subdomain-query"`
	SubdomainEngine           goflags.StringSlice         `json:"subdomain-engine"`
	SubdomainOutput           string                      `json:"subdomain-output"`
	Resolvers                 goflags.StringSlice         `json:"resolvers"`
	WaitTimeout               int                         `json:"wait-timeout"`
}

func ParserOptions

func ParserOptions() *Options

func (*Options) Validate

func (o *Options) Validate() error

type Response added in v1.4.2

type Response struct {
	Response      *defaultHttp.Response
	Raw           string
	RawData       []byte
	RawHeaders    string
	Headers       map[string][]string
	StatusCode    int
	ContentLength int
	Data          []byte
}

type ResumeCfg

type ResumeCfg struct {
	Rwm           *sync.RWMutex
	Options       *Options `json:"options"`
	ResultsCached *Cached  `json:"results-cached"`
	OutputCached  *Cached  `json:"output-cached"`
}

func ParserResumeCfg

func ParserResumeCfg(filename string) (*ResumeCfg, error)

func (*ResumeCfg) CleanupResumeConfig

func (cfg *ResumeCfg) CleanupResumeConfig()

func (*ResumeCfg) ClearResume

func (cfg *ResumeCfg) ClearResume()

func (*ResumeCfg) MarshalResume

func (cfg *ResumeCfg) MarshalResume(filename string) error

type Runner

type Runner struct {
	Cfg *ResumeCfg
	// contains filtered or unexported fields
}

func NewRunner

func NewRunner(options *Options) (*Runner, error)

func (*Runner) CheckSkip added in v1.4.0

func (r *Runner) CheckSkip(status int, contentLength int, body []byte) bool

func (*Runner) Close added in v1.3.0

func (r *Runner) Close()

func (*Runner) GetDNSData added in v1.4.0

func (r *Runner) GetDNSData(hostname string) (ips, cnames []string, err error)

func (*Runner) NewClient added in v1.4.0

func (r *Runner) NewClient() *defaultHttp.Client

func (*Runner) NewRequest added in v1.4.0

func (r *Runner) NewRequest(ctx context.Context, method string, url string, body interface{}) (*http.Request, error)

func (*Runner) NewRetryableClient added in v1.4.0

func (r *Runner) NewRetryableClient() *http.Client

func (*Runner) RunEnumeration added in v1.4.0

func (r *Runner) RunEnumeration() error

Jump to

Keyboard shortcuts

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