Attack_range: vagrant build not working

Created on 30 Apr 2020  ·  3Comments  ·  Source: splunk/attack_range

Hello,

not a python dev but when vagrant is used the terraform modules are loaded and the code bombs out.... Then I comment out the terraform module import and the vagrant bombs out.

Should the modules not all be in the library and just work?

user@ubuntu1:~/attack_range$ python attack_range.py -m vagrant -a build Traceback (most recent call last): File "attack_range.py", line 7, in <module> from modules.TerraformController import TerraformController File "/home/user/attack_range/modules/TerraformController.py", line 4, in <module> from modules import aws_service, splunk_sdk File "/home/user/attack_range/modules/aws_service.py", line 3, in <module> import boto3 ModuleNotFoundError: No module named 'boto3'

no terraform module import
(venv) user@ubuntu1:~/attack_range$ python attack_range.py -m vagrant -a build Traceback (most recent call last): File "attack_range.py", line 8, in <module> from modules.VagrantController import VagrantController File "/home/user/attack_range/modules/VagrantController.py", line 7, in <module> import ansible_runner ModuleNotFoundError: No module named 'ansible_runner' (venv) 1 user@ubuntu1:~/attack_range$

`

question

All 3 comments

Do you mind retrying to configure vagrant .. looking at the output it seems like either libraries were not installed eg: pip install -r requirements.txt or currently on the wrong virtualenv. But see step 2 on pre-reqs in the doc. If running that still returning No module name errors. Please run which pip and or whereis pip and share the output with us.

dumb me. Maybe update your documentation for noobs; maybe I should write a guide if I get it working later also :)

  1. In Ubuntu the pip could not install psutil from requirements.txt -> failed.
  2. This can be fixed by installing python-dev = sudo apt-get install python3.6-dev
  3. I earlier manually installed psutil but not in the virtualenv enviroment
  4. I also executed the attack range script outside the venv virtualenv enviroment

@julianwieg updated the wiki to include your guide, thank you so much for that!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jzsplunk picture jzsplunk  ·  5Comments

vjpixel picture vjpixel  ·  4Comments

VincentCasse picture VincentCasse  ·  6Comments

svanschalkwyk picture svanschalkwyk  ·  6Comments

crouthamela picture crouthamela  ·  4Comments