Updated directory structure.

This commit is contained in:
Jakob Friedl
2025-10-03 12:44:28 +02:00
parent ae09e4e7e3
commit b39a0e70e2
18 changed files with 79 additions and 26 deletions

View File

@@ -4,5 +4,5 @@
--opt:size
--passL:"-s" # Strip symbols, such as sensitive function names
-d:CONFIGURATION="PLACEHOLDERAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAPLACEHOLDER"
-d:MODULES="255"
-d:MODULES="127"
-o:"/mnt/c/Users/jakob/Documents/Projects/conquest/bin/monarch.x64.exe"

View File

@@ -1,6 +1,6 @@
import std/paths
import strutils, sequtils, times, tables
import ../common/[types, sequence, crypto, utils, serialize]
import ../../common/[types, sequence, crypto, utils, serialize]
proc parseInput*(input: string): seq[string] =
var i = 0

View File

@@ -1,6 +1,6 @@
import whisky
import times, tables, json, base64
import ../common/[types, utils, serialize, event]
import ../../common/[types, utils, serialize, event]
export sendHeartbeat, recvEvent
#[

View File

@@ -3,8 +3,9 @@ import tables, strutils, strformat, json, parsetoml, base64, os # native_dialogs
import ./utils/[appImGui, globals]
import ./views/[dockspace, sessions, listeners, eventlog, console]
import ./views/modals/generatePayload
import ./views/loot/[downloads, screenshots]
import ../common/[types, utils, crypto]
import ./websocket
import ./core/websocket
import sugar
@@ -19,6 +20,8 @@ proc main(ip: string = "localhost", port: int = 37573) =
showSessionsTable = true
showListeners = true
showEventlog = true
showDownloads = false
showScreenshots = false
consoles: Table[string, ConsoleComponent]
var
@@ -30,6 +33,8 @@ proc main(ip: string = "localhost", port: int = 37573) =
views["Sessions [Table View]"] = addr showSessionsTable
views["Listeners"] = addr showListeners
views["Eventlog"] = addr showEventlog
views["Loot::Downloads"] = addr showDownloads
views["Loot::Screenshots"] = addr showScreenshots
# Create components
var
@@ -37,6 +42,8 @@ proc main(ip: string = "localhost", port: int = 37573) =
sessionsTable = SessionsTable("Sessions [Table View]", addr consoles)
listenersTable = ListenersTable("Listeners")
eventlog = Eventlog("Eventlog")
lootDownloads = LootDownloads("Downloads")
lootScreenshots = LootScreenshots("Screenshots")
let io = igGetIO()
@@ -151,6 +158,8 @@ proc main(ip: string = "localhost", port: int = 37573) =
if showSessionsTable: sessionsTable.draw(addr showSessionsTable)
if showListeners: listenersTable.draw(addr showListeners, connection)
if showEventlog: eventlog.draw(addr showEventlog)
if showDownloads: lootDownloads.draw(addr showDownloads)
if showScreenshots: lootScreenshots.draw(addr showScreenshots)
# Show console windows
var newConsoleTable: Table[string, ConsoleComponent]

View File

@@ -4,7 +4,7 @@ import imguin/[cimgui, glfw_opengl, simple]
import ../utils/[appImGui, colors]
import ../../common/[types, utils]
import ../../modules/manager
import ../[task, websocket]
import ../core/[task, websocket]
const MAX_INPUT_LENGTH = 512
type

View File

