protocols

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2023 License: MIT Imports: 28 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HandleADB

func HandleADB(ctx context.Context, conn net.Conn, logger Logger, h Honeypot) error

HandleADB Android Debug bridge handler

func HandleBittorrent

func HandleBittorrent(ctx context.Context, conn net.Conn, logger Logger, h Honeypot) error

HandleBittorrent handles a Bittorrent connection

func HandleFTP

func HandleFTP(ctx context.Context, conn net.Conn, logger Logger, h Honeypot) error

HandleFTP takes a net.Conn and does basic FTP communication

func HandleHTTP

func HandleHTTP(ctx context.Context, conn net.Conn, logger Logger, h Honeypot) error

HandleHTTP takes a net.Conn and does basic HTTP communication

func HandleJabber

func HandleJabber(ctx context.Context, conn net.Conn, logger Logger, h Honeypot) error

HandleJabber main handler

func HandleMQTT

func HandleMQTT(ctx context.Context, conn net.Conn, logger Logger, h Honeypot) error

HandleMQTT handles a MQTT connection

func HandleMemcache

func HandleMemcache(ctx context.Context, conn net.Conn, logger Logger, h Honeypot) error

func HandleRDP

func HandleRDP(ctx context.Context, conn net.Conn, logger Logger, h Honeypot) error

HandleRDP takes a net.Conn and does basic RDP communication

func HandleRFB

func HandleRFB(ctx context.Context, conn net.Conn, logger Logger, h Honeypot) error

HandleRFB takes a net.Conn and does basic RFB/VNC communication

func HandleSIP

func HandleSIP(ctx context.Context, conn net.Conn, logger Logger, h Honeypot) error

HandleSIP takes a net.Conn and does basic SIP communication

func HandleSMB

func HandleSMB(ctx context.Context, conn net.Conn, logger Logger, h Honeypot) error

HandleSMB takes a net.Conn and does basic SMB communication

func HandleSMTP

func HandleSMTP(ctx context.Context, conn net.Conn, logger Logger, h Honeypot) error

HandleSMTP takes a net.Conn and does basic SMTP communication

func HandleTCP

func HandleTCP(ctx context.Context, conn net.Conn, logger Logger, h Honeypot) error

HandleTCP takes a net.Conn and peeks at the data send

func HandleTelnet

func HandleTelnet(ctx context.Context, conn net.Conn, logger Logger, h Honeypot) error

HandleTelnet handles telnet communication on a connection

func MapProtocolHandlers

func MapProtocolHandlers(log Logger, h Honeypot) map[string]HandlerFunc

mapProtocolHandlers map protocol handlers to corresponding protocol

func ReadTelnetMsg

func ReadTelnetMsg(conn net.Conn, logger Logger, h Honeypot) (string, error)

ReadTelnetMsg reads a telnet message from a connection

func WriteTelnetMsg

func WriteTelnetMsg(conn net.Conn, msg string, logger Logger, h Honeypot) error

WriteTelnetMsg writes a telnet message to the connection

Types

type BufferedConn

type BufferedConn struct {
	net.Conn // So that most methods are embedded
	// contains filtered or unexported fields
}

BufferedConn provides an interface to peek at a connection

func Peek

func Peek(conn net.Conn, length int) ([]byte, BufferedConn, error)

Peek reads `length` amount of data from the connection

func (BufferedConn) Read

func (b BufferedConn) Read(p []byte) (int, error)

type Client

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

Client is a connection container

type HandlerFunc

type HandlerFunc func(ctx context.Context, conn net.Conn) error

type Honeypot

type Honeypot interface {
	Produce(protocol string, conn net.Conn, md *connection.Metadata, payload []byte, decoded interface{}) error
	ConnectionByFlow([2]uint64) *connection.Metadata
	UpdateConnectionTimeout(ctx context.Context, conn net.Conn)
	MetadataByConnection(net.Conn) (*connection.Metadata, error)
}

type JabberClient

type JabberClient struct {
	STo         string   `xml:"to,attr"`
	Version     string   `xml:"version,attr"`
	XMLns       string   `xml:"xmlns,attr"`
	ID          string   `xml:"id,attr"`
	XMLnsStream string   `xml:"xmlns stream,attr"`
	XMLName     xml.Name `xml:"http://etherx.jabber.org/streams stream"`
}

JabberClient structure in Jabber protocol

type Logger

type Logger interface {
	Debug(msg string, fields ...zap.Field)
	Info(msg string, fields ...zap.Field)
	Warn(msg string, fields ...zap.Field)
	Error(msg string, fields ...zap.Field)
}

type PixelFormat

type PixelFormat struct {
	Width, Heigth                   uint16
	BPP, Depth                      uint8
	BigEndian, TrueColour           uint8 // flags; 0 or non-zero
	RedMax, GreenMax, BlueMax       uint16
	RedShift, GreenShift, BlueShift uint8
	Padding                         [3]uint8
	ServerNameLength                int32
}

PixelFormat represents a RFB communication unit

type ServersJabber

type ServersJabber struct {
	XMLName xml.Name       `xml:"servers"`
	Version string         `xml:"version,attr"`
	Svs     []serverJabber `xml:"server"`
}

ServersJabber defines servers structure

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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