Skip to content

Instantly share code, notes, and snippets.

@0x646e78
Last active April 12, 2022 08:34
Show Gist options
  • Save 0x646e78/4f4534e2476793a6a438d2acd6f4391e to your computer and use it in GitHub Desktop.
Save 0x646e78/4f4534e2476793a6a438d2acd6f4391e to your computer and use it in GitHub Desktop.
# -*- mode: ruby -*-
# vi: set ft=ruby :
#
# - https://github.com/mitre/caldera
#
#```
#vagrant up
#```
#
#Caldera will be running on http://172.30.1.2:8888 and only available from the current host and between local VMs.
#
#Initial credentials are: `red`:` admin`
#
#Password can be changed in the VM at `/home/vagrant/caldera/conf/local.yaml` which will require a restart of the service:
#
#```
#ps aux | grep server.py
#kill #PID from above
#sudo python3 server.py &
#```
Vagrant.configure("2") do |config|
config.vm.box = "generic/ubuntu2004"
# config.vm.box_check_update = false
# Create a private network, which allows host-only access to the machine
# using a specific IP.
config.vm.network "private_network", ip: "172.30.1.2"
config.vm.provision "shell", inline: <<-SHELL
apt-get update
apt-get install -y python3-pip
snap install go --classic
git clone https://github.com/mitre/caldera.git --recursive --branch 2.8.1
cd caldera
pip3 install -r requirements.txt
chown vagrant:vagrant -R ../
SHELL
config.vm.provision "shell", privileged: false, inline: <<-SHELL
cd caldera
cp -a conf/default.yml conf/local.yml
sed -i 's,0.0.0.0:,172.30.1.2:,g' conf/local.yml #listening IP
sed -i "s,REPLACE_WITH_RANDOM_VALUE,$(openssl rand -base64 32)," conf/local.yml #salt value
python3 server.py -E local &
SHELL
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment