Skip to content

Pentest environment (kali linux) deployer using vagrant and chef.

License

Notifications You must be signed in to change notification settings

ninobaldo/pentest-env

 
 

Repository files navigation

Pentest Environment Deployment

This tool provide an easy way to deploy a clean pentesting environment with Kali linux using vagrant and virtualbox.

Requirements

I assume you are familiar with virtualbox and vagrant.

Tested with:

  • Virtualbox (4.2.16)
  • Vagrant (1.2.7)

Vagrant plugins

  • vagrant-berkshelf (for targets deployment)

About boxes

Boxes URL

Changes details

Provided boxes are fresh install of Kali linux with some changes:

Kali linux 1.0

  • Installation of linux kernel headers for vbox guest additions.
  • Installation of virtualbox guest additions.
  • Installation of chef package for provisioning.
  • vagrant user was created for provisionning (Password: tnargav).
  • admin group don’t require password for sudo.
  • vagrant user is in admin group.
  • Authorized keys for vagrant user are stored in ssh-keys/ directory (no passphrase).
  • Enabling rpcbind, nfs-common and ssh services at boot.

Kali linux 1.0.4

Fresh install from http://cdimage.kali.org/kali-latest/amd64/kali-linux-1.0.4-amd64-mini.iso

  • Installation of linux kernel headers for vbox guest additions.
  • Installation of virtualbox guest additions.
  • Installation of chef package for provisioning.
  • Authorized keys for root user are stored in ssh-keys/ directory (no passphrase).
  • Enabling rpcbind, nfs-common and ssh services at boot.
  • Modified /etc/issue for vagrant os detection.
  • MAC address for private network was added in /etc/NetworkManager/NetworkManager.conf to disable auto connect.

Please don’t forget to read security warning below !

Installation

Vagrant plugins

vagrant plugin install vagrant-berkshelf

Pentest-env

git clone https://github.com/Sliim/pentest-env.git
cd pentest-env
vagrant up kali

Usage

Running Kali linux 1.0

vagrant up kali

Kali linux customizations

You can perform many customizations when deploying a kali linux instance. Customizations are located in custom/ directory.

Below available customizations:

  • custom/packages

Allow user to set a package list to install in Kali linux. Puts in this file some packages you want to install after kali linux deployed. These packages are installed with debian package manager (apt).

  • custom/synced_folders

Allow user to set a list of directories to sync in Kali linux. Puts in this file your host directories you want to sync with kali linux. File format is simply a ruby Hash, for example, to sync $HOME/.pentest-env into /root/data, custom file look like:

{
  ENV["HOME"] + "/.pentest-env" => "/root/data"
}
  • custom/scripts/

Allow user to execute some scripts after Kali linux deployed. Each files into custom/scripts/ will be executed on the guest with vagrant shell provisionning.

Targets deployment

You can easily deploy targets with your kali instance.

To setup targets, edit custom/targets (create if not exists) and set one target per line you want to deploy.

$ cat custom/targets
gruyere
vicnum

Here two virtual machines will be deployed with a gruyere and a vicnum instance ready to use.

To deploy Kali linux and targets:

vagrant up

Available targets are:

Known issues

Hostonly on kali linux 1.0 fail

Hostonly connection will be reset at first vm creation. To resolve this, disconnect connection in gui mode and run in your vagrant directory:

vagrant reload kali

Security warning

Kali linux 1.0

Virtual machine boot with sshd service running and may cause some security issues:

  • Bridged network is enabled by default.
  • Default root password of this box is insecure (toor).
  • Vagrant user is insecure
    • Private key stored in ssh-keys/.
    • Password known (tnargav).
    • User in sudoers with no password required.

Kali linux 1.0.4

Virtual machine boot with sshd service running and may cause some security issues:

  • Bridged network is enabled by default.
  • Default root password of this box is insecure (toor).

License

See COPYING file

About

Pentest environment (kali linux) deployer using vagrant and chef.

Resources

License

Stars

Watchers

Forks

Packages

No packages published