Showing posts with label Walkthrough. Show all posts
Showing posts with label Walkthrough. Show all posts

Friday, 21 July 2023

Running your first Nessus Scan

Running your first Nessus Scan


If you've just installed Nessus Essentials and are now sat wondering what next, to give you a quick idea, we'll do a first scan to show you how it works. If you've not yet installed Nessus but want to, check out my last post on "Installing Nessus Essentials on Kali Linux". Lets get scanning...

Following on from where we left off or from opening Nessus, if you're not on the screen below, click "My Scans" from the left hand menu and then "New Scan" on the top right of the page to bring you to our stating point:

Scan Templates

Click the "Basic Network Scan" button. In the Name field, you can give the scan a name to identify it (useful if you configure a scan that you want to run again in the future), I'll call mine Test, you can give it a description where you can details the reason for the scan or the configuration used but I'm leaving mine blank. The Targets field is where you need to put your IP addresses for the scan, I'm just going to use the loopback address to scan the local machine (you could also create a file of IP addresses and upload that to save typing them all in). I'm not going to go through the rest of the options as they're not required for a quick scan but you can explore them at your own leisure.

Basic scan settings

Click Save. Now you have a Scan saved to My Scans that you can find, run and rerun as required. 

Saved scan

To kick off the scan, click the little Play icon (or the launch button as it's called) to the right (the X will delete the saved scan!) and you'll see the Update icon, the Play button turns to a Pause button and the last scanned field gets updated. Sit back and wait for the scan to complete.

Scan running

Once complete, the update icon turns to a tick. Click on the scan to see the results:

Scan Overview

The top bar shows 3 tabs. Hosts shows the Hosts scanned and an overview of the scan results. The Vulnerabilities tab, well, shows the vulnerabilities. In my case 42 of them (eek). 

Detected vulnerabilities


When you click on the tab, you get the full list and you can click on each to get a detailed view of the vulnerability description with CVE links:

Vulnerability details


You may also get a solution to mitigate the vulnerability (now would be the time to go fix it!):

Vulnerability mitigations

And that's the basic power of Nessus Essentials. This has been a quick tutorial to get a first scan in the bag. There are many more options, settings and scan types that you can run and I'd encourage you to explore. You can find out more info from the Nessus documentation page at Nessus Documentation | Tenable™ or from their community pages at Home (tenable.com) 

I hope you enjoyed this quick walkthrough of running your first scan, thanks for reading.

Rich.


Credits:



Thursday, 20 July 2023

Installing Nessus Essentials on Kali Linux

 

Installing Nessus Essentials on Kali Linux

Nessus is a powerful attack surface vulnerability scanner from Tenable. Download Tenable Nessus Vulnerability Assessment | Tenable®

I've seen a few walkthroughs for Nessus Essentials and this is another one, but when I came to install it, I found that with the updates to Nessus, a lot of the screen shots were out of date so I thought I'd do a more recent walkthrough. I'm installing Nessus on a Kali Linux VM running in VMWare Workstation 17 Player (I'll do another write up for that install). I've now created a YouTube walkthrough which you can follow along with and see the install in a live demo here.

Open Firefox and browse to https://www.tenable.com/downloads/nessus - to download Nessus.

Select Version and OS platform (normally picked up be default) and click the Download button:

Download Options for Nessus

Accept the Licence Agreement to (feel free to read it all at your leisure):

Downloading Nessus


Nessus Download Complete

Once downloaded, open a terminal, sudo su to switch to root (if not already), cd into Downloads folder cd Downloads/ and start typing the following command dpkg -i nessus then hit Tab to auto complete the file path (if it doesn’t auto complete, replace nessus with the full file name) and hit enter:

Nessus install command

Once installed run /bin/systemctl start nessusd.service to start the Nessus service:

Nessus install complete

Then go back to Firefox and browse to https://kali:8834 - You will need to click “Advanced…”, scroll down and then click “Accept the Risk and Continue” as Nessus is using a self signed Certificate that cannot be verified (which is ok as it’s an internal system) to reach the Welcome page:

Welcome to Nessus

Click the Continue button and then select “Register for Nessus Essentials” and continue:

Selecting Nessus Essentials

