smb

package
v1.0.8 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2024 License: AGPL-3.0, Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const SMB = "smb"

Variables

This section is empty.

Functions

func DetectSMBv2

func DetectSMBv2(conn net.Conn, timeout time.Duration) (*plugins.ServiceSMB, error)

Types

type NTLMChallenge

type NTLMChallenge struct {
	Signature              [8]byte
	MessageType            uint32
	TargetNameLen          uint16
	TargetNameMaxLen       uint16
	TargetNameBufferOffset uint32
	NegotiateFlags         uint32
	ServerChallenge        uint64
	Reserved               uint64
	TargetInfoLen          uint16
	TargetInfoMaxLen       uint16
	TargetInfoBufferOffset uint32
	Version                [8]byte
}

type NegotiateResponse

type NegotiateResponse struct {
	SessionMsgPrefix [4]byte
	PacketHeader     SMB2PacketHeader
	// Negotiate Response
	StructureSize        uint16
	SecurityMode         uint16
	DialectRevision      uint16
	Reserved             uint16 // if DialectRevision is 0x0311, used as NegotiateContextCount field
	ServerGUID           [16]byte
	Capabilities         uint32
	MaxTransactSize      uint32
	MaxReadSize          uint32
	MaxWriteSize         uint32
	SystemTime           uint64
	ServerStartTime      uint64
	SecurityBufferOffset uint16
	SecurityBufferLength uint16
	Reserved2            uint32 // if DialectRevision is 0x0311, used as NegotiateContextOffset field

}

https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-smb2/63abf97c-0d09-47e2-88d6-6bfa552949a5

type SMB2PacketHeader

type SMB2PacketHeader struct {
	ProtocolID    [4]byte
	StructureSize uint16
	CreditCharge  uint16
	Status        uint32 // In SMB 3.x dialect, used as ChannelSequence & Reserved fields
	Command       uint16
	CreditRequest uint16
	Flags         uint32
	NextCommand   uint32
	MessageID     uint64
	Reserved      uint32
	TreeID        uint32
	SessionID     uint64
	Signature     [16]byte
}

https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-smb2/5cd64522-60b3-4f3e-a157-fe66f1228052

type SMBPlugin

type SMBPlugin struct{}

func (*SMBPlugin) Name

func (p *SMBPlugin) Name() string

func (*SMBPlugin) PortPriority

func (p *SMBPlugin) PortPriority(port uint16) bool

func (*SMBPlugin) Priority

func (p *SMBPlugin) Priority() int

func (*SMBPlugin) Run

func (p *SMBPlugin) Run(conn net.Conn, timeout time.Duration, target plugins.Target) (*plugins.Service, error)

func (*SMBPlugin) Type

func (p *SMBPlugin) Type() plugins.Protocol

Jump to

Keyboard shortcuts

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