Skip to content
Sliim edited this page Feb 14, 2016 · 7 revisions

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..

Setup targets

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`.

Instance customizations

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
  • chef - Kali only, Customize Chef provisioning (see section below)

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]

Pentest Chef repo

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 in the same way of others customizations by editing your ~/.pentestrc and add the chef key for kali.

For example:

kali:
  chef:
    json:
      nessus:
        installer_file: /vagrant/Nessus-6.5.4-debian6_amd64.deb
    recipes:
      - kali::openvas
      - nessus
      - pentester
    roles:
      - kali-full
      - beef-server
      - faraday

Note that if you want to use additional cookbooks, you will need to add them as dependencies in the Berksfile.

See pentest-chef-repo for a detailed list of available roles.

Clone this wiki locally