encoding

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2022 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RemovePortFromClientIP added in v0.2.0

func RemovePortFromClientIP(host string) string

Types

type BurpMarshaller

type BurpMarshaller struct {
	Ndots int
}

BurpMarshaller implements the Marshaller interface

func NewBurpMarshaller

func NewBurpMarshaller() *BurpMarshaller

NewBurpMarshaller returns BurpMarshaller that allows data to be marshalled according to Burp JSON format by calling MarshalToJSON()

func (*BurpMarshaller) EmptyResponse

func (m *BurpMarshaller) EmptyResponse() []byte

EmptyResponse returns an empty responses struct

func (*BurpMarshaller) EventToBlob

func (m *BurpMarshaller) EventToBlob(data []*polling.Event) ([]byte, error)

EventToBlob converts the polling event into a JSON blob for use with JSONBlob response type

func (*BurpMarshaller) MarshalToJSON

func (m *BurpMarshaller) MarshalToJSON(data interface{}) ([]byte, error)

BurpMarshaller.MarshalToJSON

type BurpResultsV4

type BurpResultsV4 struct {
	Responses
}

BurpResultsV4 matches the Burp X-Collaborator-Version: 4 expected response

type DNSInput

type DNSInput struct {
	SubdomainQuestion string
	RawRequest        string
	RequestType       uint16
	Answer            string
	ClientIP          string
	OpCode            int
}

DNSInput defines DNS interaction data to marshal

type DNSResultData

type DNSResultData struct {
	Subdomain  string `json:"subDomain"`
	Type       uint16 `json:"type"`
	RawRequest string `json:"rawRequest"`
}

DNSResultData will contain b64 encoded strings

type HTTPInput

type HTTPInput struct {
	Ctx      echo.Context
	Request  []byte
	Response []byte
}

HTTPInput defines HTTPInput interaction data to marshal

type HTTPResultData

type HTTPResultData struct {
	Response string `json:"response"`
	Request  string `json:"request"`
}

HTTPResultData will contain b64 encoded strings

type Marshal

type Marshal struct {
	Marshaller
}

Marshal contains Marshaller method

func NewMarshaller

func NewMarshaller(m Marshaller) *Marshal

NewMarshaller constructs a new JSON Marshaller

type Marshaller

type Marshaller interface {
	MarshalToJSON(interface{}) ([]byte, error)
	EventToBlob([]*polling.Event) ([]byte, error)
	EmptyResponse() []byte
}

Marshaller interface implements the builder pattern for constructing JSON formats for desired output customization

func Format

func Format(c string) Marshaller

Format takes desired format for Marshaller

type RawInput

type RawInput struct {
	InteractionURI string
	Protocol       string
	ClientIP       string
	Request        []byte
	Response       []byte
}

RawInput is used as a generic input to the marshaller

type RawResultData added in v0.2.0

type RawResultData struct {
	Response string `json:"response"`
	Request  string `json:"request"`
}

RawResultData will contain b64 encoded strings

type Response

type Response struct {
	Protocol      string      `json:"protocol"`
	OpCode        string      `json:"opCode"`
	InteractionID string      `json:"interactionString"`
	ClientPart    string      `json:"clientPart"`
	Time          string      `json:"time"`
	Data          interface{} `json:"data"`
	ClientIP      string      `json:"client"`
}

Reponse.Data is of protocolType, e.g. HTTPResultDATA

type Responses

type Responses struct {
	Interactions []Response `json:"responses"`
}

Responses returns all event Interactions in BurpResults format

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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