### Setup Inventory Files (Linux) Source: https://github.com/badsectorlabs/ludus/blob/main/docs/docs/environment-guides/sans-workshop-active-directory-privilege-escalation-with-empire.md Navigate to the Ansible directory, export the range number, and use sed to replace placeholders in the inventory file. Install jq if needed. ```bash cd SANS-Workshop-Lab/ansible export RANGENUMBER=$(ludus range list --json | jq '.rangeNumber') # `sudo apt install jq` if you don't have jq sed -i "s/RANGENUMBER/$RANGENUMBER/g" ../ad/SANS/providers/ludus/inventory.yml ``` -------------------------------- ### Setup Inventory Files (macOS) Source: https://github.com/badsectorlabs/ludus/blob/main/docs/docs/environment-guides/sans-workshop-active-directory-privilege-escalation-with-empire.md Navigate to the Ansible directory, export the range number, and use sed to replace placeholders in the inventory file. Install jq if needed. ```bash cd SANS-Workshop-Lab/ansible export RANGENUMBER=$(ludus range list --json | jq '.rangeNumber') # `brew install jq` if you don't have jq sed -i '' "s/RANGENUMBER/$RANGENUMBER/g" ../ad/SANS/providers/ludus/inventory.yml ``` -------------------------------- ### Antisandbox Install Standard Source: https://github.com/badsectorlabs/ludus/blob/main/docs/docs/using-ludus/cli.md Install the standard QEMU and OVMF packages. ```APIDOC ## POST /api/v1/antisandbox/install-standard ### Description Install the standard QEMU and OVMF packages. ### Method POST ### Endpoint /api/v1/antisandbox/install-standard ### Response #### Success Response (200) - **message** (string) - Confirmation message indicating the standard packages have been installed. #### Response Example ```json { "message": "Standard QEMU and OVMF packages installed successfully." } ``` ``` -------------------------------- ### Clone and Setup GOAD Project with Ludus Source: https://github.com/badsectorlabs/ludus/blob/main/docs/docs/environment-guides/goad.md Clone the GOAD repository, navigate into the directory, install Python virtual environment dependencies, and set your Ludus API key. Then, run the GOAD setup script for Ludus. The lab provisioning process can take several hours. ```bash git clone https://github.com/Orange-Cyberdefense/GOAD.git cd GOAD sudo apt install python3.11-venv || sudo apt install python3.13-venv export LUDUS_API_KEY='myapikey' # put your Ludus admin api key here ./goad.sh -p ludus GOAD/ludus/local > check GOAD/ludus/local > set_lab GOAD # GOAD/GOAD-Light/NHA/SCCM GOAD/ludus/local > install ``` -------------------------------- ### Clone and Setup GOAD Project with Ludus Source: https://github.com/badsectorlabs/ludus/blob/main/docs/docs/environment-guides/goad-sccm.md Clone the GOAD repository, install necessary Python environment packages, set your Ludus API key, and then use the goad.sh script to configure and install the SCCM lab. This process can take several hours. ```bash git clone https://github.com/Orange-Cyberdefense/GOAD.git cd GOAD sudo apt install python3.11-venv || sudo apt install python3.13-venv export LUDUS_API_KEY='myapikey' # put your Ludus admin api key here ./goad.sh -p ludus GOAD/ludus/local > check GOAD/ludus/local > set_lab SCCM # GOAD/GOAD-Light/NHA/SCCM GOAD/ludus/local > install Now you wait. `[WARNING]` lines are ok, and some steps may take a long time, don't panic! This will take a few hours. You'll know it is done when you see: ``` [*] Lab successfully provisioned in XX:YY:ZZ ``` ``` -------------------------------- ### Install Go Development Environment Source: https://github.com/badsectorlabs/ludus/blob/main/docs/docs/developers/cicd.md Installs Go and adds it to the system's PATH. This is necessary for compiling Go applications. ```bash apt install curl wget ca-certificates wget https://go.dev/dl/go1.25.1.linux-amd64.tar.gz rm -rf /usr/local/go && tar -C /usr/local -xzf go1.25.1.linux-amd64.tar.gz echo 'export PATH=$PATH:/usr/local/go/bin' >> /etc/profile ``` -------------------------------- ### Install Ludus and Get Initial Credentials Source: https://github.com/badsectorlabs/ludus/blob/main/docs/docs/quick-start/build-templates.md This command installs Ludus and displays initial admin credentials, including API keys. Store these securely. ```shell su - ludus-install-status Initial admin credentials: userID: JD Proxmox username: john-doe Proxmox password: password Ludus Web username: john.doe@example.com Ludus Web password: password API key for user JD: JD._7Gx2T5kTUSD%uTWZ*lFi=Os6MpFR^OrG+yT94Xt [Note: This API key will be recreated if this command is run again and the old key will no longer work] exit ``` -------------------------------- ### Start Local Development Server Source: https://github.com/badsectorlabs/ludus/blob/main/docs/README.md Starts a local development server. Changes are reflected live without restarting. ```bash $ yarn start ``` -------------------------------- ### Antisandbox Install Custom Source: https://github.com/badsectorlabs/ludus/blob/main/docs/docs/using-ludus/cli.md Install the custom QEMU and OVMF packages for anti-sandbox features. ```APIDOC ## POST /api/v1/antisandbox/install-custom ### Description Install the custom QEMU and OVMF packages for anti-sandbox features. ### Method POST ### Endpoint /api/v1/antisandbox/install-custom ### Response #### Success Response (200) - **message** (string) - Confirmation message indicating the custom packages have been installed. #### Response Example ```json { "message": "Custom QEMU and OVMF packages installed successfully." } ``` ``` -------------------------------- ### Clone and Setup GOAD Project with Ludus Source: https://github.com/badsectorlabs/ludus/blob/main/docs/docs/environment-guides/goad-nha.md Clone the GOAD repository, install Python virtual environment dependencies, set your Ludus API key, and run the GOAD setup script for Ludus. The lab provisioning can take several hours. ```bash git clone https://github.com/Orange-Cyberdefense/GOAD.git cd GOAD sudo apt install python3.11-venv || sudo apt install python3.13-venv export LUDUS_API_KEY='myapikey' # put your Ludus admin api key here ./goad.sh -p ludus GOAD/ludus/local > check GOAD/ludus/local > set_lab NHA # GOAD/GOAD-Light/NHA/SCCM GOAD/ludus/local > install ``` -------------------------------- ### Install Standard Antisandbox Packages Source: https://github.com/badsectorlabs/ludus/blob/main/docs/docs/using-ludus/cli.md Installs the standard QEMU and OVMF packages for anti-sandbox functionality. This is a prerequisite for using certain anti-sandbox features. ```bash ludus antisandbox install-standard ``` -------------------------------- ### Example Ludus Range Configuration Source: https://github.com/badsectorlabs/ludus/blob/main/docs/docs/enterprise/subscription-roles/windows-wallpaper.md This example demonstrates how to include the 'ludus_set_wallpaper' role within a Ludus range configuration for a Windows 10 client VM. ```yaml ludus: - vm_name: "{{ range_id }}-CLIENT-WIN10" hostname: "{{ range_id }}-CLIENT-WIN10" template: win10-21h2-x64-enterprise-template vlan: 10 ip_last_octet: 20 ram_gb: 8 cpus: 4 windows: sysprep: false domain: fqdn: ludus.domain role: member roles: - ludus_set_wallpaper ``` -------------------------------- ### Example Range Configuration with AD Groups Source: https://github.com/badsectorlabs/ludus/blob/main/docs/docs/enterprise/subscription-roles/ad-groups.md A complete example of a range configuration that includes setting up Active Directory groups. This demonstrates how to integrate the `ludus_ad_groups` role within a larger infrastructure setup. ```yaml - vm_name: "{{ range_id }}-ad-dc-win2022-server-x64" hostname: "{{ range_id }}-DC01-2022" template: win2022-server-x64-template vlan: 10 ip_last_octet: 11 ram_gb: 8 cpus: 4 windows: sysprep: false domain: fqdn: ludus.domain role: primary-dc roles: - ludus_ad_groups role_vars: ludus_ad_groups: - name: Server Admins path: OU=groups,DC=ludus,DC=domain members: ludus.domain\domainuser ``` -------------------------------- ### Install Rotafile Script Source: https://github.com/badsectorlabs/ludus/blob/main/docs/docs/troubleshooting/packer-cache-cleanup.md Clone the Rotafile repository, make scripts executable, and install the script using sudo. ```bash git clone https://github.com/aancw/rotafile.git cd rotafile chmod +x rotafile.sh install.sh sudo ./install.sh ``` -------------------------------- ### Install Dependencies Source: https://github.com/badsectorlabs/ludus/blob/main/docs/README.md Run this command to install project dependencies using Yarn. ```bash $ yarn ``` -------------------------------- ### Install Ansible and Requirements Source: https://github.com/badsectorlabs/ludus/blob/main/docs/docs/environment-guides/netexec-workshop-lehack-2025.md Install ansible-core and pywinrm using pip. Clone the NetExec-Lab repository and navigate to the ansible directory. Install the necessary Ansible Galaxy requirements. ```shell # You can use a virtualenv here if you would like #terminal-command-local python3 -m pip install ansible-core #terminal-command-local python3 -m pip install pywinrm #terminal-command-local git clone https://github.com/Pennyw0rth/NetExec-Lab #terminal-command-local cd LeHack-2025/ansible #terminal-command-local ansible-galaxy install -r requirements.yml ``` -------------------------------- ### Example Ludus Range Configuration with Sysmon Source: https://github.com/badsectorlabs/ludus/blob/main/docs/docs/enterprise/subscription-roles/sysmon.md This example demonstrates how to include the 'ludus_sysmon' role in Ludus range configurations for both Windows and Debian clients. ```yaml ludus: - vm_name: "{{ range_id }}-CLIENT-WIN11" hostname: "{{ range_id }}-CLIENT-WIN11" template: win11-22h2-x64-enterprise-template vlan: 10 ip_last_octet: 21 ram_gb: 8 cpus: 4 windows: sysprep: false domain: fqdn: ludus.domain role: member roles: - ludus_sysmon - vm_name: "{{ range_id }}-debian12" hostname: "{{ range_id }}-debian12" template: debian-12-x64-server-template vlan: 10 ip_last_octet: 30 ram_gb: 8 cpus: 4 linux: true roles: - ludus_sysmon ``` -------------------------------- ### Install Ansible and Pywinrm Source: https://github.com/badsectorlabs/ludus/blob/main/docs/docs/environment-guides/sans-workshop-active-directory-privilege-escalation-with-empire.md Install Ansible core and the pywinrm library within the virtual environment. ```bash python3 -m pip install ansible-core python3 -m pip install pywinrm ``` -------------------------------- ### Manual CI VM Setup Commands Source: https://github.com/badsectorlabs/ludus/blob/main/docs/docs/developers/cicd.md Commands to run on a Debian 13 VM for manual CI setup before powering off and saving as a template. This includes setting the hostname and resizing the disk. ```bash hostname ludus-ci-debian-13 # Resize the disk by hand if needed (should be ~250GB) fdisk /dev/vda1 p d n 1 2048 [End] N w resize2fs /dev/vda1 ``` -------------------------------- ### Create Snapshot of Clean Setup Source: https://github.com/badsectorlabs/ludus/blob/main/docs/docs/environment-guides/goad-dracarys.md After the Ansible run completes and the lab is provisioned, create a snapshot of the clean setup. This can be done via the Proxmox web UI or using the Ludus CLI command provided. ```bash ludus --user DRACARYS2b5eca snapshot create clean-setup -d "Clean GOAD DRACARYS setup after ansible run" ``` -------------------------------- ### Example Range Configuration with Node Placement Source: https://github.com/badsectorlabs/ludus/blob/main/docs/docs/infrastructure-operations/cluster.md This example demonstrates how to configure VM placement within a Ludus range on a Proxmox cluster. It shows default node selection and specific VM overrides using `target_node`. ```yaml defaults: # Default node for the whole range (optional) target_node: pve1 ludus: - vm_name: "{{ range_id }}-dc01" hostname: "{{ range_id }}-DC01" template: win2019-server-x64-template vlan: 10 ip_last_octet: 11 ram_gb: 8 cpus: 4 # This VM is pinned to pve2 target_node: pve2 windows: sysprep: false domain: fqdn: ludus.network role: primary-dc - vm_name: "{{ range_id }}-workstation-1" hostname: "{{ range_id }}-WIN11-1" template: win11-22h2-x64-enterprise-template vlan: 10 ip_last_octet: 21 ram_gb: 8 cpus: 4 # No target_node: uses range default (pve1) windows: sysprep: false domain: fqdn: ludus.network role: member ``` -------------------------------- ### Install Ludus Prerequisites and Script Source: https://github.com/badsectorlabs/ludus/blob/main/docs/docs/quick-start/install-ludus.md Connect to your Debian host via SSH, elevate to root, update package lists, install curl, sudo, and ca-certificates, then download and execute the Ludus installation script. ```shell ssh user@debian ``` ```shell su - ``` ```shell apt update && apt install curl sudo ca-certificates ``` ```shell curl --proto '=https' --tlsv1.2 -sSf https://ludus.cloud/install | bash ``` ```shell curl https://ludus.cloud/install > install.sh ``` ```shell cat install.sh ``` ```shell chmod +x install.sh ``` ```shell ./install.sh ``` -------------------------------- ### Install Custom Antisandbox Packages Source: https://github.com/badsectorlabs/ludus/blob/main/docs/docs/using-ludus/cli.md Installs custom QEMU and OVMF packages required for advanced anti-sandbox features. This command is intended for enterprise use. ```bash ludus antisandbox install-custom ``` -------------------------------- ### Install Gitlab Runner and Git LFS Source: https://github.com/badsectorlabs/ludus/blob/main/docs/docs/developers/cicd.md Installs the gitlab-runner and git-lfs packages, along with essential build tools and utilities. ```bash curl -L 'https://packages.gitlab.com/install/repositories/runner/gitlab-runner/script.deb.sh' | bash curl -s 'https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh' | bash apt install gitlab-runner git git-lfs build-essential vim tmux htop jq python3-debian ``` -------------------------------- ### Install and Generate SMB Traffic with Netexec Source: https://github.com/badsectorlabs/ludus/blob/main/docs/docs/enterprise/subscription-roles/zeek.md Use these bash commands to install the netexec tool and generate SMB scanning traffic for testing. Ensure you replace placeholders with your actual IP addresses. ```bash ssh kali@ sudo su apt update -y apt install netexec -y netexec smb /24 netexec smb -M ntdsutil ``` -------------------------------- ### Install Custom QEMU and OVMF Packages Source: https://github.com/badsectorlabs/ludus/blob/main/docs/docs/enterprise/anti-sandbox.md Install the custom QEMU and OVMF packages required for the Anti-Sandbox feature. These packages affect the entire Ludus host and take effect after a VM reboot. ```shell ludus --url https://127.0.0.1:8081 antisandbox install-custom [INFO] Anti-Sandbox QEMU and OVMF installed - will take effect on VM's next power cycle ``` -------------------------------- ### Install Go for Server Build Source: https://github.com/badsectorlabs/ludus/blob/main/docs/docs/developers/building-from-source.md Installs Go version 1.24.0 for Linux amd64. This is a prerequisite for building the Ludus server. ```shell # Install Go wget https://go.dev/dl/go1.24.0.linux-amd64.tar.gz rm -rf /usr/local/go && tar -C /usr/local -xzf go1.24.0.linux-amd64.tar.gz export PATH=$PATH:/usr/local/go/bin ``` -------------------------------- ### Start Ludus Admin Service for Re-initialization Source: https://github.com/badsectorlabs/ludus/blob/main/docs/docs/upgrading-from-v1.md Start the ludus-admin service to re-initialize PocketBase and trigger the migration process after data cleanup. ```shell systemctl start ludus-admin ``` -------------------------------- ### Example Ludus Range Configuration Source: https://github.com/badsectorlabs/ludus/blob/main/docs/docs/enterprise/subscription-roles/GHOSTS-client.md This example demonstrates how to configure a Windows 10 client VM within the Ludus range, assigning it the 'ludus_ghosts_client' role. ```yaml ludus: - vm_name: "{{ range_id }}-CLIENT-WIN10" hostname: "{{ range_id }}-CLIENT-WIN10" template: win10-21h2-x64-enterprise-template vlan: 10 ip_last_octet: 20 ram_gb: 8 cpus: 4 windows: sysprep: false domain: fqdn: ludus.domain role: member roles: - ludus_ghosts_client role_vars: ``` -------------------------------- ### Run CI/CD Setup Script Source: https://github.com/badsectorlabs/ludus/blob/main/docs/docs/developers/cicd.md Execute the Ludus CI/CD setup script on the Ludus server. Ensure environment variables like PROXMOX_USERNAME and PROXMOX_PASSWORD are set correctly. ```bash PROXMOX_USERNAME=root@pam PROXMOX_PASSWORD=password /opt/ludus/ci/setup.sh ``` -------------------------------- ### Tail SCCM Setup Log Source: https://github.com/badsectorlabs/ludus/blob/main/docs/docs/environment-guides/sccm.md Monitor the SCCM installation process in real-time by tailing the setup log file. This PowerShell command is useful for observing the progress and identifying any potential issues during installation. ```powershell Get-Content C:\ConfigMgrSetup.log -Wait ``` -------------------------------- ### Start Testing Environment Source: https://github.com/badsectorlabs/ludus/blob/main/docs/docs/using-ludus/cli.md Snapshots all testing VMs and blocks all outbound connections and DNS from them. ```bash Usage: ludus testing start ``` -------------------------------- ### Antisandbox Status Source: https://github.com/badsectorlabs/ludus/blob/main/docs/docs/using-ludus/cli.md Get the status of anti-sandbox package installation. ```APIDOC ## GET /api/v1/antisandbox/status ### Description Get the status of anti-sandbox package installation. ### Method GET ### Endpoint /api/v1/antisandbox/status ### Response #### Success Response (200) - **status** (string) - The current status of the anti-sandbox package installation (e.g., "installed", "not installed", "pending"). #### Response Example ```json { "status": "installed" } ``` ``` -------------------------------- ### Create VM Snapshot Source: https://github.com/badsectorlabs/ludus/blob/main/docs/docs/environment-guides/sans-workshop-active-directory-privilege-escalation-with-empire.md Creates a snapshot of a virtual machine named 'clean-setup' with a descriptive message. Requires connection to the Ludus wireguard VPN. ```bash ludus snapshot create clean-setup -d "Clean SANS Lab setup after ansible run" ``` -------------------------------- ### Add Ludus Ansible Roles Source: https://github.com/badsectorlabs/ludus/blob/main/docs/docs/enterprise/subscription-roles/mythic.md Installs required Ansible roles for the Ludus Mythic C2 setup. Ensure these roles are added before installing the main Ludus Mythic subscription role. ```bash ludus ansible role add geerlingguy.docker ludus ansible role add gantsign.golang ludus ansible role add geerlingguy.pip ludus ansible subscription-roles install -n ludus_mythic ``` -------------------------------- ### Example Range Configuration File Source: https://github.com/badsectorlabs/ludus/blob/main/docs/docs/configuration.mdx This is an example of a Ludus range configuration file in YAML format. It outlines the structure for defining virtual machines and network settings. ```yaml title: "My First Range" description: "A simple range with one VM." network: version: v1 # Define your network rules here # Example: # - "allow tcp from any to any port 22" vm: version: v1 # Define your VMs here # Example: # - name: "my-vm" # image: "ubuntu:latest" # cpus: 1 # memory: "1Gi" # disk: "10Gi" ``` -------------------------------- ### Example Ludus Range Configuration for Mythic Source: https://github.com/badsectorlabs/ludus/blob/main/docs/docs/enterprise/subscription-roles/mythic.md An example Ludus range configuration file demonstrating how to deploy Mythic C2. This includes VM specifications, network settings, and role variable overrides for customization. ```yaml ludus: - vm_name: "{{ range_id }}-mythic" hostname: "{{ range_id }}-mythic" template: debian-12-x64-server-template vlan: 20 ip_last_octet: 1 ram_gb: 8 cpus: 4 linux: true roles: - ludus_mythic role_vars: mythic_admin_user: myadminusername mythic_admin_password: mycustompassword ``` -------------------------------- ### Build Project Documentation Source: https://github.com/badsectorlabs/ludus/blob/main/docs/docs/developers/cicd.md Installs project dependencies using Yarn and then builds the documentation. This step is typically performed after client and server builds are complete. ```bash cd ../docs yarn install yarn build ``` -------------------------------- ### Install Yarn and Go for Server Build (with Docs) Source: https://github.com/badsectorlabs/ludus/blob/main/docs/docs/developers/building-from-source.md Installs Yarn package manager and Go version 1.24.0 for Linux amd64. These are prerequisites for building the Ludus server with embedded documentation. ```shell # Install yarn echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list wget -qO- https://dl.yarnpkg.com/debian/pubkey.gpg | tee /etc/apt/trusted.gpg.d/dl.yarnpkg.com.asc apt update apt install yarn # Install Go wget https://go.dev/dl/go1.24.0.linux-amd64.tar.gz rm -rf /usr/local/go && tar -C /usr/local -xzf go1.24.0.linux-amd64.tar.gz export PATH=$PATH:/usr/local/go/bin ``` -------------------------------- ### Ludus CLI Configuration File Example Source: https://github.com/badsectorlabs/ludus/blob/main/docs/docs/using-ludus/cli.md An example YAML configuration file for the Ludus CLI. This file allows setting default values for URL, JSON output, verification, proxy, and user impersonation. The API key must be set separately. ```yaml url: https://192.168.1.103:8080 json: false verify: false proxy: http://127.0.0.0.1:8000 user: JD ``` -------------------------------- ### Blueprint ID Examples Source: https://github.com/badsectorlabs/ludus/blob/main/docs/docs/using-ludus/blueprints.md Illustrates valid formats for blueprint IDs, which must start with a letter and can contain alphanumeric characters, underscores, hyphens, and up to two slash-separated segments. ```bash - `my-blueprint` - `team/windows` - `org/team/prod-lab` ``` -------------------------------- ### Create Snapshot and Enable Anti-Sandbox Source: https://github.com/badsectorlabs/ludus/blob/main/docs/docs/enterprise/anti-sandbox.md Create a snapshot of a VM before enabling Anti-Sandbox and then enable the feature. Multiple VMs can be specified using a comma-separated list. ```shell ludus snapshot create -n 179 -d "Clean snapshot before enabling anti-sandbox" pre-antisandbox ludus --url https://127.0.0.1:8081 antisandbox enable -n 179 [INFO] Enabling Anti-Sandbox settings for VM(s), this can take some time. Please wait. [INFO] Successfully enabled anti-sandbox for VM(s): 179 ``` -------------------------------- ### Example Ludus Range Config: File Share VM Source: https://github.com/badsectorlabs/ludus/blob/main/docs/docs/enterprise/subscription-roles/smb-share.md Configure a Windows server VM to act as an SMB file share, defining its roles and variables for share setup. ```yaml ludus: - vm_name: "{{ range_id }}-fileshare" hostname: "{{ range_id }}-fileshare" template: win2022-server-x64-template vlan: 10 ip_last_octet: 1 ram_gb: 8 cpus: 4 windows: sysprep: false domain: fqdn: ludus.domain role: primary-dc roles: - ludus_smb_share role_vars: ludus_smb_shares_setup: - name: secret description: top secret share path: C:\\shares\\secret list: false full: ludus.domain\\domainadmin - name: internal description: internal share path: C:\\shares\\internal list: true full: ludus.domain\\domainadmin change: ludus.domain\\domainuser ``` -------------------------------- ### Prepare and Run Provisioning Script (Linux/Ludus) Source: https://github.com/badsectorlabs/ludus/blob/main/docs/docs/environment-guides/barbhack-ctf-2024.md Set environment variables for Ansible and execute the provisioning script to deploy the BarbHack workshop. Ensure you are connected to the Ludus VPN if not on the Ludus host. ```bash # in the ansible folder perform the following #terminal-command-local export ANSIBLE_COMMAND="ansible-playbook -i ../ad/BARBHACK/data/inventory -i ../ad/BARBHACK/providers/ludus/inventory.yml" #terminal-command-local export LAB="BARBHACK" #terminal-command-local chmod +x ../scripts/provisionning.sh #terminal-command-local ../scripts/provisionning.sh ``` -------------------------------- ### Update Ludus Server via Install Script Source: https://github.com/badsectorlabs/ludus/blob/main/docs/docs/infrastructure-operations/updating.md Run the install script to automatically detect and update an existing Ludus server installation. This command also installs the client. ```shell ssh user@ludus ``` ```shell curl -s https://ludus.cloud/install | bash ``` ```shell curl https://ludus.cloud/install > install.sh cat install.sh chmod +x install.sh ./install.sh ``` ```shell ==================================== _ _ _ ____ _ _ ____ | | | | | || _ \ | | | |/ ___\ | | | | | || | | || | | |\___ \ | |___ | |_| || |_| || |_| | ___)| | |____/ \___/ |____/ \___/ \___/ ==================================== [+] Client install prefix set to /usr/local/bin [+] Created temp dir at /tmp/ludus-client.AvRubQ [+] Architecture detected as x86_64 [+] OS detected as Linux [+] Downloaded ludus-client_linux-amd64-v1.5.0 into /tmp/ludus-client.AvRubQ [+] Downloaded ludus checksums file into /tmp/ludus-client.AvRubQ [+] Checksum of /tmp/ludus-client.AvRubQ/ludus-client_linux-amd64-v1.5.0 verified [+] Install prefix already exists. No need to create it. [+] Asking for sudo password to install file: /tmp/ludus-client.AvRubQ/ludus to directory: /usr/local/bin/ [sudo] password for debian: [+] Installed ludus-client_linux-amd64-v1.5.0 to /usr/local/bin/ as 'ludus' [+] Ludus client installation complete [+] Shell completions already installed [+] Ludus server already installed in /opt/ludus [?] Would you like to update the Ludus server on this host? [?] (y/n): y [+] Updating Ludus server [+] Downloaded ludus-server-v1.5.0 into /tmp/ludus-client.AvRubQ [+] Checksum of /tmp/ludus-client.AvRubQ/ludus-server-v1.5.0 verified Backed up /opt/ludus/ansible to /opt/ludus/previous-versions/1724356681992145034/ansible Backed up /opt/ludus/packer to /opt/ludus/previous-versions/1724356681992145034/packer Backed up /opt/ludus/ci to /opt/ludus/previous-versions/1724356681992145034/ci Extracting ludus to /opt/ludus... Ludus files extracted successfully Ludus updated to v1.5.0+2d39950 ``` -------------------------------- ### Create, Share, and Apply a Blueprint Source: https://github.com/badsectorlabs/ludus/blob/main/docs/docs/using-ludus/blueprints.md Demonstrates the basic workflow of creating a blueprint from your range configuration, sharing it with a team, and then applying it to another range. ```bash # Save your range config as a blueprint ludus blueprint create --id ad-lab --name "AD Lab" # Share it with your team ludus blueprint share group ad-lab sec-team # A teammate applies it to their range ludus blueprint apply ad-lab # Deploy the range ludus range deploy ``` -------------------------------- ### Create VM Snapshot Source: https://context7.com/badsectorlabs/ludus/llms.txt Create a new snapshot for all VMs, optionally including RAM for a complete system state backup. Provide a descriptive name and description. ```bash # Create snapshot with RAM (default) for all VMs ludus snapshots create pre-attack --description "Clean system before attack" ``` -------------------------------- ### Install Ludus on Debian/Proxmox Source: https://context7.com/badsectorlabs/ludus/llms.txt Installs Ludus using a one-liner script. Ensure prerequisites like curl and sudo are installed first. The installation process may require a reboot. ```bash # SSH into your Debian host and elevate to root ssh user@debian su - # Install prerequisites apt update && apt install curl sudo ca-certificates # Run the all-in-one installer curl --proto '=https' --tlsv1.2 -sSf https://ludus.cloud/install | bash # Monitor installation progress after reboot ludus-install-status ``` -------------------------------- ### Install Ludus Client on Windows Source: https://github.com/badsectorlabs/ludus/blob/main/docs/docs/quick-start/using-cli-locally.md Installs the Ludus client on Windows using PowerShell. This command downloads and executes the client installation script. ```powershell irm https://ludus.cloud/install-client.ps1 | iex ``` -------------------------------- ### List Available Templates Source: https://context7.com/badsectorlabs/ludus/llms.txt Display all available VM templates and whether they have been built. Templates are used to create new VMs. ```bash # List available templates ludus templates list ``` ```text +----------------------------------------+-------+ | TEMPLATE | BUILT | +----------------------------------------+-------+ | debian-12-x64-server-template | TRUE | | win11-22h2-x64-enterprise-template | TRUE | | kali-x64-desktop-template | TRUE | +----------------------------------------+-------+ ``` -------------------------------- ### Monitor Ludus Installation Source: https://github.com/badsectorlabs/ludus/blob/main/docs/docs/deployment-options/azure.md Check the status of the Ludus installation as root after the VM reboots. This command helps monitor the progress and success of the installation. ```bash ludus-install-status ``` -------------------------------- ### Start Ludus Template Build Process Source: https://github.com/badsectorlabs/ludus/blob/main/docs/docs/quick-start/build-templates.md Initiates the building of base VM templates from ISO files. This process can take a significant amount of time. ```shell ludus templates build [INFO] Template building started - this will take a while. Building 1 template(s) at a time. ``` -------------------------------- ### Check Antisandbox Installation Status Source: https://github.com/badsectorlabs/ludus/blob/main/docs/docs/using-ludus/cli.md Retrieves the current status of the anti-sandbox package installation on the system. This helps in verifying if the necessary components are correctly installed. ```bash ludus antisandbox status ``` -------------------------------- ### Install KMS Server Source: https://github.com/badsectorlabs/ludus/blob/main/docs/docs/enterprise/kms.md Installs the Key Management Service (KMS) server on the Ludus host. The server will be configured to listen on `192.0.2.1`. Ensure you wait for the installation to complete. ```bash ludus kms install ``` ```bash ludus kms install # Wait for the installation to complete. ``` -------------------------------- ### Follow Template Build Logs Source: https://context7.com/badsectorlabs/ludus/llms.txt Stream the build logs for VM templates in real-time. Use the `-f` flag to follow the output as it is generated. ```bash # Follow build logs ludus templates logs -f ``` -------------------------------- ### Initiate Callback and Verify Proof Source: https://github.com/badsectorlabs/ludus/blob/main/docs/docs/environment-guides/pivot-lab.md Initiates a callback from the linux target to the nginx server and then checks the proof file to confirm the callback was received. It also lists processes listening on port 4444. ```bash lsof -i tcp:4444 cat /tmp/PROOF callMe.sh linux 80 nginx 2010 tcp cat /tmp/PROOF #Now we have a callback that we caught on nginx ``` -------------------------------- ### Create and Activate Virtual Environment Source: https://github.com/badsectorlabs/ludus/blob/main/docs/docs/environment-guides/sans-workshop-active-directory-privilege-escalation-with-empire.md Create a Python virtual environment for installing lab requirements. ```bash python3 -m venv sans-ludus source sans-ludus/bin/activate ``` -------------------------------- ### Run Provisioning Script Source: https://github.com/badsectorlabs/ludus/blob/main/docs/docs/environment-guides/barbhack-ctf-2024.md Executes the provisioning script for the lab environment. ```bash ../scripts/provisionning.sh ``` -------------------------------- ### Blueprint Config Get Source: https://github.com/badsectorlabs/ludus/blob/main/docs/docs/using-ludus/cli.md Get the raw configuration content of a specific blueprint. ```APIDOC ## GET /api/v1/blueprint/config/get ### Description Get the raw configuration content of a specific blueprint. ### Method GET ### Endpoint /api/v1/blueprint/config/get ### Parameters #### Query Parameters - **blueprint_id** (string) - Required - The ID of the blueprint to retrieve configuration for. ### Response #### Success Response (200) - **configuration** (object) - The raw configuration content of the blueprint. #### Response Example ```json { "configuration": { "version": "1.0", "settings": { "network": "192.168.1.0/24" } } } ``` ``` -------------------------------- ### Install Ansible Requirements for NetExec Lab Source: https://github.com/badsectorlabs/ludus/blob/main/docs/docs/environment-guides/netexec-workshop-lehack-2024.md Install Ansible and pywinrm using pip. Clone the NetExec-Lab repository and navigate to the ansible directory. Finally, install the Ansible requirements from the requirements.yml file. ```shell # You can use a virtualenv here if you would like python3 -m pip install ansible-core python3 -m pip install pywinrm git clone https://github.com/Pennyw0rth/NetExec-Lab cd LeHack-2024/ansible ansible-galaxy install -r requirements.yml ``` -------------------------------- ### Install Ansible Core Source: https://github.com/badsectorlabs/ludus/blob/main/docs/docs/environment-guides/shadow-steps.md Installs the `ansible-core` Python package. This is required for running Ansible playbooks. ```bash python3 -m pip install ansible-core ``` -------------------------------- ### Deploy and Run SSF Server Source: https://github.com/badsectorlabs/ludus/blob/main/docs/docs/environment-guides/pivot-lab.md Commands to copy the SSF server executable and configuration to a remote machine and start the server. Assumes SSF is already compiled. ```bash cd tools/ssf/ssf-linux-x86_64-3.0.0 scp ssfd config.json root@lamp: ssh root@lamp ./ssfd --gateway-ports ``` -------------------------------- ### Create New Course Group and Set Quotas Source: https://github.com/badsectorlabs/ludus/blob/main/docs/docs/enterprise/quotas.md Demonstrates creating a new group for a course, setting its default quotas, and adding users to it. Users automatically inherit these limits. ```shell ludus groups create fall-2026-cs450 --description "CS450 Fall 2026" ``` ```shell ludus quotas group set -g fall-2026-cs450 --ram 32 --cpu 8 --vms 5 --ranges 2 ``` ```shell ludus groups add user student1,student2,student3 fall-2026-cs450 ``` -------------------------------- ### Install ludus_ad_groups Role Source: https://github.com/badsectorlabs/ludus/blob/main/docs/docs/enterprise/subscription-roles/ad-groups.md Installs the ludus_ad_groups Ansible role. This command should be run on a domain controller. ```bash ludus ansible subscription-roles install -n ludus_ad_groups ``` -------------------------------- ### Example DCO Sign-off Source: https://github.com/badsectorlabs/ludus/blob/main/docs/docs/developers/contributing.md An example of how to format the sign-off line in a commit message to comply with the DCO. ```text Signed-off-by: Erik [Bad Sector Labs] <555113-badsectorlabs@users.noreply.gitlab.com> ``` -------------------------------- ### Prepare SSF Source: https://github.com/badsectorlabs/ludus/blob/main/docs/docs/environment-guides/pivot-lab.md Navigates to the SSF directory for the specified Linux architecture. ```bash cd tools/ssf/ssf-linux-x86_64-3.0.0 ``` -------------------------------- ### KMS Install Command Usage Source: https://github.com/badsectorlabs/ludus/blob/main/docs/docs/using-ludus/cli.md Provides the command structure for installing a KMS server on the Ludus host. ```bash Usage: ludus kms install ``` -------------------------------- ### List VM Snapshots Source: https://context7.com/badsectorlabs/ludus/llms.txt Display all available snapshots for VMs in a hierarchical view, showing their creation time and whether RAM was included. The 'current' state indicates the live VM. ```bash # List all snapshots in hierarchical view ludus snapshots list ``` ```text VM 104 (win10-client) └── pre-malware 2025-04-12 12:34:56 [includes RAM] └── post-malware 2025-04-12 14:23:45 └── current (You are here!) ``` -------------------------------- ### Install PyWinRM Source: https://github.com/badsectorlabs/ludus/blob/main/docs/docs/environment-guides/shadow-steps.md Installs the `pywinrm` Python package. This library is used for remote Windows management with Ansible. ```bash python3 -m pip install pywinrm ``` -------------------------------- ### Install Ansible Galaxy Requirements Source: https://github.com/badsectorlabs/ludus/blob/main/docs/docs/environment-guides/sans-workshop-active-directory-privilege-escalation-with-empire.md Install the necessary Ansible roles and collections specified in the requirements file. ```bash ansible-galaxy install -r SANS-Workshop-Lab/ansible/requirements.yml ``` -------------------------------- ### Install Ludus on Proxmox Source: https://github.com/badsectorlabs/ludus/blob/main/docs/docs/deployment-options/proxmox.md Use this command to download and execute the all-in-one Ludus installation script for Proxmox. ```shell curl -s https://ludus.cloud/install | bash ``` -------------------------------- ### Set Up Encrypted socat Listener for Proof File Source: https://github.com/badsectorlabs/ludus/blob/main/docs/docs/environment-guides/pivot-lab.md Sets up a socat listener on the attack machine to accept encrypted connections on port 4444 and append received data to the /tmp/PROOF file. Includes a command to kill existing socat processes if needed. ```bash cd tools/socat socat -d -u openssl-listen:4444,reuseaddr,fork,cert=server.pem,cafile=server.crt open:/tmp/PROOF,create,append #if this fails, probably need to kill what else is listening on port 4444 pkill socat ``` -------------------------------- ### Start Testing Mode Source: https://context7.com/badsectorlabs/ludus/llms.txt Initiate testing mode, which automatically creates snapshots of VMs and isolates them by blocking internet access. This is crucial for safe tool testing. ```bash # Enter testing mode - snapshots VMs and blocks internet ludus testing start ``` -------------------------------- ### Manual GRUB Installation Commands for Kali Source: https://github.com/badsectorlabs/ludus/blob/main/docs/docs/troubleshooting/kali.md When encountering a GRUB boot loader error during Kali installation, manually intervene via the Proxmox console. These commands help to fix the dpkg package and allow the GRUB installation to complete. ```bash chroot /target bash echo -e "#!/bin/bash\nexec true" > /sbin/start-stop-daemon chmod +x /sbin/start-stop-daemon ``` ```bash apt reinstall dpkg ``` -------------------------------- ### Set up Chisel SOCKS Server Source: https://github.com/badsectorlabs/ludus/blob/main/docs/docs/environment-guides/pivot-lab.md Starts a Chisel SOCKS server on the remote machine, optionally binding to a specific backend (e.g., a local web server). Ensure the Chisel binary is executable on the server. ```bash ssh root@tom chmod +x ./chisel ssh root@tom ./chisel server --backend http://127.0.0.1:8080 --socks5 --reverse --port 80 & ``` -------------------------------- ### Gost Simple SOCKS Proxy Setup Source: https://github.com/badsectorlabs/ludus/blob/main/docs/docs/environment-guides/pivot-lab.md Sets up a SOCKS proxy server on a remote machine (tom) and then creates a local gost listener that forwards traffic to the remote SOCKS proxy. This allows for chained proxying. ```bash cd tools/gost scp gost root@tom: ssh root@tom "./gost -L=socks://:6121" & lsof -i tcp:9050 ./gost -L=:9050 -F=socks://tom:6121 & lsof -i tcp:9050 ``` -------------------------------- ### Initialize Ansible Environment for NetExec Workshop (macOS) Source: https://github.com/badsectorlabs/ludus/blob/main/docs/docs/environment-guides/netexec-workshop-lehack-2024.md Navigate to the Ansible directory, set environment variables for Ansible commands, the lab name, and disable initializations for fork safety. Make the provisioning script executable before running it. Requires connection to the Ludus wireguard VPN if not on the Ludus host. ```bash cd LeHack-2024/ansible ``` ```bash export ANSIBLE_COMMAND="ansible-playbook -i ../ad/LEHACK/data/inventory -i ../ad/LEHACK/providers/ludus/inventory.yml" ``` ```bash export LAB="LEHACK" ``` ```bash export OBJC_DISABLE_INITIALIZE_FORK_SAFETY=YES ``` ```bash ../scripts/provisionning.sh ``` -------------------------------- ### Initialize Ansible Environment for NetExec Workshop (Linux) Source: https://github.com/badsectorlabs/ludus/blob/main/docs/docs/environment-guides/netexec-workshop-lehack-2024.md Navigate to the Ansible directory, set environment variables for Ansible commands and the lab name, and make the provisioning script executable before running it. Requires connection to the Ludus wireguard VPN if not on the Ludus host. ```bash cd LeHack-2024/ansible ``` ```bash export ANSIBLE_COMMAND="ansible-playbook -i ../ad/LEHACK/data/inventory -i ../ad/LEHACK/providers/ludus/inventory.yml" ``` ```bash export LAB="LEHACK" ``` ```bash chmod +x ../scripts/provisionning.sh ``` ```bash ../scripts/provisionning.sh ``` -------------------------------- ### Install Ansible Galaxy Requirements Source: https://github.com/badsectorlabs/ludus/blob/main/docs/docs/environment-guides/barbhack-ctf-2024.md Install Ansible roles and collections required for the BarbHack lab. Navigate to the Ansible directory first. ```shell #terminal-command-local cd NetExec-Lab/BARBHACK-2024/ansible #terminal-command-local ansible-galaxy install -r requirements.yml ``` -------------------------------- ### Install Node.js and Yarn Source: https://github.com/badsectorlabs/ludus/blob/main/docs/docs/developers/cicd.md Installs Node.js version 21.x and Yarn for managing JavaScript dependencies, typically used for documentation building. ```bash curl -fsSL https://deb.nodesource.com/setup_21.x | bash - && apt-get install -y nodejs npm install --global yarn ``` -------------------------------- ### Example Git Commit Sign-off Source: https://github.com/badsectorlabs/ludus/blob/main/CONTRIBUTING.md An example of how a commit message should include a 'Signed-off-by' line, which is automatically added with `git commit -s`. ```git Signed-off-by: Erik [Bad Sector Labs] <555113-badsectorlabs@users.noreply.gitlab.com> ``` -------------------------------- ### Provision the SANS Workshop Lab (Linux) Source: https://github.com/badsectorlabs/ludus/blob/main/docs/docs/environment-guides/sans-workshop-active-directory-privilege-escalation-with-empire.md Set Ansible command variables, make the provisioning script executable, and run it. Ensure you are connected to the Ludus VPN if not on the Ludus host. ```bash export ANSIBLE_COMMAND="ansible-playbook -i ../ad/SANS/data/inventory -i ../ad/SANS/providers/ludus/inventory.yml" export LAB="SANS" chmod +x ../scripts/provisionning.sh ../scripts/provisionning.sh ``` -------------------------------- ### Create VM Snapshot with Ludus Source: https://github.com/badsectorlabs/ludus/blob/main/docs/docs/environment-guides/goad.md Create a snapshot of the virtual machines using the Ludus command-line tool. Specify the user, the snapshot name ('clean-setup'), and a descriptive message for the snapshot. ```bash ludus --user GOADGOADd126ca snapshot create clean-setup -d "Clean GOAD setup after ansible run" ``` -------------------------------- ### Generate Neo-reGeorg Server and Connect Source: https://github.com/badsectorlabs/ludus/blob/main/docs/docs/environment-guides/pivot-lab.md Generates a Neo-reGeorg server file and uploads it to a remote server. Then, it connects to the remote server to establish a reverse shell. ```bash cd tools/Neo-reGeorg ./neoreg.py generate -k password cat neoreg_servers/tunnel.php | ssh -o StrictHostKeyChecking=no root@lamp 'cat - |sudo tee /var/www/html/tunnel.php' ./neoreg.py -k password -u http://lamp/tunnel.php --php -vvv ```