R3dy / capsulecorp-pentest

Vagrant VirtualBox environment for conducting an internal network penetration test
https://www.manning.com/books/the-art-of-network-penetration-testing?a_aid=royce
815 stars 156 forks source link

provision goku error #61

Closed spaceslums closed 2 years ago

spaceslums commented 2 years ago
$ vagrant provision goku
==> goku: Running provisioner: ansible...
    goku: Running ansible-playbook...
ERROR! couldn't resolve module/action 'win_hostname'. This often indicates a misspelling, missing collection, or incorrect module path.

The error appears to be in '/srv/capsulecorp-pentest/roles/promotedc/tasks/main.yml': line 2, column 5, but may
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:

---
  - name: Change hostname to goku
    ^ here
Ansible failed to complete successfully. Any error output should be
visible above. Please fix these errors and try again.
neto1920 commented 2 years ago

have you a solution?

R3dy commented 2 years ago

should be working with the latest commit, try

vagrant destroy goku
vagrant up goku  (this will eventually error thats fine)
vagrant provision goku
spaceslums commented 2 years ago

@R3dy

vagrant up goku
Bringing machine 'goku' up with 'virtualbox' provider...
==> goku: Importing base box 'StefanScherer/windows_2019'...
==> goku: Matching MAC address for NAT networking...
==> goku: Setting the name of the VM: ccpt_goku
==> goku: Clearing any previously set network interfaces...
There was an error while executing `VBoxManage`, a CLI used by Vagrant
for controlling VirtualBox. The command and stderr is shown below.

Command: ["hostonlyif", "ipconfig", "vboxnet4", "--ip", "192.168.0.1", "--netmask", "255.255.0.0"]

Stderr: VBoxManage: error: Code E_ACCESSDENIED (0x80070005) - Access denied (extended info not available)
VBoxManage: error: Context: "EnableStaticIPConfig(Bstr(pszIp).raw(), Bstr(pszNetmask).raw())" at line 242 of file VBoxManageHostonly.cpp
R3dy commented 2 years ago

it looks like you've modified your Vagrantfile to an IP range outside of VirtualBox's allowed range. At least that's what I'm guessing

see this for more info https://stackoverflow.com/questions/69728426/e-accessdenied-when-creating-a-host-only-interface-on-virtualbox-via-vagrant

If you leave the Vagrantfile the way I have provided it, it should work just fine