Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func PacketServer ¶
PacketServer is the main function when operating in server mode it sets up the pcap on the capture device and starts a goroutine to rotate the knock sequence
Types ¶
type Client ¶
type Client struct { Progress int // index of current progress in sequence. Value of 1 means first port has been matched Sequence [4]uint16 // stores the knock sequence the current client is attempting. It's set and tracked here to prevent race conditions during a knock sequence being received and key rotations LastUpdated time.Time // The last time the client sent a correct packet in the sequence }
Client is used to keep track of a client attempting to perform an authentic knock sequence
type KnockSequence ¶
type KnockSequence struct { Used bool // If true, that means this knock sequence has already been used once. It may still be within the valid time window, but it can't be used again PortSequence [4]uint16 // Each knock sequence is four ports long }
KnockSequence is used keep track of an ordered knock sequence and whether it's been marked for use (to prevent replay attacks)
Click to show internal directories.
Click to hide internal directories.