2025-07-18 14:24:07 +02:00
|
|
|
import tables
|
2025-09-25 19:22:17 +02:00
|
|
|
import parsetoml, json
|
2025-09-26 15:30:14 +02:00
|
|
|
import system
|
2025-10-01 21:57:26 +02:00
|
|
|
import mummy
|
|
|
|
|
when defined(client):
|
|
|
|
|
import whisky
|
2025-07-18 14:24:07 +02:00
|
|
|
|
|
|
|
|
# Custom Binary Task structure
|
|
|
|
|
const
|
2025-07-18 18:47:57 +02:00
|
|
|
MAGIC* = 0x514E3043'u32 # Magic value: C0NQ
|
|
|
|
|
VERSION* = 1'u8 # Version 1
|
2025-08-06 14:28:54 +02:00
|
|
|
HEADER_SIZE* = 48'u8 # 48 bytes fixed packet header size
|
2025-07-18 14:24:07 +02:00
|
|
|
|
|
|
|
|
type
|
|
|
|
|
PacketType* = enum
|
|
|
|
|
MSG_TASK = 0'u8
|
2025-08-14 12:25:06 +02:00
|
|
|
MSG_RESULT = 1'u8
|
2025-07-21 22:07:25 +02:00
|
|
|
MSG_REGISTER = 2'u8
|
2025-07-22 21:00:39 +02:00
|
|
|
MSG_HEARTBEAT = 100'u8
|
2025-07-18 14:24:07 +02:00
|
|
|
|
|
|
|
|
ArgType* = enum
|
|
|
|
|
STRING = 0'u8
|
|
|
|
|
INT = 1'u8
|
2025-08-30 14:05:09 +02:00
|
|
|
SHORT = 2'u8
|
|
|
|
|
LONG = 3'u8
|
|
|
|
|
BOOL = 4'u8
|
|
|
|
|
BINARY = 5'u8
|
2025-07-18 14:24:07 +02:00
|
|
|
|
|
|
|
|
HeaderFlags* = enum
|
|
|
|
|
# Flags should be powers of 2 so they can be connected with or operators
|
|
|
|
|
FLAG_PLAINTEXT = 0'u16
|
|
|
|
|
FLAG_ENCRYPTED = 1'u16
|
2025-07-22 21:31:18 +02:00
|
|
|
FLAG_COMPRESSED = 2'u16
|
2025-08-01 13:16:12 +02:00
|
|
|
FLAG_FRAGMENTED = 4'u16
|
2025-07-18 14:24:07 +02:00
|
|
|
|
|
|
|
|
CommandType* = enum
|
|
|
|
|
CMD_SLEEP = 0'u16
|
|
|
|
|
CMD_SHELL = 1'u16
|
|
|
|
|
CMD_PWD = 2'u16
|
|
|
|
|
CMD_CD = 3'u16
|
|
|
|
|
CMD_LS = 4'u16
|
|
|
|
|
CMD_RM = 5'u16
|
|
|
|
|
CMD_RMDIR = 6'u16
|
|
|
|
|
CMD_MOVE = 7'u16
|
|
|
|
|
CMD_COPY = 8'u16
|
2025-08-01 13:16:12 +02:00
|
|
|
CMD_PS = 9'u16
|
|
|
|
|
CMD_ENV = 10'u16
|
|
|
|
|
CMD_WHOAMI = 11'u16
|
2025-08-29 15:58:26 +02:00
|
|
|
CMD_BOF = 12'u16
|
2025-09-01 19:45:39 +02:00
|
|
|
CMD_DOWNLOAD = 13'u16
|
|
|
|
|
CMD_UPLOAD = 14'u16
|
2025-09-03 19:38:22 +02:00
|
|
|
CMD_SCREENSHOT = 15'u16
|
2025-09-13 11:47:19 +02:00
|
|
|
CMD_DOTNET = 16'u16
|
2025-09-19 10:11:20 +02:00
|
|
|
CMD_SLEEPMASK = 17'u16
|
2025-10-16 19:29:49 +02:00
|
|
|
CMD_MAKE_TOKEN = 18'u16
|
|
|
|
|
CMD_STEAL_TOKEN = 19'u16
|
|
|
|
|
CMD_REV2SELF = 20'u16
|
2025-10-17 17:22:31 +02:00
|
|
|
CMD_TOKEN_INFO = 21'u16
|
2025-10-18 12:41:55 +02:00
|
|
|
CMD_ENABLE_PRIV = 22'u16
|
2025-10-18 13:05:01 +02:00
|
|
|
CMD_DISABLE_PRIV = 23'u16
|
2025-10-23 17:28:07 +02:00
|
|
|
CMD_EXIT = 24'u16
|
2025-10-28 21:01:10 +01:00
|
|
|
CMD_SELF_DESTRUCT = 25'u16
|
2025-07-18 14:24:07 +02:00
|
|
|
|
|
|
|
|
StatusType* = enum
|
|
|
|
|
STATUS_COMPLETED = 0'u8
|
|
|
|
|
STATUS_FAILED = 1'u8
|
2025-08-01 13:16:12 +02:00
|
|
|
STATUS_IN_PROGRESS = 2'u8
|
2025-07-18 14:24:07 +02:00
|
|
|
|
|
|
|
|
ResultType* = enum
|
|
|
|
|
RESULT_STRING = 0'u8
|
|
|
|
|
RESULT_BINARY = 1'u8
|
2025-07-19 16:49:27 +02:00
|
|
|
RESULT_NO_OUTPUT = 2'u8
|
2025-07-18 14:24:07 +02:00
|
|
|
|
2025-08-18 22:05:23 +02:00
|
|
|
ConfigType* = enum
|
|
|
|
|
CONFIG_LISTENER_UUID = 0'u8
|
|
|
|
|
CONFIG_LISTENER_IP = 1'u8
|
|
|
|
|
CONFIG_LISTENER_PORT = 2'u8
|
|
|
|
|
CONFIG_SLEEP_DELAY = 3'u8
|
|
|
|
|
CONFIG_PUBLIC_KEY = 4'u8
|
|
|
|
|
CONFIG_PROFILE = 5'u8
|
|
|
|
|
|
2025-09-22 21:53:13 +02:00
|
|
|
LogType* {.size: sizeof(uint8).} = enum
|
2025-10-02 12:10:46 +02:00
|
|
|
LOG_INFO = "[INFO] "
|
|
|
|
|
LOG_ERROR = "[FAIL] "
|
|
|
|
|
LOG_SUCCESS = "[DONE] "
|
|
|
|
|
LOG_WARNING = "[WARN] "
|
|
|
|
|
LOG_COMMAND = "[>>>>] "
|
2025-09-16 20:17:48 +02:00
|
|
|
LOG_OUTPUT = ""
|
2025-10-02 12:10:46 +02:00
|
|
|
LOG_INFO_SHORT = "[*] "
|
|
|
|
|
LOG_ERROR_SHORT = "[-] "
|
|
|
|
|
LOG_SUCCESS_SHORT = "[+] "
|
|
|
|
|
LOG_WARNING_SHORT = "[!] "
|
2025-08-21 17:02:50 +02:00
|
|
|
|
2025-09-04 13:44:50 +02:00
|
|
|
SleepObfuscationTechnique* = enum
|
|
|
|
|
NONE = 0'u8
|
|
|
|
|
EKKO = 1'u8
|
|
|
|
|
ZILEAN = 2'u8
|
|
|
|
|
FOLIAGE = 3'u8
|
2025-09-02 21:41:04 +02:00
|
|
|
|
2025-10-24 12:26:44 +02:00
|
|
|
ExitType* {.size: sizeof(uint8).} = enum
|
|
|
|
|
EXIT_PROCESS = "process"
|
|
|
|
|
EXIT_THREAD = "thread"
|
|
|
|
|
|
2025-10-07 21:16:17 +02:00
|
|
|
ModuleType* = enum
|
|
|
|
|
MODULE_ALL = 0'u32
|
|
|
|
|
MODULE_SLEEP = 1'u32
|
|
|
|
|
MODULE_SHELL = 2'u32
|
|
|
|
|
MODULE_BOF = 4'u32
|
|
|
|
|
MODULE_DOTNET = 8'u32
|
|
|
|
|
MODULE_FILESYSTEM = 16'u32
|
|
|
|
|
MODULE_FILETRANSFER = 32'u32
|
|
|
|
|
MODULE_SCREENSHOT = 64'u32
|
|
|
|
|
MODULE_SITUATIONAL_AWARENESS = 128'u32
|
2025-10-16 19:29:49 +02:00
|
|
|
MODULE_TOKEN = 256'u32
|
2025-10-07 21:16:17 +02:00
|
|
|
|
2025-07-23 13:47:37 +02:00
|
|
|
# Encryption
|
2025-08-14 12:25:06 +02:00
|
|
|
type
|
2025-08-18 22:05:23 +02:00
|
|
|
Uuid* = uint32
|
2025-08-14 12:25:06 +02:00
|
|
|
Bytes* = seq[byte]
|
2025-07-23 13:47:37 +02:00
|
|
|
Key* = array[32, byte]
|
|
|
|
|
Iv* = array[12, byte]
|
|
|
|
|
AuthenticationTag* = array[16, byte]
|
2025-08-27 00:27:50 +02:00
|
|
|
Key16* = array[16, byte]
|
2025-07-23 13:47:37 +02:00
|
|
|
|
|
|
|
|
# Packet structure
|
|
|
|
|
type
|
2025-07-18 14:24:07 +02:00
|
|
|
Header* = object
|
2025-07-23 13:47:37 +02:00
|
|
|
magic*: uint32 # [4 bytes ] magic value
|
|
|
|
|
version*: uint8 # [1 byte ] protocol version
|
|
|
|
|
packetType*: uint8 # [1 byte ] message type
|
|
|
|
|
flags*: uint16 # [2 bytes ] message flags
|
|
|
|
|
size*: uint32 # [4 bytes ] size of the payload body
|
2025-10-30 15:35:13 +01:00
|
|
|
agentId*: Uuid # [4 bytes ] agent id, used as AAD for encryption
|
2025-08-06 14:28:54 +02:00
|
|
|
seqNr*: uint32 # [4 bytes ] sequence number, used as AAD for encryption
|
2025-07-23 13:47:37 +02:00
|
|
|
iv*: Iv # [12 bytes] random IV for AES256 GCM encryption
|
|
|
|
|
gmac*: AuthenticationTag # [16 bytes] authentication tag for AES256 GCM encryption
|
2025-07-18 14:24:07 +02:00
|
|
|
|
|
|
|
|
TaskArg* = object
|
2025-08-06 14:28:54 +02:00
|
|
|
argType*: uint8 # [1 byte ] argument type
|
|
|
|
|
data*: seq[byte] # variable length data (for variable data types (STRING, BINARY), the first 4 bytes indicate data length)
|
2025-07-18 14:24:07 +02:00
|
|
|
|
|
|
|
|
Task* = object
|
|
|
|
|
header*: Header
|
2025-08-18 22:05:23 +02:00
|
|
|
taskId*: Uuid # [4 bytes ] task id
|
|
|
|
|
listenerId*: Uuid # [4 bytes ] listener id
|
2025-08-06 14:28:54 +02:00
|
|
|
timestamp*: uint32 # [4 bytes ] unix timestamp
|
|
|
|
|
command*: uint16 # [2 bytes ] command id
|
|
|
|
|
argCount*: uint8 # [1 byte ] number of arguments
|
|
|
|
|
args*: seq[TaskArg] # variable length arguments
|
2025-07-18 14:24:07 +02:00
|
|
|
|
|
|
|
|
TaskResult* = object
|
|
|
|
|
header*: Header
|
2025-08-18 22:05:23 +02:00
|
|
|
taskId*: Uuid # [4 bytes ] task id
|
|
|
|
|
listenerId*: Uuid # [4 bytes ] listener id
|
2025-08-06 14:28:54 +02:00
|
|
|
timestamp*: uint32 # [4 bytes ] unix timestamp
|
|
|
|
|
command*: uint16 # [2 bytes ] command id
|
|
|
|
|
status*: uint8 # [1 byte ] success flag
|
|
|
|
|
resultType*: uint8 # [1 byte ] result data type (string, binary)
|
|
|
|
|
length*: uint32 # [4 bytes ] result length
|
|
|
|
|
data*: seq[byte] # variable length result
|
2025-07-18 14:24:07 +02:00
|
|
|
|
2025-07-22 21:00:39 +02:00
|
|
|
# Checkin binary structure
|
|
|
|
|
type
|
|
|
|
|
Heartbeat* = object
|
2025-08-18 22:05:23 +02:00
|
|
|
header*: Header # [48 bytes ] fixed header
|
|
|
|
|
listenerId*: Uuid # [4 bytes ] listener id
|
|
|
|
|
timestamp*: uint32 # [4 bytes ] unix timestamp
|
2025-07-21 22:07:25 +02:00
|
|
|
|
2025-07-22 21:00:39 +02:00
|
|
|
# Registration binary structure
|
|
|
|
|
type
|
2025-07-21 22:07:25 +02:00
|
|
|
# All variable length fields are stored as seq[byte], prefixed with 4 bytes indicating the length of the following data
|
|
|
|
|
AgentMetadata* = object
|
2025-08-18 22:05:23 +02:00
|
|
|
listenerId*: Uuid
|
2025-07-21 22:07:25 +02:00
|
|
|
username*: seq[byte]
|
|
|
|
|
hostname*: seq[byte]
|
|
|
|
|
domain*: seq[byte]
|
|
|
|
|
ip*: seq[byte]
|
|
|
|
|
os*: seq[byte]
|
|
|
|
|
process*: seq[byte]
|
|
|
|
|
pid*: uint32
|
|
|
|
|
isElevated*: uint8
|
|
|
|
|
sleep*: uint32
|
2025-10-23 11:14:26 +02:00
|
|
|
jitter*: uint32
|
2025-10-02 10:25:37 +02:00
|
|
|
modules*: uint32
|
2025-07-21 22:07:25 +02:00
|
|
|
|
2025-10-30 15:35:13 +01:00
|
|
|
Registration* = object
|
2025-07-21 22:07:25 +02:00
|
|
|
header*: Header
|
2025-07-24 15:31:46 +02:00
|
|
|
agentPublicKey*: Key # [32 bytes ] Public key of the connecting agent for key exchange
|
2025-07-21 22:07:25 +02:00
|
|
|
metadata*: AgentMetadata
|
2025-07-18 14:24:07 +02:00
|
|
|
|
2025-07-22 21:00:39 +02:00
|
|
|
# Agent structure
|
|
|
|
|
type
|
2025-07-18 14:24:07 +02:00
|
|
|
Agent* = ref object
|
2025-07-21 22:07:25 +02:00
|
|
|
agentId*: string
|
|
|
|
|
listenerId*: string
|
2025-07-18 14:24:07 +02:00
|
|
|
username*: string
|
2025-10-17 13:01:12 +02:00
|
|
|
impersonationToken*: string
|
2025-07-18 14:24:07 +02:00
|
|
|
hostname*: string
|
|
|
|
|
domain*: string
|
2025-10-02 10:25:37 +02:00
|
|
|
ipInternal*: string
|
|
|
|
|
ipExternal*: string
|
2025-07-18 14:24:07 +02:00
|
|
|
os*: string
|
2025-07-21 22:07:25 +02:00
|
|
|
process*: string
|
|
|
|
|
pid*: int
|
2025-07-18 14:24:07 +02:00
|
|
|
elevated*: bool
|
|
|
|
|
sleep*: int
|
2025-10-23 11:14:26 +02:00
|
|
|
jitter*: int
|
2025-07-19 16:49:27 +02:00
|
|
|
tasks*: seq[Task]
|
2025-10-02 10:25:37 +02:00
|
|
|
modules*: uint32
|
|
|
|
|
firstCheckin*: int64
|
|
|
|
|
latestCheckin*: int64
|
2025-07-23 13:47:37 +02:00
|
|
|
sessionKey*: Key
|
2025-07-18 14:24:07 +02:00
|
|
|
|
2025-09-25 19:22:17 +02:00
|
|
|
# Session entry for client UI
|
|
|
|
|
UIAgent* = ref object
|
|
|
|
|
agentId*: string
|
|
|
|
|
listenerId*: string
|
|
|
|
|
username*: string
|
2025-10-17 13:01:12 +02:00
|
|
|
impersonationToken*: string
|
2025-09-25 19:22:17 +02:00
|
|
|
hostname*: string
|
|
|
|
|
domain*: string
|
2025-10-02 10:25:37 +02:00
|
|
|
ipInternal*: string
|
|
|
|
|
ipExternal*: string
|
2025-09-25 19:22:17 +02:00
|
|
|
os*: string
|
|
|
|
|
process*: string
|
|
|
|
|
pid*: int
|
|
|
|
|
elevated*: bool
|
|
|
|
|
sleep*: int
|
2025-10-23 11:14:26 +02:00
|
|
|
jitter*: int
|
2025-10-02 10:25:37 +02:00
|
|
|
modules*: uint32
|
2025-09-25 19:22:17 +02:00
|
|
|
firstCheckin*: int64
|
|
|
|
|
latestCheckin*: int64
|
|
|
|
|
|
2025-07-18 14:24:07 +02:00
|
|
|
# Listener structure
|
|
|
|
|
type
|
2025-09-22 21:53:13 +02:00
|
|
|
Protocol* {.size: sizeof(uint8).} = enum
|
2025-07-18 14:24:07 +02:00
|
|
|
HTTP = "http"
|
|
|
|
|
|
2025-10-11 17:10:18 +02:00
|
|
|
Listener* = ref object
|
2025-09-19 18:31:45 +02:00
|
|
|
server*: Server
|
2025-07-22 21:31:18 +02:00
|
|
|
listenerId*: string
|
2025-10-11 17:10:18 +02:00
|
|
|
hosts*: string
|
2025-07-18 14:24:07 +02:00
|
|
|
address*: string
|
|
|
|
|
port*: int
|
|
|
|
|
protocol*: Protocol
|
|
|
|
|
|
2025-10-11 17:10:18 +02:00
|
|
|
UIListener* = ref object
|
2025-09-25 19:22:17 +02:00
|
|
|
listenerId*: string
|
2025-10-11 17:10:18 +02:00
|
|
|
hosts*: string
|
2025-09-25 19:22:17 +02:00
|
|
|
address*: string
|
|
|
|
|
port*: int
|
|
|
|
|
protocol*: Protocol
|
|
|
|
|
|
2025-09-26 15:30:14 +02:00
|
|
|
#[
|
|
|
|
|
Client <-> Server WebSocket communication
|
|
|
|
|
]#
|
|
|
|
|
type
|
|
|
|
|
EventType* = enum
|
|
|
|
|
CLIENT_HEARTBEAT = 0'u8 # Basic checkin
|
2025-10-09 12:14:38 +02:00
|
|
|
CLIENT_KEY_EXCHANGE = 200'u8 # Unencrypted public key sent by both parties for key exchange
|
2025-10-01 21:57:26 +02:00
|
|
|
|
2025-09-26 15:30:14 +02:00
|
|
|
# Sent by client
|
|
|
|
|
CLIENT_AGENT_BUILD = 1'u8 # Generate an agent binary for a specific listener
|
2025-10-01 21:57:26 +02:00
|
|
|
CLIENT_AGENT_TASK = 2'u8 # Instruct TS to send queue a command for a specific agent
|
2025-09-26 15:30:14 +02:00
|
|
|
CLIENT_LISTENER_START = 3'u8 # Start a listener on the TS
|
|
|
|
|
CLIENT_LISTENER_STOP = 4'u8 # Stop a listener
|
2025-10-09 16:25:05 +02:00
|
|
|
CLIENT_LOOT_REMOVE = 5'u8 # Remove loot on the team server
|
2025-10-14 22:04:04 +02:00
|
|
|
CLIENT_LOOT_GET = 6'u8 # Request file/screenshot from the team server for preview or download
|
2025-10-27 15:17:56 +01:00
|
|
|
CLIENT_AGENT_REMOVE = 7'u8 # Delete agent from the team server database
|
2025-10-14 22:04:04 +02:00
|
|
|
|
2025-09-26 15:30:14 +02:00
|
|
|
# Sent by team server
|
|
|
|
|
CLIENT_PROFILE = 100'u8 # Team server profile and configuration
|
|
|
|
|
CLIENT_LISTENER_ADD = 101'u8 # Add listener to listeners table
|
|
|
|
|
CLIENT_AGENT_ADD = 102'u8 # Add agent to sessions table
|
|
|
|
|
CLIENT_AGENT_CHECKIN = 103'u8 # Update agent checkin
|
|
|
|
|
CLIENT_AGENT_PAYLOAD = 104'u8 # Return agent payload binary
|
2025-10-01 21:57:26 +02:00
|
|
|
CLIENT_CONSOLE_ITEM = 105'u8 # Add entry to a agent's console
|
2025-10-02 10:25:37 +02:00
|
|
|
CLIENT_EVENTLOG_ITEM = 106'u8 # Add entry to the eventlog
|
2025-10-07 21:16:17 +02:00
|
|
|
CLIENT_BUILDLOG_ITEM = 107'u8 # Add entry to the build log
|
2025-10-14 22:04:04 +02:00
|
|
|
CLIENT_LOOT_ADD = 108'u8 # Add file or screenshot stored on the team server to preview on the client, only sends metadata and not the actual file content
|
|
|
|
|
CLIENT_LOOT_DATA = 109'u8 # Send file/screenshot bytes to the client to display as preview or to download to the client desktop
|
2025-10-17 13:01:12 +02:00
|
|
|
CLIENT_IMPERSONATE_TOKEN = 110'u8 # Access token impersonated
|
|
|
|
|
CLIENT_REVERT_TOKEN = 111'u8 # Revert to original logon session
|
2025-09-26 15:30:14 +02:00
|
|
|
|
|
|
|
|
Event* = object
|
|
|
|
|
eventType*: EventType
|
|
|
|
|
timestamp*: int64
|
|
|
|
|
data*: JsonNode
|
|
|
|
|
|
2025-08-20 12:55:09 +02:00
|
|
|
# Context structures
|
2025-07-18 14:24:07 +02:00
|
|
|
type
|
2025-07-24 15:31:46 +02:00
|
|
|
KeyPair* = object
|
2025-07-24 17:26:48 +02:00
|
|
|
privateKey*: Key
|
2025-07-24 15:31:46 +02:00
|
|
|
publicKey*: Key
|
|
|
|
|
|
2025-08-14 19:33:32 +02:00
|
|
|
Profile* = TomlValueRef
|
2025-08-13 19:32:51 +02:00
|
|
|
|
2025-10-01 21:57:26 +02:00
|
|
|
WsConnection* = ref object
|
|
|
|
|
when defined(server):
|
|
|
|
|
ws*: mummy.WebSocket
|
|
|
|
|
when defined(client):
|
|
|
|
|
ws*: whisky.WebSocket
|
|
|
|
|
sessionKey*: Key
|
2025-09-26 15:30:14 +02:00
|
|
|
|
2025-07-18 14:24:07 +02:00
|
|
|
Conquest* = ref object
|
|
|
|
|
dbPath*: string
|
2025-09-25 19:22:17 +02:00
|
|
|
listeners*: Table[string, Listener]
|
|
|
|
|
threads*: Table[string, Thread[Listener]]
|
2025-07-18 14:24:07 +02:00
|
|
|
agents*: Table[string, Agent]
|
2025-07-24 15:31:46 +02:00
|
|
|
keyPair*: KeyPair
|
2025-08-13 19:32:51 +02:00
|
|
|
profile*: Profile
|
2025-10-01 21:57:26 +02:00
|
|
|
client*: WsConnection
|
2025-07-22 21:00:39 +02:00
|
|
|
|
2025-10-28 23:02:48 +01:00
|
|
|
WorkingHours* = ref object
|
|
|
|
|
enabled*: bool
|
|
|
|
|
startHour*: int32
|
|
|
|
|
startMinute*: int32
|
|
|
|
|
endHour*: int32
|
|
|
|
|
endMinute*: int32
|
|
|
|
|
|
2025-10-23 11:14:26 +02:00
|
|
|
SleepSettings* = ref object
|
|
|
|
|
sleepDelay*: uint32
|
|
|
|
|
jitter*: uint32
|
|
|
|
|
sleepTechnique*: SleepObfuscationTechnique
|
|
|
|
|
spoofStack*: bool
|
2025-10-28 23:02:48 +01:00
|
|
|
workingHours*: WorkingHours
|
2025-10-23 11:14:26 +02:00
|
|
|
|
2025-08-15 15:42:57 +02:00
|
|
|
AgentCtx* = ref object
|
2025-07-22 21:00:39 +02:00
|
|
|
agentId*: string
|
|
|
|
|
listenerId*: string
|
2025-10-11 17:10:18 +02:00
|
|
|
hosts*: string
|
2025-10-23 11:14:26 +02:00
|
|
|
sleepSettings*: SleepSettings
|
2025-10-28 21:01:10 +01:00
|
|
|
killDate*: int64
|
2025-07-24 15:31:46 +02:00
|
|
|
sessionKey*: Key
|
2025-07-25 16:41:29 +02:00
|
|
|
agentPublicKey*: Key
|
2025-08-15 15:42:57 +02:00
|
|
|
profile*: Profile
|
2025-10-27 16:20:38 +01:00
|
|
|
registered*: bool
|
2025-07-25 16:41:29 +02:00
|
|
|
|
|
|
|
|
# Structure for command module definitions
|
|
|
|
|
type
|
|
|
|
|
Argument* = object
|
|
|
|
|
name*: string
|
|
|
|
|
description*: string
|
|
|
|
|
argumentType*: ArgType
|
|
|
|
|
isRequired*: bool
|
|
|
|
|
|
|
|
|
|
Command* = object
|
|
|
|
|
name*: string
|
|
|
|
|
commandType*: CommandType
|
|
|
|
|
description*: string
|
|
|
|
|
example*: string
|
|
|
|
|
arguments*: seq[Argument]
|
|
|
|
|
dispatchMessage*: string
|
2025-08-18 22:05:23 +02:00
|
|
|
execute*: proc(config: AgentCtx, task: Task): TaskResult {.nimcall.}
|
2025-09-16 20:17:48 +02:00
|
|
|
|
2025-09-17 15:55:13 +02:00
|
|
|
Module* = object
|
|
|
|
|
name*: string
|
|
|
|
|
description*: string
|
2025-09-27 12:36:59 +02:00
|
|
|
moduleType*: ModuleType
|
2025-09-17 15:55:13 +02:00
|
|
|
commands*: seq[Command]
|
|
|
|
|
|
2025-09-16 20:17:48 +02:00
|
|
|
# Definitions for ImGui User interface
|
|
|
|
|
type
|
|
|
|
|
ConsoleItem* = ref object
|
|
|
|
|
itemType*: LogType
|
2025-10-12 15:00:42 +02:00
|
|
|
timestamp*: string
|
2025-09-16 20:17:48 +02:00
|
|
|
text*: string
|
|
|
|
|
|
|
|
|
|
ConsoleItems* = ref object
|
2025-09-22 21:53:13 +02:00
|
|
|
items*: seq[ConsoleItem]
|
2025-09-27 15:18:45 +02:00
|
|
|
|
|
|
|
|
AgentBuildInformation* = ref object
|
2025-10-23 11:14:26 +02:00
|
|
|
listenerId*: string
|
2025-10-28 21:01:10 +01:00
|
|
|
sleepSettings*: SleepSettings
|
2025-10-20 22:08:06 +02:00
|
|
|
verbose*: bool
|
2025-10-28 21:01:10 +01:00
|
|
|
killDate*: int64
|
2025-10-03 12:44:28 +02:00
|
|
|
modules*: uint32
|
2025-10-07 21:16:17 +02:00
|
|
|
|
2025-10-09 12:14:38 +02:00
|
|
|
LootItemType* = enum
|
|
|
|
|
DOWNLOAD = 0'u8
|
|
|
|
|
SCREENSHOT = 1'u8
|
|
|
|
|
|
2025-10-07 21:16:17 +02:00
|
|
|
LootItem* = ref object
|
2025-10-09 12:14:38 +02:00
|
|
|
itemType*: LootItemType
|
|
|
|
|
lootId*: string
|
2025-10-07 21:16:17 +02:00
|
|
|
agentId*: string
|
2025-10-09 12:14:38 +02:00
|
|
|
host*: string
|
2025-10-07 21:16:17 +02:00
|
|
|
path*: string
|
|
|
|
|
timestamp*: int64
|
|
|
|
|
size*: int
|