Native file dialogs now work in WSL.

This commit is contained in:
Jakob Friedl
2025-10-31 11:09:37 +01:00
parent d581e0d2b6
commit e27df807b3
6 changed files with 30 additions and 54 deletions

View File

@@ -9,34 +9,9 @@
## Getting Started ## Getting Started
The Conquest team server and operator client are meant to be compiled and used on a UNIX operating system. The Conquest team server and operator client are currently meant to be compiled and used on a Ubuntu/Debian-based operating system. For getting the framework up and running, follow the [installation instructions](./docs/1-INSTALLATION.md).
1. Install Nim For more information about architecture, usage and features, check out the [documentation](./docs/README.md)!
```
curl https://nim-lang.org/choosenim/init.sh -sSf | sh
```
2. Build the Conquest team server and client. When first used, these commands download all required dependencies and libraries.
```
nimble server
nimble client
```
3. Start the team server with a C2 profile.
```
sudo bin/server -p data/profile.toml
```
4. Start the operator client and connect it to a team server
```
bin/client [-i <address> (default: localhost)] [-p <port> (default: 37573)]
```
For more information, check out the [docs](./docs/README.md)!
## Features ## Features

View File

@@ -1,12 +1,12 @@
# Installation # Installation
1. Clone the Conquest repository ## 1. Clone the Conquest repository
``` ```
git clone https://github.com/jakobfriedl/conquest git clone https://github.com/jakobfriedl/conquest
cd conquest cd conquest
``` ```
2. Install Nim. ## 2. Install Nim.
```bash ```bash
curl https://nim-lang.org/choosenim/init.sh -sSf | sh curl https://nim-lang.org/choosenim/init.sh -sSf | sh
@@ -18,28 +18,40 @@ After it is installed, the Nim binaries need to be added to the PATH.
export PATH=/home/kali/.nimble/bin:$PATH export PATH=/home/kali/.nimble/bin:$PATH
``` ```
3. Install dependencies ## 3. Install dependencies
The Conquest binaries for team server and client are designed to be compiled and run on Ubuntu/Debian-based systems. The operator client requires the following dependencies to be installed.
The operator client requires the following dependencies to be installed on Ubuntu/Debian systems.
``` ```
sudo apt update sudo apt update
sudo apt install gcc g++ make git curl xz-utils sudo apt install gcc g++ make git curl xz-utils
sudo apt install libglfw3-dev libgl1-mesa-dev libglu1-mesa-dev libx11-dev libxrandr-dev libxinerama-dev libxcursor-dev libxi-dev sudo apt install libglfw3-dev libgl1-mesa-dev libglu1-mesa-dev libx11-dev libxrandr-dev libxinerama-dev libxcursor-dev libxi-dev
``` ```
4. The Conquest binaries for team server and client are designed to be compiled on a UNIX system using the `nimble` command. This command installs and updates all dependencies and third-party libraries automatically. To run the client on a Windows host, install the dependencies in WSL. Furthermore, to use save file dialogs, the following package is also required
```
sudo apt install libgtk2.0-0
```
## 4. Compile conquest
The Conquest binaries are compiled using the `nimble` command, which installs and updates all Nim libraries and dependencies automatically.
``` ```
nimble server nimble server
nimble client nimble client
``` ```
Optionally, the required dependencies can be installed manually using the following command. Optionally, the required dependencies can be installed manually using the following command prior to the compilation.
``` ```
nimble install -d nimble install -d
``` ```
4. Start the Conquest team server with a C2 profile. The default profile is located in data/profile.toml and can be adapted by the operator. ## 5. Start the Conquest team server with a C2 profile.
The default profile is located in [data/profile.toml](../data/profile.toml) and can be adapted by the operator.
``` ```
sudo bin/server -p data/profile sudo bin/server -p data/profile
``` ```
@@ -48,7 +60,8 @@ On the first start, the Conquest team server creates the Conquest database in th
![Team server start](../assets/install.png) ![Team server start](../assets/install.png)
5. Start the Conquest operator client ## 6. Start the Conquest operator client
``` ```
bin/client bin/client
``` ```

