-
Notifications
You must be signed in to change notification settings - Fork 171
Customizations
Since pentest-env 0.5.0, customizations are stored in $HOME/.pentestrc file as YAML format. An example of configuration file is available at the root of this repository named pentestrc.example
You can copy and edit it for your needs:
cp pentestrc.example ~/.pentestrc
Here is a minimal configuration:
scripts_path: ~/.pentest.d/scripts
targets_path: ~/.pentest.d/targets
targets: []
This setup set your scripts and targets directories used by pentest-env. It also set an empty target list.. if you just want to run a Kali instance..
You can easily deploy targets with your kali instance.
pentest-env comes with some targets ready to use. See the targets page to have a full list of available targets.
You can also add your own targets in your targets_path directory and use them in your targets list.
To setup targets to deploy, add the targets name in the targets array of your $HOME/.pentestrc:
scripts_path: ~/.pentest.d/scripts
targets_path: ~/.pentest.d/targets
targets: [metasploitable primer dvwa]
Now, run vagrant status to see your instances status:
> vagrant status
Current machine states:
kali saved (virtualbox)
metasploitable not created (virtualbox)
primer not created (virtualbox)
dvwa not created (virtualbox)
This environment represents multiple VMs. The VMs are all listed
above with their current state. For more information about a specific
VM, run `vagrant status NAME`.
You can perform many customizations for each pentest-env instances.
Available customizations are:
-
packages- An array of apt packages to install -
commands- List of command to run as inline shell script -
scripts- List of scripts to execute. They must be located in scripts_path directory -
synced_folders- Hash of forlders to sync with the instance
Just add the instance name as a key in your $HOME/.pentestrc, and define each customizations you need
Example for Kali instance and DVWA target:
kali:
packages: [git-core]
commands:
- curl https://opscode-omnibus-packages.s3.amazonaws.com/debian/6/x86_64/chef_12.0.3-1_amd64.deb -o chef.deb && sudo dpkg -i chef.deb
scripts: [openvas.sh]
synced_folders:
data: /pentest-data
dvwa:
packages: [git-core]
chef-solo is used as the provisioner. You need to init git submodules to provision your Kali with provided roles in pentest-chef-repo (See install instruction). If this submodule is missing, kali provisioning will be ignored.
You can add/remove some roles to you Kali linux by editing the provisioning section in Vagrantfile.
For example:
kali.vm.provision :chef_solo do |chef|
...
chef.add_recipe('apt')
chef.add_role('kali-full')
chef.add_role('faraday')
end
See pentest-chef-repo for a detailed list of available roles.