Documentation ¶
Index ¶
- Constants
- Variables
- func Marshal(msg interface{}) []byte
- func Unmarshal(data []byte, out interface{}) error
- type ChannelCloseMsg
- type ChannelDataMsg
- type ChannelEOFMsg
- type ChannelOpenConfirmMsg
- type ChannelOpenFailureMsg
- type ChannelOpenMsg
- type ChannelRequestFailureMsg
- type ChannelRequestMsg
- type ChannelRequestSuccessMsg
- type DisconnectMsg
- type GlobalRequestFailureMsg
- type GlobalRequestMsg
- type GlobalRequestSuccessMsg
- type KexDHGexGroupMsg
- type KexDHGexInitMsg
- type KexDHGexReplyMsg
- type KexDHGexRequestMsg
- type KexDHInitMsg
- type KexDHReplyMsg
- type KexECDHInitMsg
- type KexECDHReplyMsg
- type KexInitMsg
- type RejectionReason
- type ServiceAcceptMsg
- type ServiceRequestMsg
- type UserAuthBannerMsg
- type UserAuthFailureMsg
- type UserAuthGSSAPIErrTok
- type UserAuthGSSAPIError
- type UserAuthGSSAPIMIC
- type UserAuthGSSAPIToken
- type UserAuthInfoRequestMsg
- type UserAuthPubKeyOkMsg
- type UserAuthRequestMsg
- type UserAuthSuccessMsg
- type WindowAdjustMsg
Constants ¶
const ( MsgIgnore = 2 MsgUnimplemented = 3 MsgDebug = 4 MsgNewKeys = 21 )
These are SSH message type numbers. They are scattered around several documents but many were taken from [SSH-PARAMETERS].
Variables ¶
var Decoder = &decoder.StreamDecoder{ Type: types.Type_NC_SSH, Name: serviceSSH, Description: "The Secure Shell Protocol allows controlling remote machines over an encrypted connection", PostInit: func(d *decoder.StreamDecoder) error { var err error sshLog, _, err = logging.InitZapLogger( decoderconfig.Instance.Out, "ssh", decoderconfig.Instance.Debug, ) return err }, CanDecode: func(client, server []byte) bool { return bytes.Contains(server, sshServiceName) }, DeInit: func(sd *decoder.StreamDecoder) error { return sshLog.Sync() }, Factory: &sshReader{}, Typ: core.TCP, }
Decoder for protocol analysis and writing audit records to disk.
Functions ¶
func Marshal ¶
func Marshal(msg interface{}) []byte
Marshal serializes the message in msg to SSH wire format. The msg argument should be a struct or pointer to struct. If the first member has the "sshtype" tag set to a number in decimal, that number is prepended to the result. If the last of member has the "ssh" tag set to "rest", its contents are appended to the output.
func Unmarshal ¶
Unmarshal parses data in SSH wire format into a structure. The out argument should be a pointer to struct. If the first member of the struct has the "sshtype" tag set to a '|'-separated set of numbers in decimal, the packet must start with one of those numbers. In case of error, Unmarshal returns a ParseError or UnexpectedMessageError.
Types ¶
type ChannelCloseMsg ¶
type ChannelCloseMsg struct {
PeersID uint32 `sshtype:"97"`
}
type ChannelDataMsg ¶
Used for debug print outs of packets.
type ChannelEOFMsg ¶
type ChannelEOFMsg struct {
PeersID uint32 `sshtype:"96"`
}
type ChannelOpenConfirmMsg ¶
type ChannelOpenFailureMsg ¶
type ChannelOpenFailureMsg struct { PeersID uint32 `sshtype:"92"` Reason RejectionReason Message string Language string }
type ChannelOpenMsg ¶
type ChannelRequestFailureMsg ¶
type ChannelRequestFailureMsg struct {
PeersID uint32 `sshtype:"100"`
}
type ChannelRequestMsg ¶
type ChannelRequestSuccessMsg ¶
type ChannelRequestSuccessMsg struct {
PeersID uint32 `sshtype:"99"`
}
type DisconnectMsg ¶
disconnectMsg is the message that signals a disconnect. It is also the error type returned from mux.Wait()
func (*DisconnectMsg) Error ¶
func (d *DisconnectMsg) Error() string
type GlobalRequestFailureMsg ¶
type GlobalRequestFailureMsg struct {
Data []byte `ssh:"rest" sshtype:"82"`
}
type GlobalRequestMsg ¶
type GlobalRequestSuccessMsg ¶
type GlobalRequestSuccessMsg struct {
Data []byte `ssh:"rest" sshtype:"81"`
}
type KexDHGexInitMsg ¶
type KexDHGexReplyMsg ¶
type KexDHGexRequestMsg ¶
type KexDHInitMsg ¶
type KexDHReplyMsg ¶
type KexECDHInitMsg ¶
type KexECDHInitMsg struct {
ClientPubKey []byte `sshtype:"30"`
}
type KexECDHReplyMsg ¶
type KexInitMsg ¶
type KexInitMsg struct { Cookie [16]byte `sshtype:"20"` KexAlgos []string ServerHostKeyAlgos []string CiphersClientServer []string CiphersServerClient []string MACsClientServer []string MACsServerClient []string CompressionClientServer []string CompressionServerClient []string LanguagesClientServer []string LanguagesServerClient []string FirstKexFollows bool Reserved uint32 }
type RejectionReason ¶
type RejectionReason uint32
RejectionReason is an enumeration used when rejecting channel creation requests. See RFC 4254, section 5.1.
const ( Prohibited RejectionReason = iota + 1 ConnectionFailed UnknownChannelType ResourceShortage )
func (RejectionReason) String ¶
func (r RejectionReason) String() string
String converts the rejection reason to human readable form.
type ServiceAcceptMsg ¶
type ServiceAcceptMsg struct {
Service string `sshtype:"6"`
}
type ServiceRequestMsg ¶
type ServiceRequestMsg struct {
Service string `sshtype:"5"`
}
type UserAuthBannerMsg ¶
type UserAuthFailureMsg ¶
type UserAuthGSSAPIErrTok ¶
type UserAuthGSSAPIErrTok struct {
ErrorToken []byte `sshtype:"64"`
}
type UserAuthGSSAPIError ¶
type UserAuthGSSAPIMIC ¶
type UserAuthGSSAPIMIC struct {
MIC []byte `sshtype:"66"`
}
type UserAuthGSSAPIToken ¶
type UserAuthGSSAPIToken struct {
Token []byte `sshtype:"61"`
}