Documentation ¶
Index ¶
- func GetClientInfoFromCtx(ctx context.Context) (string, string, error)
- type AdminServiceServer
- func (s *AdminServiceServer) ClientDisconnect(ctx context.Context, req *as.ClientDisconnectRequest) (*as.ClientDisconnectResponse, error)
- func (s *AdminServiceServer) ClientList(req *as.ClientListRequest, stream as.AdminService_ClientListServer) error
- func (s *AdminServiceServer) ClientRegister(ctx context.Context, req *as.ClientRegisterRequest) (*as.ClientRegisterResponse, error)
- func (s *AdminServiceServer) ConnectionList(req *as.ConnectionListRequest, stream as.AdminService_ConnectionListServer) error
- func (s *AdminServiceServer) SocksStart(ctx context.Context, req *as.SocksStartRequest) (*as.SocksStartResponse, error)
- func (s *AdminServiceServer) SocksStop(ctx context.Context, req *as.SocksStopRequest) (*as.SocksStopResponse, error)
- func (s *AdminServiceServer) Start(port int)
- func (s *AdminServiceServer) TunnelAdd(ctx context.Context, req *as.TunnelAddRequest) (*as.TunnelAddResponse, error)
- func (s *AdminServiceServer) TunnelDelete(ctx context.Context, req *as.TunnelDeleteRequest) (*as.TunnelDeleteResponse, error)
- func (s *AdminServiceServer) TunnelList(req *as.TunnelListRequest, stream as.AdminService_TunnelListServer) error
- type ClientServiceServer
- func (s *ClientServiceServer) CreateConnectionStream(stream cs.ClientService_CreateConnectionStreamServer) error
- func (s *ClientServiceServer) CreateEndpointControlStream(ctrlMessage *cs.EndpointControlMessage, ...) error
- func (s *ClientServiceServer) CreateTunnelControlStream(stream cs.ClientService_CreateTunnelControlStreamServer) error
- func (s *ClientServiceServer) GetConfigurationMessage(ctx context.Context, req *cs.GetConfigurationMessageRequest) (*cs.GetConfigurationMessageResponse, error)
- func (s *ClientServiceServer) Start(port int, tls bool, certFile string, keyFile string)
- type ConfigStore
- type ConfiguredClient
- type ConnectedClient
- type GServer
- func (s *GServer) AddConnectedClient(uuid string, client *ConnectedClient) bool
- func (s *GServer) AddTunnel(clientID string, tunnelID string, direction uint32, listenIP net.IP, ...) error
- func (s *GServer) DeleteTunnel(clientID string, tunnelID string) error
- func (s *GServer) DisconnectEndpoint(clientID string) error
- func (s *GServer) GetClientServer() *ClientServiceServer
- func (s *GServer) GetEndpoint(clientID string) (*common.Endpoint, bool)
- func (s *GServer) RegisterClient(req *ConfiguredClient) error
- func (s *GServer) Start(clientPort int, adminPort int, tls bool, certFile string, keyFile string)
- func (s *GServer) StartProxy(clientID string, socksPort uint32) error
- func (s *GServer) StopProxy(clientID string) error
- func (s *GServer) StreamAuthInterceptor(srv interface{}, ss grpc.ServerStream, info *grpc.StreamServerInfo, ...) error
- func (s *GServer) UnaryAuthInterceptor(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, ...) (interface{}, error)
- type ServerConnectionHandler
- func (s *ServerConnectionHandler) Acknowledge(tunnel *common.Tunnel, ctrlMessage *cs.TunnelControlMessage) common.ByteStream
- func (s *ServerConnectionHandler) CloseStream(tunnel *common.Tunnel, connID string)
- func (s *ServerConnectionHandler) GetByteStream(tunnel *common.Tunnel, ctrlMessage *cs.TunnelControlMessage) common.ByteStream
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AdminServiceServer ¶
type AdminServiceServer struct { as.UnimplementedAdminServiceServer // contains filtered or unexported fields }
AdminServiceServer is a structure that implements all of the grpc functions for the AdminServiceServer
func NewAdminServiceServer ¶
func NewAdminServiceServer(gServer *GServer) *AdminServiceServer
NewAdminServiceServer is a constructor that returns an AdminServiceServer grpc server.
func (*AdminServiceServer) ClientDisconnect ¶
func (s *AdminServiceServer) ClientDisconnect(ctx context.Context, req *as.ClientDisconnectRequest) ( *as.ClientDisconnectResponse, error)
ClientDisconnect will disconnect a gClient from gServer.
func (*AdminServiceServer) ClientList ¶
func (s *AdminServiceServer) ClientList(req *as.ClientListRequest, stream as.AdminService_ClientListServer) error
ClientList will list all configured clients for the gServer and their connection status as well as the configured ip, port, and bearer token
func (*AdminServiceServer) ClientRegister ¶
func (s *AdminServiceServer) ClientRegister(ctx context.Context, req *as.ClientRegisterRequest) ( *as.ClientRegisterResponse, error)
ClientRegister will create a gClient binary and send it back in a binary stream.
func (*AdminServiceServer) ConnectionList ¶
func (s *AdminServiceServer) ConnectionList(req *as.ConnectionListRequest, stream as.AdminService_ConnectionListServer) error
ConnectionList will list all the connections associated with the provided tunnel ID.
func (*AdminServiceServer) SocksStart ¶
func (s *AdminServiceServer) SocksStart(ctx context.Context, req *as.SocksStartRequest) ( *as.SocksStartResponse, error)
SocksStart will start a Socksv5 proxy server on the provided client ID
func (*AdminServiceServer) SocksStop ¶
func (s *AdminServiceServer) SocksStop(ctx context.Context, req *as.SocksStopRequest) ( *as.SocksStopResponse, error)
SocksStop will stop a SocksV5 proxy server running on the provided client ID.
func (*AdminServiceServer) Start ¶
func (s *AdminServiceServer) Start(port int)
Start will start the grpc server
func (*AdminServiceServer) TunnelAdd ¶
func (s *AdminServiceServer) TunnelAdd(ctx context.Context, req *as.TunnelAddRequest) ( *as.TunnelAddResponse, error)
TunnelAdd adds a tunnel to an endpoint specified in the request.
func (*AdminServiceServer) TunnelDelete ¶
func (s *AdminServiceServer) TunnelDelete(ctx context.Context, req *as.TunnelDeleteRequest) ( *as.TunnelDeleteResponse, error)
TunnelDelete deletes a tunnel with the provided tunnel ID
func (*AdminServiceServer) TunnelList ¶
func (s *AdminServiceServer) TunnelList(req *as.TunnelListRequest, stream as.AdminService_TunnelListServer) error
TunnelList lists all tunnels associated with the provided client ID.
type ClientServiceServer ¶
type ClientServiceServer struct { cs.UnimplementedClientServiceServer // contains filtered or unexported fields }
func NewClientServiceServer ¶
func NewClientServiceServer(gserver *GServer) *ClientServiceServer
func (*ClientServiceServer) CreateConnectionStream ¶
func (s *ClientServiceServer) CreateConnectionStream( stream cs.ClientService_CreateConnectionStreamServer) error
CreateConnectionStream is a gRPC function that the client will call to create a bi-directional data stream to carry data that gets delivered over the TCP connection.
func (*ClientServiceServer) CreateEndpointControlStream ¶
func (s *ClientServiceServer) CreateEndpointControlStream( ctrlMessage *cs.EndpointControlMessage, stream cs.ClientService_CreateEndpointControlStreamServer) error
CreateEndpointControl stream is a gRPC function that the client calls to establish a one way stream that the server uses to issue control messages to the remote endpoint.
func (*ClientServiceServer) CreateTunnelControlStream ¶
func (s *ClientServiceServer) CreateTunnelControlStream( stream cs.ClientService_CreateTunnelControlStreamServer) error
CreateTunnelControlStream is a gRPC function that the client will call to establish a bi-directional stream to relay control messages about new and disconnected TCP connections.
func (*ClientServiceServer) GetConfigurationMessage ¶
func (s *ClientServiceServer) GetConfigurationMessage(ctx context.Context, req *cs.GetConfigurationMessageRequest) ( *cs.GetConfigurationMessageResponse, error)
GetConfigurationMessage returns the client ID and kill date to a gClient based on the bearer token provided.
type ConfigStore ¶
type ConfigStore struct {
// contains filtered or unexported fields
}
ConfigStore is a structure that represents all of the configurations of the gServer and will keep state to a json file
func NewConfigStore ¶
func NewConfigStore() *ConfigStore
func (*ConfigStore) AddConfiguredClient ¶
func (c *ConfigStore) AddConfiguredClient(client *ConfiguredClient) error
AddConfiguredClient will take a ConfiguredClient structure and add it to the redis datastore
func (*ConfigStore) DeleteConfiguredClient ¶
func (c *ConfigStore) DeleteConfiguredClient(key string) error
func (*ConfigStore) GetConfiguredClient ¶
func (c *ConfigStore) GetConfiguredClient(key string) *ConfiguredClient
func (*ConfigStore) Initialize ¶
func (c *ConfigStore) Initialize() error
type ConfiguredClient ¶
type ConfiguredClient struct { Arch string BinType string Name string Platform string Port uint32 Proxy string Server string Token string }
func NewConfiguredClient ¶
func NewConfiguredClient(clientData map[string]interface{}) *ConfiguredClient
type ConnectedClient ¶
type ConnectedClient struct {
// contains filtered or unexported fields
}
type GServer ¶
type GServer struct {
// contains filtered or unexported fields
}
func NewGServer ¶
func NewGServer() *GServer
NewGServer is a constructor that will initialize all gServer internal data structures and load any existing configuration files.
func (*GServer) AddConnectedClient ¶
func (s *GServer) AddConnectedClient(uuid string, client *ConnectedClient) bool
AddConnectedClient will take in a unique ID and a ConnectedClient structure and insert them into the connectedClients map with the unique ID as the key.
func (*GServer) AddTunnel ¶
func (s *GServer) AddTunnel( clientID string, tunnelID string, direction uint32, listenIP net.IP, listenPort uint32, destinationIP net.IP, destinationPort uint32) error
AddTunnel adds a tunnel to the gRPC server and then messages the gclient to perform actions on the other end.
func (*GServer) DeleteTunnel ¶
DeleteTunnel will kill all TCP connections under the tunnel and remove them from the list of managed tunnels.
func (*GServer) DisconnectEndpoint ¶
DisconnectEndpoint will send a control message to the current endpoint to disconnect and end execution.
func (*GServer) GetClientServer ¶
func (s *GServer) GetClientServer() *ClientServiceServer
GetClientServer gets the grpc client server
func (*GServer) GetEndpoint ¶
GetEndpoint will retreive an endpoint struct with the provided endpoint ID.
func (*GServer) RegisterClient ¶
func (s *GServer) RegisterClient(req *ConfiguredClient) error
RegisterClient is responsible for building a client executable with the provided parameters.
func (*GServer) StartProxy ¶
StartProxy starts a proxy on the provided endpoint ID
func (*GServer) StreamAuthInterceptor ¶
func (s *GServer) StreamAuthInterceptor(srv interface{}, ss grpc.ServerStream, info *grpc.StreamServerInfo, handler grpc.StreamHandler) error
StreamAuthInterceptor will check for proper authorization for all stream based gRPC calls.
func (*GServer) UnaryAuthInterceptor ¶
func (s *GServer) UnaryAuthInterceptor(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (interface{}, error)
UnaryAuthInterceptor is called for all unary gRPC functions to validate that the caller is authorized.
type ServerConnectionHandler ¶
type ServerConnectionHandler struct {
// contains filtered or unexported fields
}
ServerConnectionHandler TODO
func (*ServerConnectionHandler) Acknowledge ¶
func (s *ServerConnectionHandler) Acknowledge(tunnel *common.Tunnel, ctrlMessage *cs.TunnelControlMessage) common.ByteStream
Acknowledge is called when the remote client acknowledges that a tcp connection can be established on the remote side.
func (*ServerConnectionHandler) CloseStream ¶
func (s *ServerConnectionHandler) CloseStream(tunnel *common.Tunnel, connID string)
CloseStream will kill a TCP connection locally
func (*ServerConnectionHandler) GetByteStream ¶
func (s *ServerConnectionHandler) GetByteStream(tunnel *common.Tunnel, ctrlMessage *cs.TunnelControlMessage) common.ByteStream
GetByteStream will return the gRPC stream associated with a particular TCP connection.