analyzers

package
v3.3.7 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ApplyPayloadTransformations

func ApplyPayloadTransformations(value string) string

ApplyPayloadTransformations applies the payload transformations to the payload It supports the below payloads -

  • [RANDNUM] => random number between 1000 and 9999
  • [RANDSTR] => random string of 4 characters

func GetRandomInteger

func GetRandomInteger() int

GetRandomInteger returns a random integer between 1000 and 9999

func RegisterAnalyzer

func RegisterAnalyzer(name string, analyzer Analyzer)

RegisterAnalyzer registers a new analyzer

Types

type Analyzer

type Analyzer interface {
	// Name returns the name of the analyzer
	Name() string
	// ApplyTransformation applies the transformation to the initial payload.
	ApplyInitialTransformation(data string, params map[string]interface{}) string
	// Analyze is the main function for the analyzer
	Analyze(options *Options) (bool, string, error)
}

Analyzer is an interface for all the analyzers that can be used for the fuzzer

func GetAnalyzer

func GetAnalyzer(name string) Analyzer

GetAnalyzer returns the analyzer for a given name

type AnalyzerTemplate

type AnalyzerTemplate struct {
	// description: |
	//   Name is the name of the analyzer to use
	// values:
	//   - time_delay
	Name string `json:"name" yaml:"name"`
	// description: |
	//   Parameters is the parameters for the analyzer
	//
	//   Parameters are different for each analyzer. For example, you can customize
	//   time_delay analyzer with sleep_duration, time_slope_error_range, etc. Refer
	//   to the docs for each analyzer to get an idea about parameters.
	Parameters map[string]interface{} `json:"parameters" yaml:"parameters"`
}

AnalyzerTemplate is the template for the analyzer

type Options

type Options struct {
	FuzzGenerated      fuzz.GeneratedRequest
	HttpClient         *retryablehttp.Client
	ResponseTimeDelay  time.Duration
	AnalyzerParameters map[string]interface{}
}

Options contains the options for the analyzer

Directories

Path Synopsis
Package time implements a time delay analyzer using linear regression heuristics inspired from ZAP to discover time based issues.
Package time implements a time delay analyzer using linear regression heuristics inspired from ZAP to discover time based issues.

Jump to

Keyboard shortcuts

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