Preparing the host

Before we start scanning, we need a host to target, so let's quickly create the folder structure and Vagrantfile. To create the structure, run the following commands:

$ mkdir scap scap/group_vars scap/roles
$ touch scap/Vagrantfile scap/production scap/site.yml scap/group_vars/common.yml

The scap/Vagrantfile we created should contain the following code:

# -*- mode: ruby -*-
# vi: set ft=ruby :

API_VERSION = "2"
BOX_NAME = "russmckendrick/centos75"
BOX_IP = "10.20.30.40"
DOMAIN = "nip.io"
PRIVATE_KEY = "~/.ssh/id_rsa"
PUBLIC_KEY = '~/.ssh/id_rsa.pub'

Vagrant.configure(API_VERSION) do |config|
config.vm.box = BOX_NAME
config.vm.network "private_network", ip: BOX_IP
config.vm.host_name = BOX_IP + '.' + DOMAIN
config.vm.synced_folder ".", "/vagrant", disabled: true
config.ssh.insert_key = false
config.ssh.private_key_path = [PRIVATE_KEY, "~/.vagrant.d/insecure_private_key"]
config.vm.provision "file", source: PUBLIC_KEY, destination: "~/.ssh/authorized_keys"

config.vm.provider "virtualbox" do |v|
v.memory = "2024"
v.cpus = "2"
end

config.vm.provider "vmware_fusion" do |v|
v.vmx["memsize"] = "2024"
v.vmx["numvcpus"] = "2"
end

end

This means that the host inventory file, scap/production, should contain the following:

box1 ansible_host=10.20.30.40.nip.io

[scap]
box1

[scap:vars]
ansible_connection=ssh
ansible_user=vagrant
ansible_private_key_file=~/.ssh/id_rsa
host_key_checking=False

We can launch the Vagrant box with one of the following commands:

$ vagrant up
$ vagrant up --provider=vmware_fusion

Now that we have our target host ready, we can perform our initial scan.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.17.154.171