network

package
v2.9.2 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2022 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Get

func Get() (*net.Dialer, error)

Get creates or gets a client for the protocol based on custom configuration

Types

type Input

type Input struct {
	// Data is the data to send as the input
	Data string `json:"data"`
	// Type is the type of input - hex, text.
	Type string `json:"type"`
	// Read is the number of bytes to read from socket
	Read int `json:"read"`
	// Name is the optional name of the input to provide matching on
	Name string `json:"name"`
}

Input is the input to send on the network

type Request

type Request struct {
	ID string `json:"id"`

	// Address is the address to send requests to (host:port:tls combos generally)
	Address []string `json:"host"`

	// AttackType is the attack type
	// Sniper, PitchFork and ClusterBomb. Default is Sniper
	AttackType string `json:"attack"`
	// Path contains the path/s for the request variables
	Payloads map[string]interface{} `json:"payloads"`

	// Payload is the payload to send for the network request
	Inputs []*Input `json:"inputs"`
	// ReadSize is the size of response to read (1024 if not provided by default)
	ReadSize int `json:"read-size"`

	ReadAll bool `json:"read-all"`

	protocols.Operators `json:",inline,omitempty"`
	// Operators for the current request go here.
	CompiledOperators *protocols.Operators
	// contains filtered or unexported fields
}

Request contains a Network protocol request to be made from a template

func (*Request) Compile

func (r *Request) Compile(options *protocols.ExecuterOptions) error

Compile compiles the protocol request for further execution.

func (*Request) ExecuteWithResults

func (r *Request) ExecuteWithResults(input string, dynamicValues map[string]interface{}, callback protocols.OutputEventCallback) error

ExecuteWithResults executes the protocol requests and returns results instead of writing them.

func (*Request) Extract

func (r *Request) Extract(data map[string]interface{}, extractor *protocols.Extractor) map[string]struct{}

Extract performs extracting operation for an extractor on model and returns true or false.

func (*Request) GetID

func (r *Request) GetID() string

GetID returns the unique ID of the request if any.

func (*Request) Match

func (r *Request) Match(data map[string]interface{}, matcher *protocols.Matcher) bool

func (*Request) Requests

func (r *Request) Requests() int

Requests returns the total number of requests the YAML rule will perform

Jump to

Keyboard shortcuts

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