From b8cdf5ae52543ecaf767fc031bf55f2a2f5f33b9 Mon Sep 17 00:00:00 2001 From: Sein Coray Date: Thu, 4 Sep 2025 15:34:32 +0200 Subject: [PATCH 1/4] added documentation for reset/fresh install --- .../advanced_install.md | 31 ++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/doc/installation_guidelines/advanced_install.md b/doc/installation_guidelines/advanced_install.md index 022a997d4..76745f2d0 100644 --- a/doc/installation_guidelines/advanced_install.md +++ b/doc/installation_guidelines/advanced_install.md @@ -221,4 +221,33 @@ docker compose down docker compose up ``` -Finally, copy the data back into the appropriate folders after recreating the containers. \ No newline at end of file +Finally, copy the data back into the appropriate folders after recreating the containers. + +## Set up a fresh and clean instance + +When there is the need for a complete reset/clean setup (e.g. for testing), you can do following steps to completely remove all data. + +> [!CAUTION] +> The following steps will delete all data in your hashtopolis instance (including the database, users, tasks, agents, etc.)! + +These steps assume that you have set up your hashtopolis instance using a `docker-compose.yml` file. + +First stop all running all containers and clean them up: + +``` +cd +docker compose down +``` + +In case you have mounted directories for files and other data instead of using a docker volume, clean these directories by removing all files inside (wordlists, rules, etc.). + +Delete the docker volumes for the database and hashtopolis data (if you don't have the folders mounted otherwise). +Use `docker volume ls` to determine which volumes exist (typically they are prefixed with the name of the folder containing the `docker-compose.yml`). + +For each of the relevant volume, delete it by using `docker volume rm `. + +Afterwards, you can start up the dockers again which should then be in a complete clean state and a freshly set up instance: + +``` +docker compose up -d +``` From f82a5bc6f254cad31bcca2dfbc905c24a8958d94 Mon Sep 17 00:00:00 2001 From: Sein Coray Date: Thu, 4 Sep 2025 15:41:59 +0200 Subject: [PATCH 2/4] added wget command for agent download --- doc/installation_guidelines/basic_install.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/doc/installation_guidelines/basic_install.md b/doc/installation_guidelines/basic_install.md index 508de0eae..a9e1cf445 100644 --- a/doc/installation_guidelines/basic_install.md +++ b/doc/installation_guidelines/basic_install.md @@ -53,7 +53,9 @@ docker compose up --detach ## Agent installation + ### Prerequisites + To install the agent, ensure that the following prerequisites are met: 1. Python: Python 3 must be installed on the agent system. If Python 3 is not installed, refer to the official Python installation guide. You can verify the installation by running the following command in your terminal: @@ -80,6 +82,7 @@ pip install requests psutil ``` ### Download the Hashtopolis agent + 1. Connect to the Hashtopolis server: ```http://:8080``` and log in. Navigate to the page *Agents > Show Agents* and click on the button *'+ New Agent'*. 2. On that page you can click on "..." and choose to download the agent binary or copy the URL of the agent binary and download the agent using wget/curl: @@ -87,6 +90,12 @@ pip install requests psutil curl -o hashtopolis.zip "http://:8080/agents.php?download=1" ``` +or + +``` +wget --content-disposition "http://:8080/agents.php?download=1" +``` + ### Start and register a new agent 1. Activate your python virtual environment if not done before: From 2a6b04fc8528e3a92a863c88a6860ce84d106fc8 Mon Sep 17 00:00:00 2001 From: Sein Coray Date: Thu, 4 Sep 2025 16:26:17 +0200 Subject: [PATCH 3/4] added section for backup/restore --- doc/installation_guidelines/advanced_install.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/doc/installation_guidelines/advanced_install.md b/doc/installation_guidelines/advanced_install.md index 76745f2d0..960d0c68e 100644 --- a/doc/installation_guidelines/advanced_install.md +++ b/doc/installation_guidelines/advanced_install.md @@ -223,6 +223,16 @@ docker compose up Finally, copy the data back into the appropriate folders after recreating the containers. +## Backup and Restore + +What the best way to backup and restore your hashtopolis instance depends heavily on the way the instance is set up and what configurations are made. +Therefore, there is no guide available for backing up / restoring which works for everyone, but some considerations which need to be taken into account: + +- Depending on the amount of data (files, database size, etc.) in the hashtopolis instance, a complete backup can become quite large. If it is needed to just be able to restore information about executed tasks, progress etc. (e.g. in case of a fatal failure of the system) it is enough to just back up the database, but of course this would not allow a easy restore to a previous state. +- If you plan to do a backup in a way to be able to completely restore it to the previous state (files, logs, database, users, etc.), you need to be careful to include all required items into your backup and when restoring make sure that nothing gets left out during that process, otherwise you may end up with a semi-broken or non-functional hashtopolis instance. +- In case you have set up your hashtopolis instance only using volumes (one for the database, one for all the hashtopolis data), backup up the complete content of these volumes is enough to have all data backed up. +- Restoring only parts (some tasks, only users, other database parts) from a backup is very tricky and should only be done by experts and very easily goes wrong when primary keys are not sequential and not updated for auto increment in the database. + ## Set up a fresh and clean instance When there is the need for a complete reset/clean setup (e.g. for testing), you can do following steps to completely remove all data. From f9d5a8cc30bed9ef0fdb8754d159fa6a9fa9012f Mon Sep 17 00:00:00 2001 From: Sein Coray Date: Fri, 5 Sep 2025 08:28:54 +0200 Subject: [PATCH 4/4] fixed grammatical proposals --- doc/installation_guidelines/advanced_install.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/installation_guidelines/advanced_install.md b/doc/installation_guidelines/advanced_install.md index 960d0c68e..d16ac76dd 100644 --- a/doc/installation_guidelines/advanced_install.md +++ b/doc/installation_guidelines/advanced_install.md @@ -249,14 +249,14 @@ cd docker compose down ``` -In case you have mounted directories for files and other data instead of using a docker volume, clean these directories by removing all files inside (wordlists, rules, etc.). +In case you have mounted directories for files and other data instead of using a docker volume, clean these directories by removing all files within (wordlists, rules, etc.). Delete the docker volumes for the database and hashtopolis data (if you don't have the folders mounted otherwise). Use `docker volume ls` to determine which volumes exist (typically they are prefixed with the name of the folder containing the `docker-compose.yml`). For each of the relevant volume, delete it by using `docker volume rm `. -Afterwards, you can start up the dockers again which should then be in a complete clean state and a freshly set up instance: +Afterwards, you can start up the containers again which should then be in a complete clean state and a freshly set up instance: ``` docker compose up -d