generators

package
v3.2.7-fix Latest Latest
Warning

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

Go to latest
Published: May 15, 2024 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildPayloadFromOptions

func BuildPayloadFromOptions(options *types.Options) map[string]interface{}

BuildPayloadFromOptions returns a map with the payloads provided via CLI

func EnvVars

func EnvVars() map[string]interface{}

EnvVars returns a map with all environment variables into a map

func ExpandMapValues

func ExpandMapValues(m map[string]string) map[string][]string

ExpandMapValues converts values from flat string to string slice

func MergeMaps

func MergeMaps(maps ...map[string]interface{}) map[string]interface{}

MergeMaps merges two maps into a new map

func MergeMapsMany

func MergeMapsMany(maps ...interface{}) map[string][]string

MergeMapsMany merges many maps into a new map

func SliceToMap

func SliceToMap(s []string, sep string) map[string]interface{}

SliceToMap converts a slice of strings to map of string splitting each item at sep as "key sep value"

Types

type AttackType

type AttackType int

AttackType is the type of attack for payloads

const (
	// name:batteringram
	BatteringRamAttack AttackType = iota + 1
	// name:pitchfork
	PitchForkAttack
	// name:clusterbomb
	ClusterBombAttack
)

Supported values for the AttackType name:AttackType

func GetSupportedAttackTypes

func GetSupportedAttackTypes() []AttackType

func (AttackType) String

func (t AttackType) String() string

type AttackTypeHolder

type AttackTypeHolder struct {
	Value AttackType `mapping:"true"`
}

AttackTypeHolder is used to hold internal type of the protocol

func (AttackTypeHolder) JSONSchema

func (holder AttackTypeHolder) JSONSchema() *jsonschema.Schema

func (*AttackTypeHolder) MarshalJSON

func (holder *AttackTypeHolder) MarshalJSON() ([]byte, error)

func (AttackTypeHolder) MarshalYAML

func (holder AttackTypeHolder) MarshalYAML() (interface{}, error)

func (*AttackTypeHolder) UnmarshalJSON

func (holder *AttackTypeHolder) UnmarshalJSON(data []byte) error

func (*AttackTypeHolder) UnmarshalYAML

func (holder *AttackTypeHolder) UnmarshalYAML(unmarshal func(interface{}) error) error

type Iterator

type Iterator struct {
	Type AttackType
	// contains filtered or unexported fields
}

Iterator is a single instance of an iterator for a generator structure

func (*Iterator) Remaining

func (i *Iterator) Remaining() int

Remaining returns the amount of requests left for the generator.

func (*Iterator) Reset

func (i *Iterator) Reset()

Reset resets the iterator back to its initial value

func (*Iterator) Total

func (i *Iterator) Total() int

Total returns the amount of input combinations available

func (*Iterator) Value

func (i *Iterator) Value() (map[string]interface{}, bool)

Value returns the next value for an iterator

type PayloadGenerator

type PayloadGenerator struct {
	Type AttackType
	// contains filtered or unexported fields
}

PayloadGenerator is the generator struct for generating payloads

func New

func New(payloads map[string]interface{}, attackType AttackType, templatePath string, catalog catalog.Catalog, customAttackType string, opts *types.Options) (*PayloadGenerator, error)

New creates a new generator structure for payload generation

func (*PayloadGenerator) NewIterator

func (g *PayloadGenerator) NewIterator() *Iterator

NewIterator creates a new iterator for the payloads generator

Jump to

Keyboard shortcuts

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