skidd

package module
v0.0.0-...-ce71dcb Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2017 License: Apache-2.0 Imports: 9 Imported by: 0

README

skidd

SSH Honeypot

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNilServerConfig = fmt.Errorf("Nil server config")

ErrNilServerConfig is returned when a ConnMaster has no server config.

View Source
var Upgrader = websocket.Upgrader{
	CheckOrigin: func(r *http.Request) bool { return true },
}

Upgrader is a struct that contains ws protocol upgrade configuration.

Functions

This section is empty.

Types

type ConnMaster

type ConnMaster struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

ConnMaster is used to manage a set of net.Conn and ssh.ServerConn connections.

func NewConnMaster

func NewConnMaster(serverConfig *ssh.ServerConfig) *ConnMaster

NewConnMaster returns a *ConnMaster.

func (*ConnMaster) AddConn

func (cm *ConnMaster) AddConn(conn net.Conn)

func (*ConnMaster) AddServerConn

func (cm *ConnMaster) AddServerConn(
	key string,
	serverConn *ssh.ServerConn,
)

func (*ConnMaster) Callbacks

func (cm *ConnMaster) Callbacks(channel string) []func(string) error

func (ConnMaster) ConnKey

func (cm ConnMaster) ConnKey(conn net.Conn) string

ConnKey returns a string that is use for keeping track of the conn.

func (*ConnMaster) ConnKeys

func (cm *ConnMaster) ConnKeys() []string

Conns returns the map of active connections.

func (*ConnMaster) Conns

func (cm *ConnMaster) Conns() map[string]*ConnMasterConn

Conns returns the map of active connections.

func (*ConnMaster) HandleConn

func (cm *ConnMaster) HandleConn(conn net.Conn) error

func (*ConnMaster) OnRead

func (cm *ConnMaster) OnRead(channel, payload string)

func (*ConnMaster) RegisterReadCallback

func (cm *ConnMaster) RegisterReadCallback(channel, key string, cb func(string) error)

func (*ConnMaster) RemoveConn

func (cm *ConnMaster) RemoveConn(key string)

func (*ConnMaster) ServerConfig

func (cm *ConnMaster) ServerConfig() *ssh.ServerConfig

type ConnMasterConn

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

ConnMasterConn is an struct used to store the net.Conn and ssh.ServerConn for a connection.

type WsConnMaster

type WsConnMaster struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

WsConnMaster is used to manage a set of websocket.Conns

func NewWsConnMaster

func NewWsConnMaster(cm *ConnMaster) *WsConnMaster

NewWsConnMaster returns a *WsConnMaster

func (*WsConnMaster) AddWsConn

func (wsCm *WsConnMaster) AddWsConn(wsConn *websocket.Conn)

AddWsConn adds a *websocket.Conn to the WsConnMaster.

func (*WsConnMaster) HandleWsConn

func (wsCm *WsConnMaster) HandleWsConn(wsConn *websocket.Conn) error

HandleWsConn handles the *websocket.Conn

func (*WsConnMaster) OnList

func (wsCm *WsConnMaster) OnList() *WsMsg

func (*WsConnMaster) OnSub

func (wsCm *WsConnMaster) OnSub(
	key, channel string,
	wsConn *websocket.Conn,
) *WsMsg

func (*WsConnMaster) PingPongHandler

func (wsCm *WsConnMaster) PingPongHandler(data string) error

PingPongHandler is a noop response handler for websocket connections.

func (*WsConnMaster) RemoveWsConn

func (wsCm *WsConnMaster) RemoveWsConn(key string)

RemoveWsConn removes a connection from the WsConnMaster.

func (WsConnMaster) WsConnKey

func (wsCm WsConnMaster) WsConnKey(wsConn *websocket.Conn) string

WsConnKey returns the key for the *websocket.Conn

func (*WsConnMaster) WsHandler

func (wsCm *WsConnMaster) WsHandler(w http.ResponseWriter, r *http.Request)

type WsMsg

type WsMsg struct {
	Channels []string `json:"channels,omitempty"`
	Channel  string   `json:"channel,omitempty"`
	Command  string   `json:"command,omitempty"`
	Error    string   `json:"error,omitempty"`
	Payload  string   `json:"payload,omitempty"`
}

WsMsg is used to communicate with websocket clients

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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