scan

package
v0.0.0-...-b197d6e Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	DictionaryPath                      string
	DictionaryTimeoutInMilliseconds     int
	HTTPMethods                         []string
	HTTPStatusesToIgnore                []int
	Threads                             int
	TimeoutInMilliseconds               int
	CacheRequests                       bool
	ScanDepth                           int
	Socks5Url                           *url.URL
	UserAgent                           string
	UseCookieJar                        bool
	Cookies                             []*http.Cookie
	Headers                             map[string]string
	Out                                 string
	ShouldSkipSSLCertificatesValidation bool
	IgnoreEmpty20xResponses             bool
}

Config represents the configuration needed to perform a scan.

type Doer

type Doer interface {
	Do(*http.Request) (*http.Response, error)
}

type Producer

type Producer interface {
	Produce(ctx context.Context) <-chan Target
}

type ReProducer

type ReProducer interface {
	Reproduce(ctx context.Context) func(r Result) <-chan Target
}

type Result

type Result struct {
	Target        Target
	StatusCode    int
	URL           url.URL
	ContentLength int64
}

Result represents the result of the scan of a single URL.

func NewResult

func NewResult(target Target, response *http.Response) Result

NewResult creates a new instance of the Result entity based on the Target and Response.

type ResultFilter

type ResultFilter interface {
	ShouldIgnore(Result) bool
}

type Scanner

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

func NewScanner

func NewScanner(
	httpClient Doer,
	producer Producer,
	reproducer ReProducer,
	resultFilter ResultFilter,
	logger *logrus.Logger,
) *Scanner

func (*Scanner) Scan

func (s *Scanner) Scan(ctx context.Context, baseURL *url.URL, workers int) <-chan Result

type Target

type Target struct {
	Path   string
	Method string
	Depth  int
}

Target represents the target to scan.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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