Windows
Setup the Capsulecorp-pentest on a dedicated Windows lab machine.
Last updated
Setup the Capsulecorp-pentest on a dedicated Windows lab machine.
Last updated
This guide assumes you will be using Hyper-V
. During all of my testing, Hypver-V outperformed VirtualBox and VMware on the Windows system I used to create this guide. If you prefer to use an alternate hypervisor, you do so without the support of this documentation.
Documentation for additional hypervisors will be created in the future
It's best to use a dedicated lab machine as these VMs eat up a lot of resources
In order to get the best experience on a Windows machine, enable the native hypervisor Hyper-V from the Windows Features menu. You may be required to restart your computer
Click on the Windows button and start typing the word "add"
Click on "Add or remove programs"
Click "Programs and Features"
Click Turn Windows features on or off"
Check the box next to "Hyper-V"
Click OK
At the end of the day, Ansible
and Vagrant
just work better from a Linux/UNIX environment. You'll need to install WSL and configure a few environment variables for everything to work as it should.
In this guide I make use of the "Terminal Preview" app from the Microsoft app store. This makes it easier to switch back and forth between a Windows command prompt, PowerShell prompt and an Ubuntu bash prompt.
Open up an administrative command prompt by Ctrl+Shift
clicking on the Terminal Preview app launcher
Run the command: wsl --install
Restart your computer when the command finishes
Enter a username and password to use within your Ubuntu subsystem
Update the package manager with sudo apt update
Upgrade to the latest version of Ubuntu with sudo apt dist-upgrade
Install pip with sudo apt install python3-pip
Install ansible with pip: pip3 install ansible --user
This will install ansible inside your ~/.local/bin
directory. You'll need to modify your ~/.bashrc
file to contain set PATH=~/.local/bin:$PATH
in order to use the ansible
command
Alternatively you can install ansible with apt: sudo apt install ansible
To install Vagrant browse to https://developer.hashicorp.com/vagrant/downloads and select the appropriate Debian package (presumably Amd64). Grab the URL to the download link and use wget to download the .deb
package to a folder within your WSL environment
wget https://releases.hashicorp.com/vagrant/[ver#]/vagrant_[ver#]_x86_64.deb
Install the .dep
package using dpkg -i
Then modify your ~/.bashrc
file to contain the following:
Don't forget to run source ~/.bashrc
and then you should be able to run the vagrant
command within your WSL environment.
A few vagrant plugins are required to launch and provision all of the VMs. If you below vagrant plugin install
commands fail, open up an administrative PowerShell prompt and run the command.
References:
Vagrant plugins:
vagrant plugin install winrm
vagrant plugin install winrm-fs
vagrant plugin install winrm-elevated
Navigate to an appropriate folder within your WSL environment and checkout the repo from Github.
Familiarise yourself with the congents of the Vagrant
file. If you need to make any changes to the VMs such as CPU/Memory changes or pick a different base box then this is the file you'll want to edit.
Vagrantfile
Open up the Hyper-V Manager and click on the Virtual Switch Manager link from the Actions menu.
Create a New virtual network switch and name it Capsulecorp-pentest
. Check the External network radio button and select the appropriate network adapter from the dropdown list.
You'll specify this Virtual Switch each time you bring up a VM with vagrant up