dao

package
v0.0.0-...-3f53568 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2023 License: MIT Imports: 9 Imported by: 0

README

DAO

This is the Data Access Object (DAO) used by the server to interface with the DB.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DAO

type DAO struct {
	DBPath string
}

Define a DAO Struct

func (*DAO) AdminLogin

func (dao *DAO) AdminLogin(username, password string) bool

Check admin password

func (*DAO) DeleteImplant

func (dao *DAO) DeleteImplant(implantUUID string) error

Method to delete an implant from the DB

func (*DAO) DeleteListener

func (dao *DAO) DeleteListener(listenerUUID string) error

Method to delete a listener from the DB

func (*DAO) GetActiveImplants

func (dao *DAO) GetActiveImplants() ([]messages.Implant, error)

Method to retrieve all implants from the DB

func (*DAO) GetActiveListeners

func (dao *DAO) GetActiveListeners() ([]messages.Listener, error)

Method to retrieve all active listeners

func (*DAO) GetEncryptionKeys

func (dao *DAO) GetEncryptionKeys(listenerUUID string) (string, string, error)

Method to retrieve the Encryption key and HMAC Key

func (*DAO) GetImplant

func (dao *DAO) GetImplant(listenerUUID string) (messages.Implant, error)

Method to retrieve the details of an implant

func (*DAO) GetListener

func (dao *DAO) GetListener(listenerUUID string) (messages.Listener, error)

Method to retrieve one listener from the DB given the listener UUID

func (*DAO) GetListenerUUIDFromImplantUUID

func (dao *DAO) GetListenerUUIDFromImplantUUID(implantUUID string) (string, error)

Method to retrieve a listener UUID from an implant UUID

func (*DAO) GetTask

func (dao *DAO) GetTask(taskUUID uuid.UUID) (messages.Task, error)

Method to get task result

func (*DAO) GetTaskForListener

func (dao *DAO) GetTaskForListener(listenerUUID uuid.UUID) (messages.Task, error)

Function to retrieve a task for a listener on the DB

func (*DAO) InsertImplantData

func (dao *DAO) InsertImplantData(implantData messages.Implant) error

Method to insert implant data into the DB

func (*DAO) InsertNewListener

func (dao *DAO) InsertNewListener(listener messages.Listener) error

Method to insert a new Listener into the DB

func (*DAO) InsertNewOperator

func (dao *DAO) InsertNewOperator(username, password string) error

Method to save new operator details on the DB

func (*DAO) InsertTask

func (dao *DAO) InsertTask(task messages.Task) error

Method to insert task into DB

func (*DAO) Login

func (dao *DAO) Login(username, password string) (string, error)

Method to Login the operator

func (*DAO) UpdateImplantDetails

func (dao *DAO) UpdateImplantDetails(option, value string, implantUUID string) error

Method to update implants options

func (*DAO) UpdateLogin

func (dao *DAO) UpdateLogin(status int, api_key string) error

Method to update login status of an operator

func (*DAO) UpdateTaskResult

func (dao *DAO) UpdateTaskResult(task messages.Task) error

Method to update the task result

func (*DAO) ValidateAPIKey

func (dao *DAO) ValidateAPIKey(APIKey string) error

Method to validate the API Key

Jump to

Keyboard shortcuts

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