@@ -1,4 +1,4 @@
import tables
import tables, strutils
import imguin/[cimgui, glfw_opengl, simple]
import ../utils/appImGui
@@ -56,6 +56,8 @@ proc draw*(component: DockspaceComponent, showComponent: ptr bool, views: Table[
igDockBuilderDockWindow("Sessions [Table View]", dockTopLeft[])
igDockBuilderDockWindow("Listeners", dockBottom[])
igDockBuilderDockWindow("Eventlog", dockTopRight[])
igDockBuilderDockWindow("Downloads", dockBottom[])
igDockBuilderDockWindow("Screenshots", dockBottom[])
igDockBuilderDockWindow("Dear ImGui Demo", dockTopRight[])
igDockBuilderFinish(dockspaceId)
@@ -74,8 +76,18 @@ proc draw*(component: DockspaceComponent, showComponent: ptr bool, views: Table[
if igBeginMenu("Views", true):
# Create a menu item to toggle each of the main views of the application
for view, showView in views:
if igMenuItem(view, nil, showView[], showView != nil):
showView[] = not showView[]
if not view.contains("::"):
if igMenuItem(view, nil, showView[], showView != nil):
showView[] = not showView[]
if igBeginMenu("Loot", true):
for view, showView in views:
if view.startsWith("Loot"):
let item = view.split("::", 1)[1].strip()
if igMenuItem(item, nil, showView[], showView != nil):
showView[] = not showView[]
igEndMenu()
igEndMenu()
igEndMenuBar()

View File

@@ -4,7 +4,7 @@ import imguin/[cimgui, glfw_opengl, simple]
import ../utils/appImGui
import ../../common/[types, utils]
import ./modals/[startListener, generatePayload]
import ../websocket
import ../core/websocket
type
ListenersTableComponent* = ref object of RootObj

View File

@@ -0,0 +1,19 @@
import strformat, strutils, times
import imguin/[cimgui, glfw_opengl, simple]
import ../../utils/[appImGui, colors]
import ../../../common/types
type
LootDownloadsComponent* = ref object of RootObj
title: string
proc LootDownloads*(title: string): LootDownloadsComponent =
result = new LootDownloadsComponent
result.title = title
proc draw*(component: LootDownloadsComponent, showComponent: ptr bool) =
igBegin(component.title, showComponent, 0)
defer: igEnd()
igText("asd")

View File

@@ -0,0 +1,19 @@
import strformat, strutils, times
import imguin/[cimgui, glfw_opengl, simple]
import ../../utils/[appImGui, colors]
import ../../../common/types
type
LootScreenshotsComponent* = ref object of RootObj
title: string
proc LootScreenshots*(title: string): LootScreenshotsComponent =
result = new LootScreenshotsComponent
result.title = title
proc draw*(component: LootScreenshotsComponent, showComponent: ptr bool) =
igBegin(component.title, showComponent, 0)
defer: igEnd()
igText("asd")

View File

@@ -64,8 +64,8 @@ proc draw*(component: SessionsTableComponent, showComponent: ptr bool) =
igTableSetupColumn("AgentID", ImGuiTableColumnFlags_NoReorder.int32 or ImGuiTableColumnFlags_NoHide.int32, 0.0f, 0)
igTableSetupColumn("ListenerID", ImGuiTableColumnFlags_DefaultHide.int32, 0.0f, 0)
igTableSetupColumn("Internal", ImGuiTableColumnFlags_None.int32, 0.0f, 0)
igTableSetupColumn("External", ImGuiTableColumnFlags_DefaultHide.int32, 0.0f, 0)
igTableSetupColumn("IP (Internal)", ImGuiTableColumnFlags_None.int32, 0.0f, 0)
igTableSetupColumn("IP (External)", ImGuiTableColumnFlags_DefaultHide.int32, 0.0f, 0)
igTableSetupColumn("Username", ImGuiTableColumnFlags_None.int32, 0.0f, 0)
igTableSetupColumn("Hostname", ImGuiTableColumnFlags_None.int32, 0.0f, 0)
igTableSetupColumn("Domain", ImGuiTableColumnFlags_None.int32, 0.0f, 0)

View File

@@ -2,9 +2,7 @@ import terminal, strformat, strutils, sequtils, tables, system, std/[dirs, paths
import ../globals
import ../db/database
import ../protocol/packer
import ../core/logger
import ../websocket
import ../core/[packer, logger, websocket]
import ../../common/[types, utils, serialize]
#[

View File

@@ -3,9 +3,8 @@ import strutils, base64
import ./handlers
import ../globals
import ../core/logger
import ../core/[logger, websocket]
import ../../common/[types, utils, serialize, profile]
import ../websocket
# Not Found
proc error404*(request: Request) =

View File

@@ -1,10 +1,9 @@
import terminal, strformat, strutils, sequtils, tables, system, osproc, streams, parsetoml
import ../globals
import ../core/logger
import ../core/[logger, websocket]
import ../db/database
import ../../common/[types, utils, serialize, crypto]
import ../websocket
const PLACEHOLDER = "PLACEHOLDER"

View File

@@ -4,9 +4,8 @@ import parsetoml
import ../api/routes
import ../db/database
import ../core/logger
import ../core/[logger, websocket]
import ../../common/[types, profile]
import ../websocket
proc serve(listener: Listener) {.thread.} =
try:

View File

@@ -1,6 +1,6 @@
import times, json, base64, parsetoml, strformat
import ../common/[types, utils, event]
import ./core/logger
import ./logger
import ../../common/[types, utils, event]
export sendHeartbeat, recvEvent
proc `%`*(agent: Agent): JsonNode =

View File

@@ -1,12 +1,11 @@
import mummy, mummy/routers
import terminal, parsetoml, json, math, base64, times
import strutils, strformat, system, tables
import ./core/[listener, logger, builder]
import ./globals
import ./db/database
import ./core/[listener, logger, builder, websocket]
import ../common/[types, crypto, utils, profile, event]
import ./websocket
import mummy, mummy/routers
proc header() =
echo ""