Documentation
¶
Index ¶
- Constants
- Variables
- type Client
- func (c *Client) GetCommandOutput(command string)
- func (c *Client) GetFileData(command string)
- func (c *Client) GetProcesses()
- func (c *Client) KillProcessByID(pid string)
- func (c *Client) ReEstablishConnection()
- func (c *Client) ReadAll() ([]byte, error)
- func (c *Client) ReadBytes(requestBuffer int) ([]byte, error)
- func (c *Client) ReadMessage() (Message, error)
- func (c *Client) RunFile(file ClientFile)
- func (c *Client) SendBytes(data []byte) error
- func (c *Client) SendFile(file ClientFile)
- func (c *Client) SendMessage(message Message) error
- func (c *Client) SendMessageBox(messageBox MessageBox)
- func (c *Client) ToggleInputLock()
- type ClientFile
- type CmdData
- type Message
- type MessageBox
- type MetaData
- type Process
- type ProcessMonitor
- type RegistryTable
- type Server
- type SystemTable
- type TimeGraph
Constants ¶
const ( MB_OK uintptr = 0x00000000 MB_OKCANCEL uintptr = 0x00000001 MB_ABORTRETRYIGNORE uintptr = 0x00000002 MB_YESNOCANCEL uintptr = 0x00000003 MB_YESNO uintptr = 0x00000004 MB_RETRYCANCEL uintptr = 0x00000005 MB_CANCELTRYCONTINUE uintptr = 0x00000006 )
Win32 API MessageBoxW Button flags.
const ( MB_ICONNULL uintptr = 0x00000000 MB_ICONERROR uintptr = 0x00000010 MB_ICONQUESTION uintptr = 0x00000020 MB_ICONWARNING uintptr = 0x00000030 MB_ICONINFORMATION uintptr = 0x00000040 )
Win32 API MessageBoxW Icon flags.
const ( ES_CONTINUOUS uintptr = 0x80000000 ES_SYSTEMREQUIRED uintptr = 0x00000001 ES_DISPLAYREQUIRED uintptr = 0x00000002 )
Win32 API BlockInput flags.
const ( HD_EXIT byte = 0x10 HD_REMAKE byte = 0x20 HD_ERROR byte = 0x30 HD_SHELL byte = 0x01 HD_PROCESSES byte = 0x02 HD_KILL_PROC byte = 0x03 HD_MSG_BOX byte = 0x04 HD_INPUT_ON byte = 0x05 HD_INPUT_OFF byte = 0x06 HD_RUN_FILE byte = 0x07 )
Header packets for identifying the data recieved from the server.
const (
MB_TOPMOST uintptr = 0x00040000
)
Win32 API MessageBoxW Alignment flags
const STD_BUFFER = 1024
Standard request buffer size.
Variables ¶
var ( IconListPtr = []uintptr{MB_ICONNULL, MB_ICONERROR, MB_ICONQUESTION, MB_ICONWARNING, MB_ICONINFORMATION} ButtonListPtr = []uintptr{MB_OK, MB_OKCANCEL, MB_ABORTRETRYIGNORE, MB_YESNOCANCEL, MB_YESNO, MB_RETRYCANCEL, MB_CANCELTRYCONTINUE} )
Lists of the available MessageBox Icons and Buttons for selection.
var CurrentServer = NewServer()
Create a new Server instance.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct { Parent *Server SessionID string Conn net.Conn RawAddr string MetaData MetaData UserDataPath string Connected time.Time ProcessMonitor ProcessMonitor CmdData CmdData InputLocked bool }
`Client` represents a client connection.
func (*Client) GetCommandOutput ¶
`Client.GetCommandOutput` sends a command to the client for it to execute. The client will then send the output of the executed command back to the server.
func (*Client) GetFileData ¶
`Client.GetFileData` sends a command to the client for it to execute.
func (*Client) GetProcesses ¶
func (c *Client) GetProcesses()
`Client.GetProcesses` sends a sends a signal to the client for it to send back its running process list.
func (*Client) KillProcessByID ¶
`Client.KillProcessByID` sends a signal to the client to kill the passed process ID.
func (*Client) ReEstablishConnection ¶
func (c *Client) ReEstablishConnection()
`Client.ReEstablishConnection` sends a signal to the client telling it to re-establish the connection.
func (*Client) ReadAll ¶
`Client.ReadAll` reads all data from the connection and returns it as an array of bytes. This function could be exploited on the client side, and is just another reason why client packet authentication needs to be implemented.
func (*Client) ReadBytes ¶
`Client.ReadBytes` reads data from the connection and returns it as an array of bytes. The function reads up to the set BUFFER amount of bytes from the connection. If an error occurs during reading, the function returns an empty string and the error.
func (*Client) ReadMessage ¶
`Client.ReadMessage` reads all data from the connection as an array of bytes and reads it into and returns it as a parsable Message struct.
func (*Client) RunFile ¶
func (c *Client) RunFile(file ClientFile)
`Client.RunFile` sends a signal to the client and then the serialized JSON ClientFile for it to run in memory.
func (*Client) SendBytes ¶
`Client.SendBytes` sends the passed data to the client connection as an array of bytes.
func (*Client) SendFile ¶
func (c *Client) SendFile(file ClientFile)
This feature has not yet been implemented.
`Client.SendFile` sends a signal to the client and then the serialized JSON ClientFile for it to save.
func (*Client) SendMessage ¶
`Client.SendMessage` sends the passed data to the client connection.
func (*Client) SendMessageBox ¶
func (c *Client) SendMessageBox(messageBox MessageBox)
`Client.SendMessageBox` sends a signal to the client and then the serialized JSON MessageBox for it to display.
func (*Client) ToggleInputLock ¶
func (c *Client) ToggleInputLock()
`Client.ToggleInputLock` sends a command to the client that tells it to lock or unlock the keyboard and mouse.
type ClientFile ¶
`ClientFile` represents a file and its attributes that will be exchanged with the client.
type MessageBox ¶
type MessageBox struct { Delay int32 `json:"delay"` Amount int32 `json:"amount"` Title string `json:"title"` Content string `json:"content"` Buttons uintptr `json:"buttons,omitempty"` Icon uintptr `json:"icon,omitempty"` Default uintptr `json:"default,omitempty"` Modality uintptr `json:"modality,omitempty"` }
`MessageBox` represents the information needed to display a message box using the Win32 API.
func (*MessageBox) Show ¶
func (msgbox *MessageBox) Show() int
`MessageBox.Show` displays formats and passes the current MessageBox values to the Win32MessageBox function. This is used for previewing the MessageBox that will be sent to the client on the server side.
type MetaData ¶
type MetaData struct { IP string `json:"ip_address"` Name string `json:"machine_name"` Arch string `json:"architecture"` Access string `json:"access_privileges"` System SystemTable `json:"system_information,omitempty"` Geo network.GeoLocation `json:"geolocation,omitempty"` Processes []Process `json:"running_processes,omitempty"` EncryptionKey []byte `json:"encryption_key,omitempty"` }
`MetaData` represents the clients information storage database.
type Process ¶
type Process struct { PID string `json:"process_id"` Name string `json:"executable_name"` Type string `json:"session_type"` Memory string `json:"mem_usage"` }
`Process` represents the attributes of a running process on the machine.
type ProcessMonitor ¶
type ProcessMonitor struct { ProcessUpdateTime int32 `json:"update_time"` LastUpdatedProcesses time.Time `json:"last_updated"` KillingProcess bool `json:"killing_process"` }
`ProcessMonitor` represents the attributes required to display processes.
type RegistryTable ¶
type RegistryTable struct { HWID string `json:"hardware_id"` Version string `json:"windows_version"` CurrentUserName string `json:"current_user_name"` ProductName string `json:"product_name"` ProductId string `json:"product_id"` InstallDate string `json:"install_date"` RegisteredOwner string `json:"registered_owner"` RegisteredOrg string `json:"registered_organization"` }
`RegistryTable` represents a database of information gathered from the clients Windows registry.
type Server ¶
type Server struct { Listener net.Listener Connections []*Client Mutex sync.Mutex Logs helper.Logs Graph TimeGraph Notify bool SentBytes int RecvBytes int }
`Server` represents the TCP socket server.
func (*Server) Add ¶
`Server.Add` adds the passed client connection to the connections array of the server, updates the connection graph, creates a new client folder with an overview Json file and pushes a Windows toast notification if it's set in the server config.
type SystemTable ¶
type SystemTable struct { Registry RegistryTable `json:"registry_information"` Hardware so.Hardware `json:"hardware_information"` OS so.OperatingSystem `json:"operating_system_information"` Memory so.Memory `json:"memory_information"` Disk []so.Disk `json:"disk_information"` Network []so.Network `json:"network_information"` }
`SystemTable` represents a database of information gathered from the clients general system.
type TimeGraph ¶
type TimeGraph struct { DataMin float64 DataMax float64 DataX []float64 DataY []float64 ScatterY []float64 }
`TimeGraph` represents the plotting variables used in the connections graph.
func (*TimeGraph) UpdateConnectionGraph ¶
`TimeGraph.UpdateConnectionGraph` appends the required data to the connection graph.