diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 578d3db45d015f8b52de524e3eef225af57904de..08e94728927b014346efd39d67e1c0b7e3f41fbe 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -28,13 +28,14 @@ pages_tag: - git config user.email $PROJECT_BOT_USER@gitlab.example.com - git fetch origin $PAGES_BRANCH && git checkout -b $PAGES_BRANCH origin/$PAGES_BRANCH || echo "Pages branch not deployed yet." - git checkout $CI_COMMIT_SHA + - export DOCUMENTATION_VERSION=${CI_COMMIT_TAG%.*} script: - - poetry run mike deploy -u -p --prefix public -r $HTTPS_REMOTE -b $PAGES_BRANCH $CI_COMMIT_TAG latest + - poetry run mike deploy -u -p --prefix public -r $HTTPS_REMOTE -b $PAGES_BRANCH $DOCUMENTATION_VERSION latest - poetry run mike set-default -p --prefix public -r $HTTPS_REMOTE -b $PAGES_BRANCH latest rules: - if: $CI_SERVER_HOST != "gitlab.ics.muni.cz" when: never - - if: $CI_COMMIT_TAG =~ /^[0-9]+\.[0-9]+$/ && $CI_COMMIT_REF_PROTECTED == "true" + - if: $CI_COMMIT_TAG =~ /^[0-9]+\.[0-9]+\.([0-9]|[0-z])+$/ && $CI_COMMIT_REF_PROTECTED == "true" pages_master: stage: build @@ -76,4 +77,4 @@ pages: - if: $CI_SERVER_HOST != "gitlab.ics.muni.cz" when: never - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH && $CI_COMMIT_REF_PROTECTED == "true" - - if: $CI_COMMIT_TAG =~ /^[0-9]+\.[0-9]+$/ && $CI_COMMIT_REF_PROTECTED == "true" + - if: $CI_COMMIT_TAG =~ /^[0-9]+\.[0-9]+\.([0-9]|[0-z])+$/ && $CI_COMMIT_REF_PROTECTED == "true" diff --git a/docs/components/cli.md b/docs/components/cli.md index 41a843795627b5be70a91b7837f5c51866f7f933..062c89c969ba433bc4317c2ab06013ce2feace38 100644 --- a/docs/components/cli.md +++ b/docs/components/cli.md @@ -145,13 +145,13 @@ Install the app: === "pipx" ```shell - pipx install cryton-cli + pipx install cryton-cli=={{{ release_version }}} ``` === "pip" ```shell - pip install --user cryton-cli + pip install --user cryton-cli=={{{ release_version }}} ``` ### With Docker diff --git a/docs/components/core.md b/docs/components/core.md index 98242ec13f9dbc0be7e964c749dc8794af1f21c8..adb4673814d96b128c0bf5648e8e48b31d0dc712 100644 --- a/docs/components/core.md +++ b/docs/components/core.md @@ -258,12 +258,13 @@ To make the installation process smoother the prerequisites are bundled within t !!! danger "Requirements" - [Docker Compose](https://docs.docker.com/compose/install/){target="_blank"} + - Create [permanent settings](#settings-permanent) !!! tip "Recommendations" - Docker [Post-installation steps](https://docs.docker.com/engine/install/linux-postinstall/){target="_blank"} - First, you have to create [permanent settings](#settings-permanent). Then, switch to the app directory: + Switch to the app directory: ```shell cd ~/.local/cryton-core/ ``` @@ -374,13 +375,13 @@ Install the app: === "pipx" ```shell - pipx install cryton-core + pipx install cryton-core=={{{ release_version }}} ``` === "pip" ```shell - pip install --user cryton-core + pip install --user cryton-core=={{{ release_version }}} ``` ### With Docker diff --git a/docs/components/modules.md b/docs/components/modules.md index 5a907ad128d51e550eec1f4bfe1c18b089dfe34d..f0b0d613d407efc56b1a898482ff0f68dfd33139 100644 --- a/docs/components/modules.md +++ b/docs/components/modules.md @@ -33,7 +33,7 @@ git checkout {{{ git_release }}} Make sure the Worker's app directory exists and copy the modules into it: ```shell -mkdir -p +mkdir -p ~/.local/cryton-worker/ cp -r modules ~/.local/cryton-worker/ ``` diff --git a/docs/components/worker.md b/docs/components/worker.md index b0392d76b3fe644aae041b8baf43f4c50d553038..cbe253d66bd8138432b8d16922940332fd31d8ac 100644 --- a/docs/components/worker.md +++ b/docs/components/worker.md @@ -249,7 +249,6 @@ The easiest way to install Cryton Worker (and its prerequisites) is to use the e - Create [permanent settings](#settings-permanent) - Update the following settings: 1. CRYTON_WORKER_MODULES_DIR=/absolute/path/to/modules/ - 2. CRYTON_WORKER_EMPIRE_HOST=cryton-empire !!! tip "Recommendations" @@ -265,7 +264,13 @@ Install the [modules](modules.md#installation) into the app directory and export ```shell export CRYTON_WORKER_MODULES_DIR=~/.local/cryton-worker/modules/ ``` -If you're using persistent settings, make sure that they match. + +!!! warning "Make sure that the persistent settings match" + + Check the real value of the variable using: + ```shell + export | grep CRYTON_WORKER_MODULES_DIR + ``` Download the configuration using: @@ -319,20 +324,26 @@ Install the [modules](modules.md#installation) into the app directory and export ```shell export CRYTON_WORKER_MODULES_DIR=~/.local/cryton-worker/modules/ ``` -If you're using persistent settings, make sure that they match. + +!!! warning "Make sure that the persistent settings match" + + Check the real value of the variable using: + ```shell + export | grep CRYTON_WORKER_MODULES_DIR + ``` Install the app: === "pipx" ```shell - pipx install cryton-worker + pipx install cryton-worker=={{{ release_version }}} ``` === "pip" ```shell - pip install --user cryton-worker + pip install --user cryton-worker=={{{ release_version }}} ``` ### With Docker @@ -352,7 +363,13 @@ Install the [modules](modules.md#installation) into the app directory and export ```shell export CRYTON_WORKER_MODULES_DIR=~/.local/cryton-worker/modules/ ``` -If you're using persistent settings, make sure that they match. + +!!! warning "Make sure that the persistent settings match" + + Check the real value of the variable using: + ```shell + export | grep CRYTON_WORKER_MODULES_DIR + ``` Run the container: @@ -364,7 +381,7 @@ Run the container: The following command ensures effortless deployment. It mounts the modules and shares the host's networking namespace. ``` - docker run --network host -e CRYTON_WORKER_MODULES_DIR=${CRYTON_WORKER_MODULES_DIR} -v ${CRYTON_WORKER_MODULES_DIR}:${CRYTON_WORKER_MODULES_DIR} registry.gitlab.ics.muni.cz:443/cryton/cryton-worker:{{{ release_version }}} + docker run --network host -e CRYTON_WORKER_MODULES_DIR=${CRYTON_WORKER_MODULES_DIR} -v ${CRYTON_WORKER_MODULES_DIR}:${CRYTON_WORKER_MODULES_DIR} -d registry.gitlab.ics.muni.cz:443/cryton/cryton-worker:{{{ release_version }}} ``` !!! warning "Limitations" @@ -378,7 +395,7 @@ Run the container: The following command ensures effortless deployment. It mounts the modules and shares the host's networking namespace. ``` - docker run --network host -e CRYTON_WORKER_MODULES_DIR=${CRYTON_WORKER_MODULES_DIR} -v ${CRYTON_WORKER_MODULES_DIR}:${CRYTON_WORKER_MODULES_DIR} registry.gitlab.ics.muni.cz:443/cryton/cryton-worker:kali-{{{ release_version }}} + docker run --network host -e CRYTON_WORKER_MODULES_DIR=${CRYTON_WORKER_MODULES_DIR} -v ${CRYTON_WORKER_MODULES_DIR}:${CRYTON_WORKER_MODULES_DIR} -d registry.gitlab.ics.muni.cz:443/cryton/cryton-worker:kali-{{{ release_version }}} ``` !!! warning "Limitations" diff --git a/docs/dynamic-execution.md b/docs/dynamic-execution.md index a532d7a8a6b5c2b392bd07ee737ca38d04f3445f..73c01a980040ab17748b9d7c94b1d8eaf587d25b 100644 --- a/docs/dynamic-execution.md +++ b/docs/dynamic-execution.md @@ -39,13 +39,13 @@ Download the example script: === "curl" ```shell - curl -O {{{config.site_url}}}{{{ release_version }}}/dynamic_example.py + curl -O {{{ config.site_url }}}dynamic_example.py ``` === "wget" ```shell - wget {{{config.site_url}}}{{{ release_version }}}/dynamic_example.py + wget {{{ config.site_url }}}dynamic_example.py ``` Update the `WORKER_ID` variable, and run the script: diff --git a/docs/getting-started/docker-compose.yml b/docs/getting-started/docker-compose.yml index 062e170f5b3408f75a6f50d9580cc1c719e45500..5e984355df477b97ea2b400be81a14c3b3706935 100644 --- a/docs/getting-started/docker-compose.yml +++ b/docs/getting-started/docker-compose.yml @@ -5,7 +5,7 @@ services: image: registry.gitlab.ics.muni.cz:443/cryton/cryton-core:{{{ release_version }}} container_name: cryton-core ports: - - "8000:80" + - "127.0.0.1:8000:80" env_file: - .env depends_on: @@ -50,8 +50,7 @@ services: restart: always image: bcsecurity/empire:v4.10.0 container_name: cryton-empire - expose: - - "1337" + network_mode: host env_file: - .env stdin_open: true diff --git a/docs/getting-started/.env b/docs/getting-started/env similarity index 86% rename from docs/getting-started/.env rename to docs/getting-started/env index f263281dfbafb255fa2f48370361698a0a6dd942..d0bd0a8846839ff2939c63fc8edab9490680a68c 100644 --- a/docs/getting-started/.env +++ b/docs/getting-started/env @@ -12,15 +12,12 @@ CRYTON_CORE_API_USE_STATIC_FILES=true CRYTON_WORKER_NAME=local_worker CRYTON_WORKER_MODULES_DIR=/opt/modules/ -CRYTON_WORKER_MSFRPCD_HOST=127.0.0.1 CRYTON_WORKER_MSFRPCD_PORT=55553 CRYTON_WORKER_MSFRPCD_SSL=true CRYTON_WORKER_MSFRPCD_USERNAME=cryton CRYTON_WORKER_MSFRPCD_PASSWORD=cryton -CRYTON_WORKER_RABBIT_HOST=cryton-rabbit CRYTON_WORKER_RABBIT_USERNAME=cryton CRYTON_WORKER_RABBIT_PASSWORD=cryton -CRYTON_WORKER_EMPIRE_HOST=cryton-empire CRYTON_WORKER_EMPIRE_USERNAME=cryton CRYTON_WORKER_EMPIRE_PASSWORD=cryton diff --git a/docs/getting-started/quick-start.md b/docs/getting-started/quick-start.md index f127211a06e5ef1a459f24fc4356148cd332a60a..de85ce3a7e040005c82f8295e58acabca2fad6dc 100644 --- a/docs/getting-started/quick-start.md +++ b/docs/getting-started/quick-start.md @@ -42,19 +42,19 @@ Download the .env file (settings): === "curl" ```shell - curl -O {{{config.site_url}}}{{{ release_version }}}/getting-started/.env + curl -o .env {{{ config.site_url }}}getting-started/env ``` === "wget" ```shell - wget {{{config.site_url}}}{{{ release_version }}}/getting-started/.env + wget -O .env {{{ config.site_url }}}getting-started/env ``` ??? abstract "Show the .env file" ```ini - {! include ".env" !} + {! include "env" !} ``` Download the Compose configuration: @@ -62,13 +62,13 @@ Download the Compose configuration: === "curl" ```shell - curl -O {{{config.site_url}}}{{{ release_version }}}/getting-started/docker-compose.yml + curl -O {{{ config.site_url }}}getting-started/docker-compose.yml ``` === "wget" ```shell - wget {{{config.site_url}}}{{{ release_version }}}/getting-started/docker-compose.yml + wget {{{ config.site_url }}}getting-started/docker-compose.yml ``` ??? abstract "Show the Compose config" diff --git a/docs/integrated-tools/empire.md b/docs/integrated-tools/empire.md index 48fe637bb1c13379b9227a99056e9b0cb2657d28..5f0b4d93b7880c2c3bdfbd7c3b388617553fb515 100644 --- a/docs/integrated-tools/empire.md +++ b/docs/integrated-tools/empire.md @@ -7,7 +7,7 @@ Description of [Empire](https://github.com/BC-SECURITY/Empire){target="_blank"} </ol> ## requirements for usage with Core: -- Installed and running Empire server with version 4.1.0 and above. Installation guide +- Installed and running Empire server with version **4.x.x**. Installation guide [here](https://bc-security.gitbook.io/empire-wiki/quickstart/installation){target="_blank"} - Installed all main Cryton components, that is [Core](../components/core.md), [Worker](../components/worker.md) and [Cli](../components/cli.md) diff --git a/docs/production.md b/docs/production.md index 59efd3895b23fdbe4c36a67dd8c18318e3673f66..5140bc9adb037b1aab45992f14f71a4fd6ca9e8e 100644 --- a/docs/production.md +++ b/docs/production.md @@ -13,7 +13,7 @@ Hide the rest API behind a proxy with restricted access. !!! tip - Use the officially supplied docker-compose.yml and add a .htaccess file to it. + Use the officially supplied docker-compose.yml. ## Worker ### Settings