View File

@@ -5,5 +5,5 @@
--passL:"-s" # Strip symbols, such as sensitive function names --passL:"-s" # Strip symbols, such as sensitive function names
-d:CONFIGURATION="PLACEHOLDERAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA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false" -d:VERBOSE="true"
-o:"/mnt/c/Users/jakob/Documents/Projects/conquest/bin/monarch.x64.exe" -o:"/mnt/c/Users/jakob/Documents/Projects/conquest/bin/monarch.x64.exe"

View File

@@ -1,5 +1,5 @@
import whisky import whisky
import tables, times, strutils, strformat, json, parsetoml, base64, os # native_dialogs import tables, times, strutils, strformat, json, parsetoml, base64, os, native_dialogs
import ./utils/[appImGui, globals] import ./utils/[appImGui, globals]
import ./views/[dockspace, sessions, listeners, eventlog, console] import ./views/[dockspace, sessions, listeners, eventlog, console]
import ./views/loot/[screenshots, downloads] import ./views/loot/[screenshots, downloads]
@@ -123,11 +123,7 @@ proc main(ip: string = "localhost", port: int = 37573) =
of CLIENT_AGENT_PAYLOAD: of CLIENT_AGENT_PAYLOAD:
let payload = decode(event.data["payload"].getStr()) let payload = decode(event.data["payload"].getStr())
try: try:
let path = fmt"{CONQUEST_ROOT}/bin/monarch.x64.exe" let path = callDialogFileSave("Save Payload")
# TODO: Using native file dialogs to have the client select the output file path (does not work in WSL)
# let path = callDialogFileSave("Save Payload")
writeFile(path, payload) writeFile(path, payload)
except IOError: except IOError:
discard discard

View File

@@ -1,4 +1,4 @@
import strformat, strutils, times, os, tables # native_dialogs import strformat, strutils, times, os, tables, native_dialogs
import imguin/[cimgui, glfw_opengl, simple] import imguin/[cimgui, glfw_opengl, simple]
import ../../utils/[appImGui, colors] import ../../utils/[appImGui, colors]
import ../../../common/[types, utils] import ../../../common/[types, utils]
@@ -96,11 +96,7 @@ proc draw*(component: DownloadsComponent, showComponent: ptr bool, connection: W
if igMenuItem("Download", nil, false, true): if igMenuItem("Download", nil, false, true):
# Download file # Download file
try: try:
let path = item.path & ".download" let path = callDialogFileSave("Save File")
# TODO: Use native dialogs to select the download location
# let path = callDialogFileSave("Save File")
let data = component.contents[item.lootId] let data = component.contents[item.lootId]
writeFile(path, data) writeFile(path, data)
except IOError: except IOError:

View File

@@ -1,4 +1,4 @@
import strformat, strutils, times, os, tables # native_dialogs import strformat, strutils, times, os, tables, native_dialogs
import imguin/[cimgui, glfw_opengl, simple] import imguin/[cimgui, glfw_opengl, simple]
import ../../utils/[appImGui, colors] import ../../utils/[appImGui, colors]
import ../../../common/[types, utils] import ../../../common/[types, utils]
@@ -104,11 +104,7 @@ proc draw*(component: ScreenshotsComponent, showComponent: ptr bool, connection:
if igMenuItem("Download", nil, false, true): if igMenuItem("Download", nil, false, true):
# Download screenshot # Download screenshot
try: try:
let path = item.path & "_download.jpeg" let path = callDialogFileSave("Save File")
# TODO: Use native dialogs to select the download location
# let path = callDialogFileSave("Save File")
let data = component.textures[item.lootId].data let data = component.textures[item.lootId].data
writeFile(path, data) writeFile(path, data)
except IOError: except IOError: