Open BAMRED opened 6 days ago
ModuleNotFoundError: No module named 'rich' means your python doesn't have rich installed.
can you re-try : pip install -r noansible_requirements.yml
can you verify your python module list ? pip list
and be sure rich is in it ?
Also verify is pip is linked to the same version of your python py version ?
py --version
pip --version
The requirement file already got rich so i don't see anything i could fix. i guess the bug is on your side unless i missed something.
I force upgraded python and pip and they are both on 3.12, re-ran the requirements and ensured rich was installed, this works to allow me to access the console. Progress! I have been trying to follow along with the guide https://orange-cyberdefense.github.io/GOAD/installation/
However, I did end up with this error:
GOAD/virtualbox/local/192.168.56.X > install 1527f5-goad-virtualbox
[+] Current Settings
[*] Current Lab : GOAD
[*] Current Provider : virtualbox
[*] Current Provisioner : local
[*] Current IP range : 192.168.56.X
[*] Extension(s) :
Create lab with theses settings ? (y/N)y
[*] Create instance folder
[*] Create instance providing files
[*] Instance vagrantfile created : \workspace\e408eb-goad-virtualbox\provider\Vagrantfile
[*] Create lab provisioning file inventory_disable_vagrant
[+] Lab inventory file created : \workspace\e408eb-goad-virtualbox\inventory_disable_vagrant
[*] Create instance provisioning files
[+] Instance inventory file created : \workspace\e408eb-goad-virtualbox\inventory
[*] Create instance extensions inventory files
[*] Instance e408eb-goad-virtualbox created
[-] instance provisioner does not exist
┏━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━┳━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━┳━━━━━━━━━━━━┳━━━━━━━━━━━━┓
┃ Instance ID ┃ Lab ┃ Provider ┃ IP Range ┃ Status ┃ Is Default ┃ Extensions ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━╇━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━╇━━━━━━━━━━━━╇━━━━━━━━━━━━┩
│ > e408eb-goad-virtualbox │ GOAD │ virtualbox │ 192.168.56.0/24 │ not provided │ No │ │
└──────────────────────────┴──────┴────────────┴─────────────────┴──────────────┴────────────┴────────────┘
[*] Launch providing
Traceback (most recent call last):
File "D:\GOAD\goad.py", line 477, in <module>
goad.cmdloop()
File "C:\Users\XXXXX\AppData\Local\Programs\Python\Python312\Lib\cmd.py", line 138, in cmdloop
stop = self.onecmd(line)
^^^^^^^^^^^^^^^^^
File "C:\Users\XXXXX\AppData\Local\Programs\Python\Python312\Lib\cmd.py", line 217, in onecmd
return func(arg)
^^^^^^^^^
File "D:\GOAD\goad.py", line 67, in do_install
self.do_create()
File "D:\GOAD\goad.py", line 338, in do_create
self.do_provide()
File "D:\GOAD\goad.py", line 103, in do_provide
result = self.lab_manager.get_current_instance_provider().install()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'install'
It generates the vagrantfile and I can get the VMs up with vagrant up
but I cannot provision them.
GOAD/virtualbox/local/192.168.56.X > load e408eb-goad-virtualbox
[-] instance provisioner does not exist
Line 102-117 for reference
def do_provide(self, arg=''):
result = self.lab_manager.get_current_instance_provider().install()
if result:
self.lab_manager.get_current_instance().set_status(PROVIDED)
# if ip range change after provisioning
if self.lab_manager.get_current_instance_provider().update_ip_range:
Log.info('Update IP range')
new_range = self.lab_manager.get_current_instance_provider().get_ip_range()
if new_range is not None:
Log.info(f'new range : {new_range}')
self.lab_manager.get_current_instance().update_ip_range(new_range)
Log.info(f'reload instance')
# reload instance
instance_id = self.lab_manager.get_current_instance_id()
self.do_load(instance_id)
self.refresh_prompt()
Just to add, I am very impressed with the change to V3, it is clear that you have put a lot of work into this.
Ok i didn't manage the fact that you use the wrong provisioning method, i will change that. The local method is not available on windows because ansible can't be run locally on windows.
Please use the provisionning method vm
with your config :
Like describe in the doc with python on windows : https://orange-cyberdefense.github.io/GOAD/installation/windows/#__tabbed_2_2
py goad.py -m vm
or in goad interactive prompt do set_provisioning_method vm
I wiped all workspaces and set up with VM method for VirtualBox, all 6 VMs start but the following error occurs
[*] Prepare jumpbox if needed
[*] Launch scp D:\GOAD\scripts\setup_local_jumpbox.sh -> vagrant@192.168.56.3:~/setup.sh
[*] CWD: \workspace\ee2b50-goad-virtualbox
[*] Running command : scp -o StrictHostKeyChecking=no -i not found D:\GOAD\scripts\setup_local_jumpbox.sh
vagrant@192.168.56.3:~/setup.sh
scp: stat local "found": No such file or directory
[*] CWD:
[*] Running command : ssh -t -o StrictHostKeyChecking=no -i not found vagrant@192.168.56.3 "cd ~ && sudo apt update &&
sudo apt install -y dos2unix"
Warning: Identity file not not accessible: No such file or directory.
ssh: Could not resolve hostname found: No such host is known.
[*] CWD:
[*] Running command : ssh -t -o StrictHostKeyChecking=no -i not found vagrant@192.168.56.3 "cd ~ && dos2unix setup.sh"
Warning: Identity file not not accessible: No such file or directory.
ssh: Could not resolve hostname found: No such host is known.
[*] CWD:
[*] Running command : ssh -t -o StrictHostKeyChecking=no -i not found vagrant@192.168.56.3 "cd ~ && bash setup.sh"
Warning: Identity file not not accessible: No such file or directory.
ssh: Could not resolve hostname found: No such host is known.
[*] CWD:
[*] Running command : ssh -t -o StrictHostKeyChecking=no -i not found vagrant@192.168.56.3 "cd ~ && mkdir -p
~/GOAD/workspace/ee2b50-goad-virtualbox"
Warning: Identity file not not accessible: No such file or directory.
ssh: Could not resolve hostname found: No such host is known.
[*] Launch scp D:\GOAD\workspace\ee2b50-goad-virtualbox\instance.json ->
vagrant@192.168.56.3:~/GOAD/workspace/ee2b50-goad-virtualbox/instance.json
[*] CWD: \workspace\ee2b50-goad-virtualbox
[*] Running command : scp -o StrictHostKeyChecking=no -i not found
D:\GOAD\workspace\ee2b50-goad-virtualbox\instance.json
vagrant@192.168.56.3:~/GOAD/workspace/ee2b50-goad-virtualbox/instance.json
scp: stat local "found": No such file or directory
[*] CWD:
[*] Running command : ssh -t -o StrictHostKeyChecking=no -i not found vagrant@192.168.56.3 "cd ~ && dos2unix
~/GOAD/workspace/ee2b50-goad-virtualbox/instance.json"
Warning: Identity file not not accessible: No such file or directory.
ssh: Could not resolve hostname found: No such host is known.
[*] Launch scp D:\GOAD\workspace\ee2b50-goad-virtualbox\inventory ->
vagrant@192.168.56.3:~/GOAD/workspace/ee2b50-goad-virtualbox/inventory
[*] CWD: \workspace\ee2b50-goad-virtualbox
[*] Running command : scp -o StrictHostKeyChecking=no -i not found D:\GOAD\workspace\ee2b50-goad-virtualbox\inventory
vagrant@192.168.56.3:~/GOAD/workspace/ee2b50-goad-virtualbox/inventory
scp: stat local "found": No such file or directory
[*] CWD:
[*] Running command : ssh -t -o StrictHostKeyChecking=no -i not found vagrant@192.168.56.3 "cd ~ && dos2unix
~/GOAD/workspace/ee2b50-goad-virtualbox/inventory"
Warning: Identity file not not accessible: No such file or directory.
ssh: Could not resolve hostname found: No such host is known.
[*] Launch scp D:\GOAD\workspace\ee2b50-goad-virtualbox\inventory_disable_vagrant ->
vagrant@192.168.56.3:~/GOAD/workspace/ee2b50-goad-virtualbox/inventory_disable_vagrant
[*] CWD: \workspace\ee2b50-goad-virtualbox
[*] Running command : scp -o StrictHostKeyChecking=no -i not found
D:\GOAD\workspace\ee2b50-goad-virtualbox\inventory_disable_vagrant
vagrant@192.168.56.3:~/GOAD/workspace/ee2b50-goad-virtualbox/inventory_disable_vagrant
scp: stat local "found": No such file or directory
[*] CWD:
[*] Running command : ssh -t -o StrictHostKeyChecking=no -i not found vagrant@192.168.56.3 "cd ~ && dos2unix
~/GOAD/workspace/ee2b50-goad-virtualbox/inventory_disable_vagrant"
Warning: Identity file not not accessible: No such file or directory.
ssh: Could not resolve hostname found: No such host is known.
[*] Launch provisioning
[*] Loading inventory
[+] Lab inventory : D:\GOAD\ad\GOAD\data\inventory file found
[+] Provider inventory : D:\GOAD\workspace\ee2b50-goad-virtualbox\inventory file found
[+] Global inventory : D:\GOAD\globalsettings.ini file found
[*] Loading playbook list
[+] build.yml file found
[+] ad-servers.yml file found
[+] ad-parent_domain.yml file found
[+] ad-child_domain.yml file found
[+] wait5m.yml file found
[+] ad-members.yml file found
[+] ad-trusts.yml file found
[+] ad-data.yml file found
[+] ad-gmsa.yml file found
[+] laps.yml file found
[+] ad-relations.yml file found
[+] adcs.yml file found
[+] ad-acl.yml file found
[+] servers.yml file found
[+] security.yml file found
[+] vulnerabilities.yml file found
[*] Run playbook : build.yml with inventory file(s) : /home/vagrant/GOAD/ad/GOAD/data/inventory,
/home/vagrant/GOAD/workspace/ee2b50-goad-virtualbox/inventory, /home/vagrant/GOAD/globalsettings.ini
[*] Running command : command
[*] CWD:
[*] Running command : ssh -t -o StrictHostKeyChecking=no -i not found vagrant@192.168.56.3 "cd
/home/vagrant/GOAD/ansible/ && /home/vagrant/.local/bin/ansible-playbook -i /home/vagrant/GOAD/ad/GOAD/data/inventory -i
/home/vagrant/GOAD/workspace/ee2b50-goad-virtualbox/inventory -i /home/vagrant/GOAD/globalsettings.ini build.yml"
Warning: Identity file not not accessible: No such file or directory.
ssh: Could not resolve hostname found: No such host is known.
[*] CWD:
[*] Running command : ssh -t -o StrictHostKeyChecking=no -i not found vagrant@192.168.56.3 "cd
/home/vagrant/GOAD/ansible/ && /home/vagrant/.local/bin/ansible-playbook -i /home/vagrant/GOAD/ad/GOAD/data/inventory -i
/home/vagrant/GOAD/workspace/ee2b50-goad-virtualbox/inventory -i /home/vagrant/GOAD/globalsettings.ini build.yml"
Warning: Identity file not not accessible: No such file or directory.
ssh: Could not resolve hostname found: No such host is known.
[*] CWD:
[*] Running command : ssh -t -o StrictHostKeyChecking=no -i not found vagrant@192.168.56.3 "cd
/home/vagrant/GOAD/ansible/ && /home/vagrant/.local/bin/ansible-playbook -i /home/vagrant/GOAD/ad/GOAD/data/inventory -i
/home/vagrant/GOAD/workspace/ee2b50-goad-virtualbox/inventory -i /home/vagrant/GOAD/globalsettings.ini build.yml"
Warning: Identity file not not accessible: No such file or directory.
ssh: Could not resolve hostname found: No such host is known.
[*] CWD:
[*] Running command : ssh -t -o StrictHostKeyChecking=no -i not found vagrant@192.168.56.3 "cd
/home/vagrant/GOAD/ansible/ && /home/vagrant/.local/bin/ansible-playbook -i /home/vagrant/GOAD/ad/GOAD/data/inventory -i
/home/vagrant/GOAD/workspace/ee2b50-goad-virtualbox/inventory -i /home/vagrant/GOAD/globalsettings.ini build.yml"
Warning: Identity file not not accessible: No such file or directory.
ssh: Could not resolve hostname found: No such host is known.
[-] 3 fails abort.
[-] Something wrong during the provisioning task : build.yml
GOAD-DC01 running (virtualbox)
GOAD-DC02 running (virtualbox)
GOAD-DC03 running (virtualbox)
GOAD-SRV02 running (virtualbox)
GOAD-SRV03 running (virtualbox)
PROVISIONING running (VirtualBox)
Hum weird, vagrant should have created a private key in workspace\
may be you can delete the vm provisionning then :
> load <instance_id>
> provide
# here check if the vm PROVISIONING is well up and running
# here check, a file should exist in workspace\<workspaceid>\provider\.vagrant\machines\PROVISIONING\virtualbox\private_key ?
> prepare_jumpbox
> provision_lab
==> PROVISIONING: Checking if box 'bento/ubuntu-22.04' version '202407.23.0' is up to date...
==> PROVISIONING: Machine already provisioned. Run `vagrant provision` or use the `--provision`
==> PROVISIONING: flag to force provisioning. Provisioners marked to run always will still run.
GOAD/virtualbox/vm/192.168.56.X (ee2b50-goad-virtualbox) > prepare_jumpbox
[*] Launch scp D:\GOAD\scripts\setup_local_jumpbox.sh -> vagrant@192.168.56.3:~/setup.sh
[*] CWD: \workspace\ee2b50-goad-virtualbox
[*] Running command : scp -o StrictHostKeyChecking=no -i not found D:\GOAD\scripts\setup_local_jumpbox.sh
vagrant@192.168.56.3:~/setup.sh
scp: stat local "found": No such file or directory
[*] CWD:
[*] Running command : ssh -t -o StrictHostKeyChecking=no -i not found vagrant@192.168.56.3 "cd ~ && sudo apt
update && sudo apt install -y dos2unix"
Warning: Identity file not not accessible: No such file or directory.
ssh: Could not resolve hostname found: No such host is known.
[*] CWD:
[*] Running command : ssh -t -o StrictHostKeyChecking=no -i not found vagrant@192.168.56.3 "cd ~ && dos2unix
setup.sh"
Warning: Identity file not not accessible: No such file or directory.
ssh: Could not resolve hostname found: No such host is known.
[*] CWD:
[*] Running command : ssh -t -o StrictHostKeyChecking=no -i not found vagrant@192.168.56.3 "cd ~ && bash
setup.sh"
Warning: Identity file not not accessible: No such file or directory.
ssh: Could not resolve hostname found: No such host is known.
[*] CWD:
[*] Running command : ssh -t -o StrictHostKeyChecking=no -i not found vagrant@192.168.56.3 "cd ~ && mkdir -p
~/GOAD/workspace/ee2b50-goad-virtualbox"
Warning: Identity file not not accessible: No such file or directory.
ssh: Could not resolve hostname found: No such host is known.
[*] Launch scp D:\GOAD\workspace\ee2b50-goad-virtualbox\instance.json ->
vagrant@192.168.56.3:~/GOAD/workspace/ee2b50-goad-virtualbox/instance.json
[*] CWD: \workspace\ee2b50-goad-virtualbox
[*] Running command : scp -o StrictHostKeyChecking=no -i not found
D:\GOAD\workspace\ee2b50-goad-virtualbox\instance.json
vagrant@192.168.56.3:~/GOAD/workspace/ee2b50-goad-virtualbox/instance.json
scp: stat local "found": No such file or directory
[*] CWD:
[*] Running command : ssh -t -o StrictHostKeyChecking=no -i not found vagrant@192.168.56.3 "cd ~ && dos2unix
~/GOAD/workspace/ee2b50-goad-virtualbox/instance.json"
Warning: Identity file not not accessible: No such file or directory.
ssh: Could not resolve hostname found: No such host is known.
[*] Launch scp D:\GOAD\workspace\ee2b50-goad-virtualbox\inventory ->
vagrant@192.168.56.3:~/GOAD/workspace/ee2b50-goad-virtualbox/inventory
[*] CWD: \workspace\ee2b50-goad-virtualbox
[*] Running command : scp -o StrictHostKeyChecking=no -i not found
D:\GOAD\workspace\ee2b50-goad-virtualbox\inventory
vagrant@192.168.56.3:~/GOAD/workspace/ee2b50-goad-virtualbox/inventory
scp: stat local "found": No such file or directory
[*] CWD:
[*] Running command : ssh -t -o StrictHostKeyChecking=no -i not found vagrant@192.168.56.3 "cd ~ && dos2unix
~/GOAD/workspace/ee2b50-goad-virtualbox/inventory"
Warning: Identity file not not accessible: No such file or directory.
ssh: Could not resolve hostname found: No such host is known.
[*] Launch scp D:\GOAD\workspace\ee2b50-goad-virtualbox\inventory_disable_vagrant ->
vagrant@192.168.56.3:~/GOAD/workspace/ee2b50-goad-virtualbox/inventory_disable_vagrant
[*] CWD: \workspace\ee2b50-goad-virtualbox
[*] Running command : scp -o StrictHostKeyChecking=no -i not found
D:\GOAD\workspace\ee2b50-goad-virtualbox\inventory_disable_vagrant
vagrant@192.168.56.3:~/GOAD/workspace/ee2b50-goad-virtualbox/inventory_disable_vagrant
scp: stat local "found": No such file or directory
[*] CWD:
[*] Running command : ssh -t -o StrictHostKeyChecking=no -i not found vagrant@192.168.56.3 "cd ~ && dos2unix
~/GOAD/workspace/ee2b50-goad-virtualbox/inventory_disable_vagrant"
Warning: Identity file not not accessible: No such file or directory.
ssh: Could not resolve hostname found: No such host is known.
GOAD/virtualbox/vm/192.168.56.X (ee2b50-goad-virtualbox) > provision_lab
[*] Loading inventory
[+] Lab inventory : D:\GOAD\ad\GOAD\data\inventory file found
[+] Provider inventory : D:\GOAD\workspace\ee2b50-goad-virtualbox\inventory file found
[+] Global inventory : D:\GOAD\globalsettings.ini file found
[*] Loading playbook list
[+] build.yml file found
[+] ad-servers.yml file found
[+] ad-parent_domain.yml file found
[+] ad-child_domain.yml file found
[+] wait5m.yml file found
[+] ad-members.yml file found
[+] ad-trusts.yml file found
[+] ad-data.yml file found
[+] ad-gmsa.yml file found
[+] laps.yml file found
[+] ad-relations.yml file found
[+] adcs.yml file found
[+] ad-acl.yml file found
[+] servers.yml file found
[+] security.yml file found
[+] vulnerabilities.yml file found
[*] Run playbook : build.yml with inventory file(s) : /home/vagrant/GOAD/ad/GOAD/data/inventory,
/home/vagrant/GOAD/workspace/ee2b50-goad-virtualbox/inventory, /home/vagrant/GOAD/globalsettings.ini
[*] Running command : command
[*] CWD:
[*] Running command : ssh -t -o StrictHostKeyChecking=no -i not found vagrant@192.168.56.3 "cd
/home/vagrant/GOAD/ansible/ && /home/vagrant/.local/bin/ansible-playbook -i
/home/vagrant/GOAD/ad/GOAD/data/inventory -i /home/vagrant/GOAD/workspace/ee2b50-goad-virtualbox/inventory -i
/home/vagrant/GOAD/globalsettings.ini build.yml"
Warning: Identity file not not accessible: No such file or directory.
ssh: Could not resolve hostname found: No such host is known.
[*] CWD:
[*] Running command : ssh -t -o StrictHostKeyChecking=no -i not found vagrant@192.168.56.3 "cd
/home/vagrant/GOAD/ansible/ && /home/vagrant/.local/bin/ansible-playbook -i
/home/vagrant/GOAD/ad/GOAD/data/inventory -i /home/vagrant/GOAD/workspace/ee2b50-goad-virtualbox/inventory -i
/home/vagrant/GOAD/globalsettings.ini build.yml"
Warning: Identity file not not accessible: No such file or directory.
ssh: Could not resolve hostname found: No such host is known.
[*] CWD:
[*] Running command : ssh -t -o StrictHostKeyChecking=no -i not found vagrant@192.168.56.3 "cd
/home/vagrant/GOAD/ansible/ && /home/vagrant/.local/bin/ansible-playbook -i
/home/vagrant/GOAD/ad/GOAD/data/inventory -i /home/vagrant/GOAD/workspace/ee2b50-goad-virtualbox/inventory -i
/home/vagrant/GOAD/globalsettings.ini build.yml"
Warning: Identity file not not accessible: No such file or directory.
ssh: Could not resolve hostname found: No such host is known.
[*] CWD:
[*] Running command : ssh -t -o StrictHostKeyChecking=no -i not found vagrant@192.168.56.3 "cd
/home/vagrant/GOAD/ansible/ && /home/vagrant/.local/bin/ansible-playbook -i
/home/vagrant/GOAD/ad/GOAD/data/inventory -i /home/vagrant/GOAD/workspace/ee2b50-goad-virtualbox/inventory -i
/home/vagrant/GOAD/globalsettings.ini build.yml"
Warning: Identity file not not accessible: No such file or directory.
ssh: Could not resolve hostname found: No such host is known.
[-] 3 fails abort.
[-] Something wrong during the provisioning task : build.yml
The private key file exists and there is a key generated within the begin and end
PROVISIONING: Importing base box 'bento/ubuntu-22.04'...
==> PROVISIONING: Matching MAC address for NAT networking...
==> PROVISIONING: Checking if box 'bento/ubuntu-22.04' version '202407.23.0' is up to date...
==> PROVISIONING: Setting the name of the VM: PROVISIONING
==> PROVISIONING: Fixed port collision for 22 => 2222. Now on port 2212.
==> PROVISIONING: Clearing any previously set network interfaces...
==> PROVISIONING: Preparing network interfaces based on configuration...
PROVISIONING: Adapter 1: nat
PROVISIONING: Adapter 2: hostonly
==> PROVISIONING: Forwarding ports...
PROVISIONING: 22 (guest) => 2212 (host) (adapter 1)
==> PROVISIONING: Running 'pre-boot' VM customizations...
==> PROVISIONING: Booting VM...
==> PROVISIONING: Waiting for machine to boot. This may take a few minutes...
PROVISIONING: SSH address: 127.0.0.1:2212
PROVISIONING: SSH username: vagrant
PROVISIONING: SSH auth method: private key
PROVISIONING: Warning: Connection reset. Retrying...
PROVISIONING: Warning: Connection aborted. Retrying...
PROVISIONING: Warning: Connection aborted. Retrying...
PROVISIONING: Warning: Connection reset. Retrying...
PROVISIONING: Warning: Connection aborted. Retrying...
PROVISIONING: Warning: Connection reset. Retrying...
PROVISIONING:
PROVISIONING: Vagrant insecure key detected. Vagrant will automatically replace
PROVISIONING: this with a newly generated keypair for better security.
PROVISIONING:
PROVISIONING: Inserting generated public key within guest...
PROVISIONING: Removing insecure key from the guest if it's present...
PROVISIONING: Key inserted! Disconnecting and reconnecting using new SSH key...
==> PROVISIONING: Machine booted and ready!
can you try again and give me the error ?
I keep getting the following error when trying to launch on windows host (I was having issues with ansible on linux and VM on Windows)
goad.py
log.py
config.py
noansible_requirements.yml installed and checked. Python 3.12.4 Plugins installed (vagrant-reload vagrant-vbguest winrm winrm-fs winrm-elevated) visual c++ 2019 updated
For reference, issues running ansible on linux host https://github.com/Orange-Cyberdefense/GOAD/issues/59#issuecomment-2418030542