Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HTTPRequest

type HTTPRequest struct {
	Method      string      `json:"method"`
	Proto       string      `json:"proto"`
	Host        string      `json:"host"`
	URL         string      `json:"url:"`
	Headers     http.Header `json:"headers"`
	ContentType string      `json:"content_type"`
	Body        []byte      `json:"body"`
}

func (HTTPRequest) IsType

func (r HTTPRequest) IsType(ctype string) bool

type HTTPResponse

type HTTPResponse struct {
	Protocol         string      `json:"protocol"`
	Status           string      `json:"status"`
	StatusCode       int         `json:"status_code"`
	Headers          http.Header `json:"headers"`
	Body             []byte      `json:"body"`
	ContentLength    int64       `json:"content_length"`
	ContentType      string      `json:"content_type"`
	TransferEncoding []string    `json:"transfer_encoding"`
}

func (HTTPResponse) IsType

func (r HTTPResponse) IsType(ctype string) bool

type SniffData

type SniffData map[string]interface{}

type Sniffer

type Sniffer struct {
	session.SessionModule
	Stats *SnifferStats
	Ctx   *SnifferContext
	// contains filtered or unexported fields
}

func NewSniffer

func NewSniffer(s *session.Session) *Sniffer

func (Sniffer) Author

func (mod Sniffer) Author() string

func (*Sniffer) Configure

func (mod *Sniffer) Configure() error

func (Sniffer) Description

func (mod Sniffer) Description() string

func (*Sniffer) GetContext

func (mod *Sniffer) GetContext() (error, *SnifferContext)

func (Sniffer) Name

func (mod Sniffer) Name() string

func (*Sniffer) Start

func (mod *Sniffer) Start() error

func (*Sniffer) StartFuzzing

func (mod *Sniffer) StartFuzzing() error

func (*Sniffer) Stop

func (mod *Sniffer) Stop() error

func (*Sniffer) StopFuzzing

func (mod *Sniffer) StopFuzzing() error

type SnifferContext

type SnifferContext struct {
	Handle       *pcap.Handle
	Source       string
	DumpLocal    bool
	Verbose      bool
	Filter       string
	Expression   string
	Compiled     *regexp.Regexp
	Output       string
	OutputFile   *os.File
	OutputWriter *pcapgo.Writer
}

func NewSnifferContext

func NewSnifferContext() *SnifferContext

func (*SnifferContext) Close

func (c *SnifferContext) Close()

func (*SnifferContext) Log

func (c *SnifferContext) Log(sess *session.Session)

type SnifferEvent

type SnifferEvent struct {
	PacketTime  time.Time   `json:"time"`
	Protocol    string      `json:"protocol"`
	Source      string      `json:"from"`
	Destination string      `json:"to"`
	Message     string      `json:"message"`
	Data        interface{} `json:"data"`
}

func NewSnifferEvent

func NewSnifferEvent(t time.Time, proto string, src string, dst string, data interface{}, format string, args ...interface{}) SnifferEvent

func (SnifferEvent) Push

func (e SnifferEvent) Push()

type SnifferStats

type SnifferStats struct {
	NumLocal    uint64
	NumMatched  uint64
	NumDumped   uint64
	NumWrote    uint64
	Started     time.Time
	FirstPacket time.Time
	LastPacket  time.Time
}

func NewSnifferStats

func NewSnifferStats() *SnifferStats

func (*SnifferStats) Print

func (s *SnifferStats) Print() error