Skip to content

Latest commit

 

History

History
171 lines (89 loc) · 8 KB

Readme.md

File metadata and controls

171 lines (89 loc) · 8 KB

Nessus setup for Lab Puposes only

This doument discusses in detail on how to set up a nessus scanner using Cent OS 7. There are two paths for setup depending on your level of comfort. The first path is to install using a Minimal ISO install of Cent OS 7. The second path is setting up a using via gnome desktop. The second path is for those that are intimidated by CLI.

Personally I prefer using a minimal based CLI install of Cent OS. Along with being less resource intensive it will lower your threat surface risk. A good question is why Cent OS? I like Cent OS for two reasons.

  1. Longivity of the OS and its strict adherance to stable updates.

  2. Firewall is on by default and the ability to choose a security hardening baseline on install.

Setting up Cent OS7 and Nessus using the minimal install ISO with Hyper-V

  1. To download the minimal install ISO for Cent OS you will need to go to the following website:
  1. Select the minimal install ISO link

  2. In Hyper-V select New >> Virtual Machine

  3. Select Next

  4. Specify the name and location. Click on Next.

  5. Select Generation 1 for the virtual machine (Cent OS 7 does support Generation 2 but for simiplicity choose Gen 1.

  6. Assign 4096 MB memory and uncheck use dynamic memory for this virtual machine. This will ensure the VM does not go over it's allocated memory size.

  7. Choose a hyper-v connection that has internet access and click on next.

    • Refer to the following documentation for creating hyper-v switches with internet connections:
    • (Insert Document Link Here)
  8. Take the default on creating a virtual hard disk and select next.

  9. Navigate to the ISO you saved from step 2 on the installation options screen and select next.

  10. Click on Finish to the summary.

  11. Start up your Cent OS Virtual Machine. Select Install from the bootup menu.

  1. Choose what language you would like to use.

  1. Get into the network and host name settings.

  1. Turn the ethernet card to the "on" position. Click on Done to this screen.

  1. Go into the date and time menu next.

  1. Ensure that NTP is set to the "on" position and select your regional time zone you are on.

  1. Go to the installation destination from selection on the menu.

  1. Make sure automatically configure partitioning is selected and ensure encrypt my data is checkmarked. Its important to encrypt this VM as it will contain vulnerability data about your lab network. Those assets and data should be protected when you have the VM in a powered off mode to save on memory and cpu resources.

  1. Create a secure disk encryption passphrase. If you need help with this I would recommend a password manager such as:

  1. At this point you should be able to select "Begin Installation" from the menu

  1. At this screen you will need to create a root password and a user for the Cent OS system.

  1. Once the install is complete click on the reboot button

  1. Login with the user name and password that you did in step 22.

  1. Use the command "su" to get into the root account. Don't worry we will fix this later. As a best security practice you should never do this and disable the root login account geom being used.

  1. Next we are going to install the nano editor because VI really sucks and you will be confused on how to exit :) Issue the command "yum install nano" as shown in the screenshot.

  1. Hit "y" to complete the installation of nano.

  1. Issue the command: nano /etc/sudoers

  1. You should notice in the above file about midway though it the %wheel group to run all commands is not commented out. There is nothing to do in the sudoers file so hit "ctrl x" to exit out of it. This verification is to serve as a check on how to modify this file should the wheel group be commented out.

  2. Issue the following command to add a user to the Wheel group. In this example I add my account "rootsecdev" to the wheel group.

  • At this point issue the command "reboot" to reboot the server. Once rebooted log back into your user account.
  1. Next we are going to edit the passwd file using nano. This is so we can disable the root account from getting logged into. This is equivalent to disabling the local administrative account on a windows machine.

  1. You will notice the root account has access to /bin/bash

  1. Change to root account over to /sbin/nologin

  1. At this point doing a ctrl x to save the file. At this point you should not be able to log directly into the root account.

  2. Next use nano to modify the sshd_config file

  1. uncomment the "permitrootlogin" and set it to no. The screenshot below illustrates this.

  1. Do a ctrl x to save the file. This setting change will not permit root logins over SSH.

  2. This is the last step in configuring the Cent OS server install before we proceed with doing the nessus installation. Update the cent os system by issuing the following command:

sudo yum update

  1. At this point the Cent OS portion of your configuration has been completed.

Gathering Installation files for Nessus

  1. On a host machine with internet access go to the following URL: https://www.tenable.com/downloads/nessus

  2. Select the RPM File for Red Hat 7/Cent OS 7/Oracle Linux 7

  3. On a host maching with internet access go to the following URL: https://winscp.net/eng/index.php

  4. Download WinSCP and install it. SCP will allow you to pass your file to your CentOS server.

Passing Nessus Installation to your CentOS machine

  1. Power off your Cent OS machine by issuing the following command to the device
sudo poweroff
  1. Confirm your machine is on

Setting up Cento OS7 and Nessus using the gnome live CD.