Documentation
¶
Index ¶
- func ByteArrayToHex(payload []byte) string
- func ChangePermissions(name string) (uint32, uint32, error)
- func ConnectDB(verbose bool) (*gorm.DB, error)
- func GetPasswd(name string) (*C.struct_passwd, error)
- func GetSHA3256Hash(str []byte) ([]byte, error)
- func SockAddrToIP(sock *syscall.Sockaddr) (ip net.IP, port int, success bool)
- type Encryption
- type KeyConnection
- type Logman
- type PasswordConnection
- type SSHServer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ByteArrayToHex ¶
ByteArrayToHex converts a set of bytes to a hex encoded string.
func ChangePermissions ¶
ChangePermissions changes the permissions to a specific user. For example, you can supply `nobody` when the server is run so that even if there's a vulnerability and an attacker can escape the sandbox, they won't have any permissions.
func GetPasswd ¶
func GetPasswd(name string) (*C.struct_passwd, error)
GetPasswd gets the passwd of a specific user.
func GetSHA3256Hash ¶
GetSHA3256Hash returns the SHA3-256 hash of a given string.
Types ¶
type Encryption ¶
type Encryption struct {
// contains filtered or unexported fields
}
Encryption is the object that defines an encryption key class.
func (*Encryption) GenerateKey ¶
func (enc *Encryption) GenerateKey() bool
GenerateKey generates a set of public and private keys.
func (*Encryption) GetPrivateKey ¶
func (enc *Encryption) GetPrivateKey() string
GetPrivateKey gets the PEM private key string.
func (*Encryption) GetPublicKey ¶
func (enc *Encryption) GetPublicKey() string
GetPublicKey gets the public PEM key string.
type KeyConnection ¶
type KeyConnection struct { gorm.Model ID uint64 `gorm:"primaryKey; autoIncrement; not_null;"` // type:bigint for MySQL IPAddress string `gorm:"index; type:mediumtext not null; unique_index:uidx_key_ip"` Username string `gorm:"index; not null"` Key string `gorm:"index; not null"` KeyHash string `gorm:"index; not null; unique_index:uidx_key_ip"` Type string `gorm:"not null"` CreatedAt time.Time `gorm:"autoCreateTime:milli"` UpdatedAt time.Time `gorm:"autoCreateTime:milli"` }
KeyConnection defines the model that describes the table in which all the usernames and public key that any peer attempts to access the system with will be stored.
type Logman ¶
Logman is a struct that handles logging to a file.
func CreateLogmanLogger ¶
CreateLogmanLogger creates a logger.
func GetLogmanInstance ¶
func GetLogmanInstance() *Logman
GetLogmanInstance gets (or create) the instance of the logger.
type PasswordConnection ¶
type PasswordConnection struct { gorm.Model ID uint64 `gorm:"primaryKey; autoIncrement; not_null;"` // type:bigint for MySQL IPAddress string `gorm:"index; type:mediumtext not null"` Username string `gorm:"index; not null"` Password string `gorm:"index; not null"` CreatedAt time.Time `gorm:"autoCreateTime:milli"` UpdatedAt time.Time `gorm:"autoCreateTime:milli"` }
PasswordConnection defines the model that describes the table in which all the usernames and passwords that any peer attempts to access the system with will be stored.
type SSHServer ¶
type SSHServer struct { Logger *Logman Port int Address string Key string Banner string PluginManager *plugin.PluginManager // contains filtered or unexported fields }
SSHServer This is the object that defines an SSH server.
func (*SSHServer) HandleSSHAuth ¶
HandleSSHAuth Handles the authentication process, as well as any individual session.
func (*SSHServer) ListenLoop ¶
func (server *SSHServer) ListenLoop()
ListenLoop Run the listener for our server.