Documentation ¶
Index ¶
- Constants
- Variables
- func DecodeViperConfig(v *viper.Viper, cfg interface{}, cfgReader io.Reader) error
- func EncodeConnectionRequest(c *ConnectionRequest) ([]byte, error)
- func FingerprintKey(k ssh.PublicKey) string
- func GenerateKey(seed string) ([]byte, error)
- func GetCurrentUserAndGroup() (*user.User, *user.Group, error)
- func GoStats()
- func HandleServiceCommand(svc service.Service, command string) error
- func HandleTCPStream(l *logger.Logger, connStats *ConnStats, src io.ReadWriteCloser, remote string)
- func IsRunningAsRoot() bool
- func NewDetermRand(seed []byte) io.Reader
- func NewRWCConn(rwc io.ReadWriteCloser) net.Conn
- func NewWebSocketConn(websocketConn *websocket.Conn) net.Conn
- func ParseAuth(auth string) (string, string)
- func Pipe(src io.ReadWriteCloser, dst io.ReadWriteCloser) (int64, int64)
- func RemoteIP(r *http.Request) string
- func SetFromRange(start, end int) mapset.Set
- func SleepSignal(d time.Duration)
- type ConnStats
- type ConnectionRequest
- type DetermRand
- type HTTPServer
- type ServerOption
Constants ¶
const ( UnixShell = "/bin/sh" CmdShell = "cmd" PowerShell = "powershell" Tacoscript = "tacoscript" )
const DetermRandIter = 2048
const IPAddressesVersion = 1
IPAddressesVersion represents the current version of IPAddresses fetching. 0 means no IPAddress fetching available.
const MonitoringVersion = 1
MonitoringVersion represents the current version of monitoring capability. 0 means no monitoring available.
const ProtocolVersion = "rport-v1"
ProtocolVersion of neo-rport. When backwards incompatible changes are made, this will be incremented to signify a protocol mismatch.
Variables ¶
var BuildVersion = "0.0.0-src"
BuildVersion represents a current build version. It can be overridden by CI workflow.
var SourceVersion = "0.0.0-src"
SourceVersion represents a default build version that is used for binaries built from sources.
Functions ¶
func DecodeViperConfig ¶
DecodeViperConfig tries to load viper config from either a file or reader and env variables then decodes all values into given cfg variable. cfg must be a pointer.
func EncodeConnectionRequest ¶
func EncodeConnectionRequest(c *ConnectionRequest) ([]byte, error)
func FingerprintKey ¶
func GenerateKey ¶
GenerateKey tries to stay compatible with go1.19 key generation
func HandleServiceCommand ¶
HandleServiceCommand handles string command and executes appropriate method. We do not use service.Control, because on uninstall it leaves the service running.
func HandleTCPStream ¶
func IsRunningAsRoot ¶
func IsRunningAsRoot() bool
func NewDetermRand ¶
func NewRWCConn ¶
func NewRWCConn(rwc io.ReadWriteCloser) net.Conn
func Pipe ¶
func Pipe(src io.ReadWriteCloser, dst io.ReadWriteCloser) (int64, int64)
func SetFromRange ¶
func SleepSignal ¶
SleepSignal sleeps for the given duration, or until a SIGHUP is received
Types ¶
type ConnectionRequest ¶
type ConnectionRequest struct { ID string Name string SessionID string OS string OSFullName string OSVersion string OSVirtualizationSystem string OSVirtualizationRole string OSArch string OSFamily string OSKernel string Version string Hostname string CPUFamily string CPUModel string CPUModelName string CPUVendor string NumCPUs int MemoryTotal uint64 Timezone string IPv4 []string IPv6 []string Tags []string Labels map[string]string Remotes []*models.Remote ClientConfiguration *clientconfig.Config }
ConnectionRequest represents configuration options when initiating client-server connection
func DecodeConnectionRequest ¶
func DecodeConnectionRequest(b []byte) (*ConnectionRequest, error)
type DetermRand ¶
type DetermRand struct {
// contains filtered or unexported fields
}
type HTTPServer ¶
HTTPServer extends net/http Server and adds graceful shutdowns
func NewHTTPServer ¶
func NewHTTPServer(maxHeaderBytes int, l *logger.Logger, options ...ServerOption) *HTTPServer
NewHTTPServer creates a new HTTPServer
func (*HTTPServer) Close ¶
func (h *HTTPServer) Close() error
func (*HTTPServer) GoListenAndServe ¶
func (*HTTPServer) Wait ¶
func (h *HTTPServer) Wait() error
type ServerOption ¶
type ServerOption func(*HTTPServer)
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
Package comm is responsible for sharing logic to handle communication between a server and clients.
|
Package comm is responsible for sharing logic to handle communication between a server and clients. |