provider

package
v3.2.7 Latest Latest
Warning

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

Go to latest
Published: May 10, 2024 License: MIT Imports: 12 Imported by: 1

Documentation

Index

Constants

View Source
const (
	MultiFormatInputProvider = "MultiFormatInputProvider"
	ListInputProvider        = "ListInputProvider"
	SimpleListInputProvider  = "SimpleInputProvider"
)

Variables

View Source
var (
	ErrNotImplemented = errorutil.NewWithFmt("provider %s does not implement %s")
	ErrInactiveInput  = fmt.Errorf("input is inactive")
)

Functions

func IsErrNotImplemented

func IsErrNotImplemented(err error) bool

IsErrNotImplemented checks if an error is a not implemented error

func SupportedInputFormats

func SupportedInputFormats() string

SupportedFormats returns all supported input formats of nuclei

Types

type ChunkedInputProvider

type ChunkedInputProvider interface {
	// Count returns total targets for input provider
	Count() int64
	// Iterate over all inputs in order
	Iterate(callback func(value *contextargs.MetaInput) bool)
	// Set adds item to input provider
	Set(value string)
	// SetWithProbe adds item to input provider with http probing
	SetWithProbe(value string, probe types.InputLivenessProbe) error
	// SetWithExclusions adds item to input provider if it doesn't match any of the exclusions
	SetWithExclusions(value string) error
	// InputType returns the type of input provider
	InputType() string
	// Switches to the next chunk/batch of input
	NextChunk() bool
}

ChunkedInputProvider is an input providing chunked targets instead of loading all at once

type InputOptions

type InputOptions struct {
	// Options for global config
	Options *configTypes.Options
	// NotFoundCallback is the callback to call when input is not found
	// only supported in list input provider
	NotFoundCallback func(template string) bool
}

InputOptions contains options for input provider

type InputProvider

type InputProvider interface {
	// Count returns total targets for input provider
	Count() int64
	// Iterate over all inputs in order
	Iterate(callback func(value *contextargs.MetaInput) bool)
	// Set adds item to input provider
	Set(value string)
	// SetWithProbe adds item to input provider with http probing
	SetWithProbe(value string, probe types.InputLivenessProbe) error
	// SetWithExclusions adds item to input provider if it doesn't match any of the exclusions
	SetWithExclusions(value string) error
	// InputType returns the type of input provider
	InputType() string
	// Close the input provider and cleanup any resources
	Close()
}

InputProvider is unified input provider interface that provides processed inputs to nuclei by parsing and providing different formats such as list,openapi,postman,proxify,burp etc.

func NewInputProvider

func NewInputProvider(opts InputOptions) (InputProvider, error)

NewInputProvider creates a new input provider based on the options and returns it

type SimpleInputProvider

type SimpleInputProvider struct {
	Inputs []*contextargs.MetaInput
}

SimpleInputProvider is a simple input provider for nuclei that acts like a No-Op and returns given list of urls as input

func NewSimpleInputProvider

func NewSimpleInputProvider() *SimpleInputProvider

NewSimpleInputProvider creates a new simple input provider

func NewSimpleInputProviderWithUrls

func NewSimpleInputProviderWithUrls(urls ...string) *SimpleInputProvider

NewSimpleInputProviderWithUrls creates a new simple input provider with the given urls

func (*SimpleInputProvider) Close

func (s *SimpleInputProvider) Close()

Close the input provider and cleanup any resources

func (*SimpleInputProvider) Count

func (s *SimpleInputProvider) Count() int64

Count returns the total number of targets for the input provider

func (*SimpleInputProvider) InputType

func (s *SimpleInputProvider) InputType() string

InputType returns the type of input provider

func (*SimpleInputProvider) Iterate

func (s *SimpleInputProvider) Iterate(callback func(value *contextargs.MetaInput) bool)

Iterate over all inputs in order

func (*SimpleInputProvider) Set

func (s *SimpleInputProvider) Set(value string)

Set adds an item to the input provider

func (*SimpleInputProvider) SetWithExclusions

func (s *SimpleInputProvider) SetWithExclusions(value string) error

SetWithExclusions adds an item to the input provider if it doesn't match any of the exclusions

func (*SimpleInputProvider) SetWithProbe

func (s *SimpleInputProvider) SetWithProbe(value string, probe types.InputLivenessProbe) error

SetWithProbe adds an item to the input provider with HTTP probing

Directories

Path Synopsis
package list implements a hybrid hmap/filekv backed input provider for nuclei that can either stream or store results using different kv stores.
package list implements a hybrid hmap/filekv backed input provider for nuclei that can either stream or store results using different kv stores.

Jump to

Keyboard shortcuts

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