Open rylagek opened 2 years ago
Kali Linux has a fully supported packer template for vagrant here We can use builder chaining (#130) to update it to run on vSphere
Using smaller resource req'mt and installing Metasploit and Empire on Ubuntu server 20.04
Metasploit
installs easily with
curl https://raw.githubusercontent.com/rapid7/metasploit-omnibus/master/config/templates/metasploit-framework-wrappers/msfupdate.erb > msfinstall && chmod 755 msfinstall && echo no | ./msfinstall && (echo yes; echo no) | ./msfconsole && db_status
Empire
installs successfully as long as nim
is not used (there is a version mismatch)
git clone --recursive https://github.com/BC-SECURITY/Empire.git && cd Empire && yes "n" | sudo ./setup/install.sh
Note about subiquity
installs: there is currently no supported way to turn off automated unattended upgrades so each build takes about 25 minutes, even before packer
provisioning.
In the future, chained builds will be a necessity to avoid a development bottleneck
Setting static ip is easy with ip a but removing the DHCP setting is not trivial because of netplan
in combination with cloud-init
Looks like the path of least resistance is to set the static ip in the initial cloud-init
cloud-init
in itself requires a separate configuration source to provide custom networking - for minimum product only adding the needed static ip address
cloud-init
resets networking on reboot so adding static ip we want at the end of the build process does not have the lasting effect we need
Band-Aid solution: cron job to run on reboot adding needed static ip
crontab -e
add line @reboot /path/to/script
The above solution is interactive. Adding a file to /etc/cron.d/
is a non-interactive solution but must be written as root:
sudo su && echo "@reboot ip a add x.x.x.x/xx dev ensXXX" >/etc/cron.d/static
That solution was overkill and an issue w/ root vs user TTYs prevented it from being scripted. Active solution is to write a user cron job:
echo "@reboot sudo ip a add x.x.x.x/xx dev ensXXX" | crontab -
Final generic product is an ubuntu 20.04
effects platform with a static ip, Empire, and Metasploit
Effects platform needs route added and folder for scripts
Also need to turn off dhcp init search to improve reboot time
[x] get virtualbox-iso.virtualbox to build
[x] add chained builder for vsphere
[x] prep for specific template changes according to Define DCO lab environment Define DCO lab environment #99