generate

package
v1.3.2 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2024 License: AGPL-3.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const Fallback modifier.Modifier = 1 << 20

Variables

View Source
var ErrOverFlow = errors.New("bytemap too small")

Functions

func HTTPCombination

func HTTPCombination(mp map[modifier.Modifier][]byte) []byte

func MustGenerator

func MustGenerator(expr string) regen.Generator

Types

type ByteMapModifier

type ByteMapModifier interface {
	Modify(payload *bytemap.ByteMap) error
}

type ContentGen

type ContentGen struct {
	Modifiers []ByteMapModifier
	Len       int
	// contains filtered or unexported fields
}

func (*ContentGen) Gen

func (c *ContentGen) Gen() []byte

type ContentGenOpt

type ContentGenOpt func(*ContentGen)

func WithNoise

func WithNoise(noise noiseFunc) ContentGenOpt

func WithPostHandler

func WithPostHandler(f func([]byte) []byte) ContentGenOpt

func WithPostModifier

func WithPostModifier(mdf ByteMapModifier) ContentGenOpt

func WithTryLen

func WithTryLen(Len int) ContentGenOpt

type ContentModifier

type ContentModifier struct {
	NoCase   bool
	Offset   int
	Range    int
	Relative bool
	Filter   func(free []int, payload *bytemap.ByteMap, cm *ContentModifier) []int
	Content  []byte
}

ContentModifier define a method to modfiy content Content should be put at [Offset, Offset + Range] If Relative is true, Offset should be relative former one, Negetive value of Offset is used as the reverse order (can't use together with Relative and Rand).

func (*ContentModifier) Modify

func (m *ContentModifier) Modify(payload *bytemap.ByteMap) error

type DNSGen

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

func (*DNSGen) Gen

func (g *DNSGen) Gen() []byte

type DirectGen

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

func (*DirectGen) Gen

func (c *DirectGen) Gen() []byte

type Generator

type Generator interface {
	Gen() []byte
}

func New

func New(r *rule.Rule) (Generator, error)

type HTTPGen

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

func (*HTTPGen) Gen

func (g *HTTPGen) Gen() []byte

type HTTPHeaderGen

type HTTPHeaderGen []*ContentGen

func (*HTTPHeaderGen) Gen

func (h *HTTPHeaderGen) Gen() []byte

type ICMPGen

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

func (*ICMPGen) Gen

func (g *ICMPGen) Gen() []byte

type ModifierGenerator

type ModifierGenerator interface {
	Gen() []byte
}

type RegexpModifier

type RegexpModifier struct {
	Generator *pcre.Generator
}

func (*RegexpModifier) Modify

func (m *RegexpModifier) Modify(payload *bytemap.ByteMap) error

type TCPGen

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

func (*TCPGen) Gen

func (g *TCPGen) Gen() []byte

type UDPGen

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

func (*UDPGen) Gen

func (g *UDPGen) Gen() []byte

Jump to

Keyboard shortcuts

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