models

package
v0.0.0-...-cd96e8e Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// Database Variables
	ClientIdList []string
	Status       bool
	ClientList   []ClientInfo
	ClientMap    map[string]ClientInfo
	PortStatus   map[int]bool
	Keys         map[string]string
	DBname       = "necro.db"
)
View Source
var (
	// Server Variables
	Server  *gophersocket.Server
	Network []*Listener
)
View Source
var (
	// Windows Variables
	WindowOpts         []*bootstrap.Window
	MainWindow         *astilectron.Window = nil
	MainWinCreated     bool                = false
	PassWindow         *astilectron.Window = nil
	PassWinCreated     bool                = false
	LogWindow          *astilectron.Window = nil
	LogWinCreated      bool                = false
	ListenerWindow     *astilectron.Window = nil
	ListenerWinCreated bool                = false
	BuildWindow        *astilectron.Window = nil
	BuildWinCreated    bool                = false
	LoginWindow        *astilectron.Window = nil
	LoginWinCreated    bool                = false
)
View Source
var Agents []*Agent

Functions

func AbsoluteResourcesPath

func AbsoluteResourcesPath(a *astilectron.Astilectron, relativeResourcesPath string) string

func AddToClientMap

func AddToClientMap(id, key string)

func AddToKeyMap

func AddToKeyMap(id, key string)

func AddToPortMap

func AddToPortMap(port int, status bool)

func CreateWindow

func CreateWindow(window []*bootstrap.Window) (win []*astilectron.Window, err error)

func DeleteFromDB

func DeleteFromDB(coloum string, value string) (tx *gorm.DB)

func ReadFromDB

func ReadFromDB(coloum string, value string) (tx *gorm.DB)

Create

func RemoveFromClientMap

func RemoveFromClientMap(id string)

func RemoveFromKeyMap

func RemoveFromKeyMap(id string)

func RemoveFromPortMap

func RemoveFromPortMap(port int)

func UpdateDBVals

func UpdateDBVals(coloum string, value string) (tx *gorm.DB)

func WriteStructToDB

func WriteStructToDB(payload interface{}) (tx *gorm.DB)

func WriteToDB

func WriteToDB(info *ClientInfo) (tx *gorm.DB)

Types

type Agent

type Agent struct {
	Name    string `json:"name"`
	Info    *ClientInfo
	Channel *gophersocket.Channel
}

type ClientInfo

type ClientInfo struct {
	SocketID  string `json:"socketid"`
	Priv      string `json:"priv"`
	Version   string `json:"version"`
	IPAddr    string `json:"ipaddr"`
	Hostname  string `json:"hostname"`
	User      string `json:"username"`
	OS        string `json:"os"`
	Arch      string `json:"arch"`
	CPU       string `json:"cpu"`
	GPU       string `json:"gpu"`
	Memory    string `json:"memory"`
	AntiVirus string `json:"antivirus"`
	Lang      string `json:"lang"`
}
var ClientDBInfo ClientInfo

type Dispatch

type Dispatch struct {
	Args   string `json:"args"`
	ArgCnt string `json:"argcnt"`
	Tag    string `json:"tag"`
}

type Listener

type Listener struct {
	Name   string
	Port   int
	Server *gophersocket.Server
}

type Mail

type Mail struct {
	Buffer string `json:"img"`
	Uid    string `json:"uid"`
}

type Message

type Message struct {
	Cmd string `json:"cmd"`
	Uid string `json:"uid"`
}

type NodeStats

type NodeStats struct {
	Channels      []*gophersocket.Channel
	RoomOccupants map[*gophersocket.Channel]int // The Channel and its client count
}

type Nodes

type Nodes struct {
	Name  string
	Port  string
	Stats []*NodeStats
}

type Packet

type Packet struct {
	Event   string `json:"event"`
	Message string `json:"message"`
}

type PortMap

type PortMap struct {
	Name  string       `mapstructure:"name"`
	Ports map[int]bool `mapstructure:"ports"`
}

type PortMapPacket

type PortMapPacket struct {
	Name  string `json:"name"`
	Ports string `json:"ports"` // Split port map into <port>|<port>|<port> for reconstruction on other end of node
}

type Profile

type Profile struct {
	Username string `json:"username"`
	Password string `json:"password"`
	C2Addr   string `json:"c2addr"`
	C2Port   string `json:"c2port"`
}

type Resp

type Resp struct {
	Resp string `json:"resp"`
	Tag  string `json:"tag"`
}

type Room

type Room struct {
	Name   string  `json:"name"`
	Count  string  `json:"count"`
	Agents []Agent `mapstructure:"agents"`
}

type Spell

type Spell struct {
	Key string `json:"key"`
	Val string `json:"val"`
}

type ToClient

type ToClient struct {
	Tag     string `json:"tag"`
	Command string `json:"command"`
	Data    string `json:"data"`
}

Jump to

Keyboard shortcuts

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