You will need to enter your details, this will provide a one time activation code (which cannot be used again so I’ve found that some non genuine details will work fine for me here as I already have a working version in my home lab which I registered with my real details. This install will be torn down with the lab I've created just for a specific course), then click Register:

Registering Nessus Essentials

Then click continue on the next screen:


Activation code

Create a user name and password - this will be for you to log into Nessus so make sure you write down or remember these details! Then hit “Submit”:

Create user credentials

Nessus will then download it’s required plugins, this could take a few minutes:

Downloading plugins

After a short wait, Nessus will open and start compiling the plugins:

Compiling plugins

Wait for the plugins to compile, indicated by this spinning update icon. This bit will take many minutes, now’s the time to grab a fresh brew, some lunch, walk the dog … you get the idea. Once it’s gone you’re good to go:

Compiling in progress

Compiling complete

You’re taken to the My Scans page by default where you can explore or run your first scan:

Ready to scan

Click the New Scan button in the top right of the screen and you'll be taken to the Scan Templates page. Here you'll see the extent of what Nessus can deliver. As this is the free version of Nessus, some of the templates won't be available, requiring a paid licence to run. In this free version we can scan up to 16 private IP addresses in one go. 

Scan Templates

For the installation stage, we're now done - congratulations you now have a functioning vulnerability scanner for your lab, home network or small business.

I hope you've enjoyed this walkthrough of Installing Nessus Essentials on Kali Linux, in the next post I'll do a quick walkthrough of "Running your first Nessus Scan". I've not added it here as this post is long enough as it is!

Thanks for reading.

Rich.


Credits:



YouTube Video Link: Installing Nessus on Kali

Monday, 26 June 2023

Greenbone Vulnerability Scanner

Greenbone Vulnerability Scanner

What is Vulnerability Management?

"Vulnerability management is an IT security process that aims to find vulnerabilities in the IT infrastructure, classify their severity and, in addition, provide a list of actions to be taken to address the vulnerabilities. The goal is to eliminate vulnerabilities so that they can no longer pose a risk." - taken from the greenbone.net website.

First steps...

In an effort to play with as many tools as I can I decided to install Greenbone Vulnerability Scanner. It’s a tool that has featured in some of the online training platforms I’ve used like Try Hack Me so it was a good choice to try. I’ve already got a Nessus Essentials scanner but seeing how many different tools work can be useful to see which I prefer and which works best for me. This is a bit of a long one so go grab a brew now then strap in….

I kicked off the research by watching a couple of YouTube video’s and installation looked pretty simple so I went ahead and installed a fresh Kali Purple VM on my ProxMox machine. Probably not the best choice of OS as I found out after a few issues but it was the OS used in the videos and it seemed to work for the presenters. GVM is the package used to install the scanner, manager, portal and all the dependencies required to make it work.

Kali Purple

Sometimes it doesn't always work out...

My first attempt failed miserably. I installed Kali and updated it, installed GVM and ran the setup script. After running the “check-setup” script to make sure everything had gone to plan I tried to connect to the Web Portal from a different computer to find that it wasn’t reachable. So, I went back to the Kali VM and launched Firefox to connect to the portal on the loopback address … but that didn’t work either. I had the right address each time and the port number but nothing would connect. Then, I realised a major mistake I’d made … I didn’t take a snapshot of the VM after installing and updating Kali. I was so rushed to get the tool installed and get playing with it I carried out a cardinal sin! Nothing I tried would resolve the issue and after turning to Google for a bit of research I discovered that Kali is NOT a supported OS to run GVM on and people who’d had the same issue as me didn’t seem to get any other answers than “install it on a supported OS”. Well, I’d seen it work on Kali so being as it’s a VM I hit the big delete button and started again.

If at first you don't succeed...

This time I installed Kali, ran the updates and then took a snapshot, I wasn’t going to waste all that time again! After that, I installed GVM and then went and watched some TV whilst the setup ran. Coming back to the VM I had my login password and was feeling hopeful. I ran the check set up script and all looked good. This time, I fired up Firefox, punched in the Loopback address and port and  … Hey Presto! I’m in! 

Greenbone Security Assistant login page

I’d seen some other issues that people had had with GVM so I tried to execute a quick scan and encountered the same as a lot of the others … a “Failed to find config” error. Luckily, there was a YouTube video to help. The fix suggested was to run the feed update scripts to update the feeds and scan configs then everything magically works. NO it doesn’t – well not for me anyway. Back to Google where I found a forum where this very issues was being discussed (and the obligatory “Kali isn’t a supported OS” message was repeated many times. The fix offered was to run individual feed update scripts (instead of the default bulk one that I had done) and then I read the important bit at the bottom … “WAIT!”. Turns out that updating the feeds pulls down the updates, then GVM needs to import them for things to work properly (which it does as part of the script but in the background). You need to check the ‘Administration/Feed Status’ page and wait for all the entries to turn to current. So, I ran the scripts one by one and watched some more TV. On my return I checked the terminal to make sure all was complete and noticed that this time, the scripts seemed to had pulled down incremental files, which may have been what was needed to complete the update. I checked the Scan Configs and BOOM! There they were, all the Feed updates showed as ‘Current’. 

Feed Updates status

Scan Configs

I was so excited to go run my first scan, I almost forgot ….. SNAPSHOT! Snapshot taken and my very first Greenbone scan was under way. The good news … “0’s” across the board 😊.

1st scan running

Scan complete, looking good!

Next steps for me...

I’m planning to move this ProxMox machine to my IOT network so I can scan all of the lovely speakers and camera’s etc I have to see just how secure they are, and if I spot a few older ones with some nice vulnerabilities … well, they may get replaced with new ones and then the old ones used as targets!

Final thoughts and process...

I wouldn’t say that this was a quick project, although it was all done in a day I was hoping for more like a couple of hours but there again, I did come across issues. So, here’s basically the steps needed to install, setup and update the Greenbone Vulnerability Scanner:

Install / use a Linux VM as the base OS – Greenbone suggested on their forum post from May 2022 that “Debian 11 should be fine” but I can confirm that this works on Kali! (Missing scan configuration - Archive / Greenbone Community Edition - Greenbone Community Forum)

  • On the Linux machine, run “sudo apt update” – to make sure your repos are cleaned up and up to date.
  • Now run  sudo apt install gvm  – this installs the GVM program and any dependencies, but you can’t use it yet!
  • Once the install has completed, run  sudo gvm-setup  – this may take a while, grab a brew.
  • Once the setup has completed a system generated password for the ‘admin’ user account will be shown near the end of the setup output. It’s big! Copy it and paste it into a text file and save it. There are ways to get around it if you don’t but it just makes life easier if you do.
  •  Now run  sudo gvm-check-setup -h  – this should only take a couple of minutes, check the output to see if there was any errors, you should get a line at the bottom to say it looks ok.
  • Once the check is complete, run  sudo gvm-feed-update -h  – this will trigger the feed updates … and may take a while … grab a brew! You can also connect to the portal now at: “hxxps://127.0.0.1:9392”, log in with user name “admin” and your system generated password (you did save it didn’t you???) and navigate to ‘Administration/Feed Updates’ to monitor their progress.
  • Once everything is showing as complete, you can try a quick scan to see if it works. If it does, congratulations, you now have a Greenbone Vulnerability Scanner. If it presents an error message then run these additional steps, one at a time:

o   Run  sudo runuser -u _gvm -- greenbone-nvt-sync  and wait for it to complete

o   Run  sudo runuser -u _gvm -- greenbone-feed-sync --type SCAP  and wait for it to complete

o   Run  sudo runuser -u _gvm -- greenbone-feed-sync --type CERT  and wait for it to complete

o   Run  sudo runuser -u _gvm -- greenbone-feed-sync --type GVMD_DATA  and wait for it to complete

o   Now go to the Feed Updates page on the portal and wait for them all to complete ... maybe time for another brew! Possibly some biscuits? Well, you do have the time!

o   Once they’re all complete try a quick scan. If it still doesn't work after this, my only advice is to leave it running and try again later. After that, revert to an earlier snapshot before you installed GVM and start it again … wait … you did take a snapshot right?

 

Thanks for reading,
Rich.

Credits: 

Vulnerability Management | Open Source and GDPR-compliant - Greenbone

Kali Linux 2023.1 Release (Kali Purple & Python Changes) | Kali Linux Blog

Sunday, 25 June 2023

Private VPN Server Install

Having a Home Lab is great ... at home, but what if you want to access it whilst you're out and about? This was my problem so I set about a bit of research. After comparing a couple of offerings I chose WireGuard VPN as it seemed fast, secure and reliable. Best of all it is free and reasonably simple to set up.

WireGuard VPN


I had a spare Raspberry Pi3 knocking around so I installed Raspbian on a MicroSD card, booted, ran the updates and we were ready to go. As this was a going to be a bit of a test and proof of concept for me, I decided to install WireGuard via PiVPN. Installation is guided, setup is relatively easy and administration is simple. 

  curl -L https://install.pivpn.io | bash  

During the install I did need to go out and set up a Dynamic DNS service through a popular web vendor as my ISP uses dynamic IP addresses, meaning that once I'd set up the VPN and the IP changed, I would not be able to access it again until I reconfigured the config files. Not very useful if you're not at home and can't check your public IP. I checked the setting to enable unattended updates so that I didn't need to keep logging into the Pi to manually update and patch it every week. 

I set up a Test user to trial the VPN, installed the Wireguard client on my phone, generated the QR code from the server on the Pi, scanned it via the client, switched it on and ..... NOTHING.

Creating a Test user


A bit more research and head scratching found that I needed to set port forwarding on my router before I could reach the server. I also found that once this worked, I had to enable IPv4 Forwarding on the Pi so that the VPN would work fully. The Pi also needs a static IP address on the internal network to ensure this works which is mention during the install script.

  sudo sysctl -w net.ipv4.ip_forward=1  

After all that, Hey Presto, a working Point to Site VPN connection from the outside world and I could access all my lab machines and files. To keep things secure, I deleted the test account and set new ones up each for my laptop, phone and tablet.

All in all a very worthwhile and incredibly useful project that's taught me about VPN connections and that although things don't always work straight out of the box, with a little persistence and research you can fix it. The PiVPN (using WireGuard) can be set up on various hardware like Raspberry Pi's or even in a virtual machine - anything that will be left on permanently.



Credit to PiVPN - PIVPN: Simplest way to setup a VPN (no affiliation, just a great product and project)

Popular Posts