Kategorie:Greenbone: Unterschied zwischen den Versionen

Aus Foxwiki
Zeile 6: Zeile 6:


=== gvm ===
=== gvm ===
The Greenbone Vulnerability Manager is a modular security auditing tool, used for testing remote systems for vulnerabilities that should be fixed.
; This package installs all the required packages
It provides scripts to setup, start and stop the GVM services.


This package installs all the required packages. It provides scripts to setup, start and stop the GVM services.


The tool was previously named OpenVAS.


'''Installed size:''' 48 KB
'''Installed size:''' 48 KB

Version vom 4. Februar 2023, 23:43 Uhr

topic kurze Beschreibung

Beschreibung

Der Greenbone Vulnerability Manager ist ein modulares Sicherheits-Audit-Tool, mit dem entfernte Systeme auf zu behebende Schwachstellen getestet werden können.

Installation

gvm

This package installs all the required packages

It provides scripts to setup, start and stop the GVM services.


Installed size: 48 KB

How to install: sudo apt install gvm

gvm-check-setup

root@kali:~# gvm-check-setup -h
gvm-check-setup 22.4.0
  Test completeness and readiness of GVM-22.4.0
Step 1: Checking OpenVAS (Scanner)... 
        OK: OpenVAS Scanner is present in version 22.4.0.
        OK: Notus Scanner is present in version 22.4.1.
        OK: Server CA Certificate is present as /var/lib/gvm/CA/servercert.pem.
Checking permissions of /var/lib/openvas/gnupg/*
        OK: _gvm owns all files in /var/lib/openvas/gnupg
        OK: redis-server is present.
        OK: scanner (db_address setting) is configured properly using the redis-server socket: /var/run/redis-openvas/redis-server.sock
        ERROR: redis-server is not running or not listening on socket: /var/run/redis-openvas/redis-server.sock
        FIX: You should start the redis-server with 'systemctl start redis-server@openvas.service' or configure it to listen on socket: /var/run/redis-openvas/redis-server.sock

 ERROR: Your GVM-22.4.0 installation is not yet complete!

Please follow the instructions marked with FIX above and run this
script again.


gvm-feed-update

root@kali:~# gvm-feed-update -h
[>] Updating GVM feeds
[*] Updating NVT (Network Vulnerability Tests feed from Greenbone Security Feed/Community Feed)

gvm-setup
root@kali:~# gvm-setup -h

[>] Starting PostgreSQL service

[>] Creating GVM's certificate files

[>] Creating PostgreSQL database
[i] User _gvm already exists in PostgreSQL
[i] Database gvmd already exists in PostgreSQL
[i] Role DBA already exists in PostgreSQL

[*] Applying permissions
GRANT ROLE
[i] Extension uuid-ossp already exists for gvmd database
[i] Extension pgcrypto already exists for gvmd database
[i] Extension pg-gvm already exists for gvmd database
[>] Migrating database
[>] Checking for GVM admin user
[*] Configure Feed Import Owner
[>] Updating GVM feeds
[*] Updating NVT (Network Vulnerability Tests feed from Greenbone Security Feed/Community Feed)

gvm-start
root@kali:~# gvm-start --help
[i] GVM services are already running

gvm-stop
root@kali:~# gvm-stop -h
[>] Stopping GVM services
* gsad.service - Greenbone Security Assistant daemon (gsad)
     Loaded: loaded (/lib/systemd/system/gsad.service; disabled; preset: disabled)
     Active: inactive (dead)
       Docs: man:gsad(8)
             https://www.greenbone.net

* gvmd.service - Greenbone Vulnerability Manager daemon (gvmd)
     Loaded: loaded (/lib/systemd/system/gvmd.service; disabled; preset: disabled)
     Active: inactive (dead)
       Docs: man:gvmd(8)

Nov 24 04:58:38 kali systemd[1]: Starting Greenbone Vulnerability Manager daemon (gvmd)...
Nov 24 04:58:38 kali systemd[1]: gvmd.service: Can't open PID file /run/gvmd/gvmd.pid (yet?) after start: Operation not permitted
Nov 24 04:58:38 kali systemd[1]: Started Greenbone Vulnerability Manager daemon (gvmd).
Nov 24 04:58:42 kali systemd[1]: Stopping Greenbone Vulnerability Manager daemon (gvmd)...
Nov 24 04:58:42 kali systemd[1]: gvmd.service: Deactivated successfully.
Nov 24 04:58:42 kali systemd[1]: Stopped Greenbone Vulnerability Manager daemon (gvmd).

* ospd-openvas.service - OSPd Wrapper for the OpenVAS Scanner (ospd-openvas)
     Loaded: loaded (/lib/systemd/system/ospd-openvas.service; disabled; preset: disabled)
     Active: inactive (dead)
       Docs: man:ospd-openvas(8)
             man:openvas(8)

Nov 24 04:58:37 kali systemd[1]: Starting OSPd Wrapper for the OpenVAS Scanner (ospd-openvas)...
Nov 24 04:58:38 kali systemd[1]: Started OSPd Wrapper for the OpenVAS Scanner (ospd-openvas).
Nov 24 04:58:42 kali systemd[1]: Stopping OSPd Wrapper for the OpenVAS Scanner (ospd-openvas)...
Nov 24 04:58:43 kali systemd[1]: ospd-openvas.service: Deactivated successfully.
Nov 24 04:58:43 kali systemd[1]: Stopped OSPd Wrapper for the OpenVAS Scanner (ospd-openvas).

* notus-scanner.service - Notus Scanner
     Loaded: loaded (/lib/systemd/system/notus-scanner.service; disabled; preset: disabled)
     Active: inactive (dead)
       Docs: https://github.com/greenbone/notus-scanner

Nov 24 04:58:38 kali notus-scanner[439849]:     raise AdvisoriesLoadingError(
Nov 24 04:58:38 kali notus-scanner[439849]: notus.scanner.errors.AdvisoriesLoadingError: Can't load advisories. /var/lib/notus/products is not a directory.
Nov 24 04:58:38 kali notus-scanner[439849]: Exception ignored in atexit callback: <function exit_cleanup at 0x7ffff5349870>
Nov 24 04:58:38 kali notus-scanner[439849]: Traceback (most recent call last):
Nov 24 04:58:38 kali notus-scanner[439849]:   File "/usr/lib/python3/dist-packages/notus/scanner/utils.py", line 112, in exit_cleanup
Nov 24 04:58:38 kali notus-scanner[439849]:     sys.exit()
Nov 24 04:58:38 kali notus-scanner[439849]: SystemExit:
Nov 24 04:58:38 kali systemd[1]: notus-scanner.service: Can't open PID file /run/notus-scanner/notus-scanner.pid (yet?) after start: Operation not permitted
Nov 24 04:58:42 kali systemd[1]: notus-scanner.service: Deactivated successfully.
Nov 24 04:58:42 kali systemd[1]: Stopped Notus Scanner.

Anwendungen

Fehlerbehebung

Syntax

Optionen

Parameter

Umgebungsvariablen

Exit-Status

Konfiguration

Dateien

Sicherheit

Dokumentation

RFC

Man-Pages

Info-Pages

Siehe auch

  1. Greenbone Security Manager/TRIAL

Links

Projekt

  1. https://github.com/greenbone

Weblinks

  1. https://greenbone.github.io/docs/latest/22.4/source-build/index.html

Einzelnachweise

Testfragen

Testfrage 1

Antwort1

Testfrage 2

Antwort2

Testfrage 3

Antwort3

Testfrage 4

Antwort4

Testfrage 5

Antwort5

TMP

OpenVAS on Kali Linux

What is OpenVAS?

OpenVAS is an open-source vulnerability scanner. OpenVAS started under the name of GNessUs, a fork of the previously open-source Nessus scanning tool (which costs you money now). OpenVAS is also under the GNU General Public License (GPL).

I personally used this software in many different kinds of assessments and was always satisfied with the results I got (keeping in mind that it is completely free).

Of course, tools like Nessus and NeXpose are more feature-rich, but they come with a high price tag too.

For starters, OpenVAS is simply perfect and gives you a good idea of how a vulnerability scanner works. I also found it very intuitive to work with.

So without further ado, let’s dive right into the installation.

Install

The first thing we want to do is to make sure that our Kali installation is up-to-date. So open a terminal window and run:

sudo apt update && sudo apt upgrade -y

This will update your repository and upgrade your Kali, the -y at the end saves you a press of the button “Y” in the process.

The next thing we want to do is to install OpenVAS. Again in the Terminal type:

sudo apt install openvas

Confirm that you are aware that an additional ~1,2 Gigabyte of Disk Space will be used by pressing Y.

Now this will take a good while.

Once that is done we will run another command in the terminal window:

sudo gvm-setup

Note: In case you run into a PostgreSQL error – check out the troubleshooting section at the end of this article.

This is going to take very long.

"Install OpenVAS on Kali Linux"

Phew… That took about 2 hours for me to finish. I still didn’t get why it takes so long, but just go for a long walk and come back later…

After the setup process is finished, don’t forget to note down your password that was generated at the end, you need it to log in for the first time.

"Install OpenVAS on Kali Linux"

Configuring

The installation is now finished. Next, we verify if our installation is working.

sudo gvm-check-setup

I got an error (SCAP DATA are missing), but if you look through the error message, you can see that you can fix it by running:

sudo runuser -u _gvm -- greenbone-feed-sync --type SCAP

This fixed my issue.

First, we are starting the OpenVAS Service.

sudo gvm-start

"Install OpenVAS on Kali"

Now your OpenVAS Service should be up and running. OpenVAS listens on the Ports: 9390, 9391, 9392, and on Port 80. Your web browser should automatically open and lead to the OpenVAS Login Page.

If not, open a web browser manually and enter the URL

https://127.0.0.1:9392

The first time you want to open this URL you will get a security warning. Click on Advanced and Add an Exception.

"Log in to OpenVAS on Kali"

Remember the password you noted down before? Now we are going to need it.

Forgot your Admin Password?
Reset it by typing: sudo gvmd --user=admin --new-password=passwd;

Log in to OpenVAS with admin // your password

"Install OpenVAS on Kali Linux"

First things first – Navigate to To your User Profile / My Settings / Click on Edit and change the password.

"Change OpenVAS Password"

This is basically all you need to do. OpenVAS is now running and ready for use.

First Scan

Now it’s time to run our first scan.

As this is just the installation part I won’t go into details, but I will show you quickly how to run your first scan. There will be more articles covering OpenVAS and we will continue looking into all of the different options we have and how to process scan results.

So the easiest way is simply to Navigate to Scans / Tasks and click on the little Magic Wand icon and start the Task Wizard.

"Install OpenVAS on Kali Linux"

Now you can enter either a single IP, a whole subnet, a range of IP Addresses, or a domain.

This will start a default-depth scan. Depending on the scale of the Network you want to scan this can take from a few minutes up to several hours or even days if the network is large enough and you choose a deep scan.

This and more will be covered in the next article for OpenVAS, which is coming soon.

Finding Exploits

I created a video a while ago on how to find Exploits using OpenVAS, which basically goes through the whole process of scanning and then finding Exploits for your findings. The video is a bit older but still valid. Give it a watch if you want to learn how to use OpenVAS in-depth.

Troubleshooting

There is a lot that can go wrong during the installation of OpenVAS as some of our readers has pointed out, therefore, we decided to create a little extra section here, covering the most common errors.

PostgreSQL Version Errors v13 and v14

There are multiple possible version errors for PostgreSQL. As our reader Tom has pointed out, the first one is:

[>] Starting PostgreSQL service[-] ERROR: The default PostgreSQL version (13) is not 14 that is required by libgvmd[-] ERROR: Use pg_upgradecluster to update your PostgreSQL cluster

Solution:

Open the postgresql.conf file of version 14 and change the port to 5432:

sudo nano /etc/postgresql/14/main/postgresql.conf

Then open the postgresql.conf file of version 13 and check if the port is the same as in version 14. If it is the same – change it to 5433:

sudo nano /etc/postgresql/13/main/postgresql.conf

Restart the PostgreSQL service:

sudo systemctl restart postgresql

PostgreSQL Version Errors v14 and v15

During my installation, I got the following error affecting v14 and v15 of PostgreSQL:

[>] Starting PostgreSQL service[-] ERROR: The default PostgreSQL version (14) is not 15 that is required by libgvmd[-] ERROR: Use pg_upgradecluster to update your PostgreSQL cluster

Gladly, the solution to this problem was easier than the one above and might as well work for the problem above:

sudo systemcctl stop postgresql@14-main
sudo /usr/bin/pg_dropcluster --stop 14 main

OpenVAS failed to find config

Another common error is the failed to find config ‘long-string-value’ message. There are multiple possible solutions for this issue. The one that worked for me is the following:

sudo runuser -u _gvm – gvmd --get-scanners

Note down the scanner ID.

Then run:

sudo runuser -u _gvm – gvmd --get-users --verbose

This gives you the users, including their IDs. You are probably an admin. To solve the issue, enter:

sudo runuser -u _gvm – gvmd --modify-scanner [scanner id] --value [user id]

OpenVAS on Kali Linux

OpenVAS, an endpoint scanning application and web application used to identify and detect vulnerabilities. It is widely used by companies as part of their risk mitigation solutions to quickly identify gaps in their production and even development servers or applications. This is not a complete solution, but it can help you fix common security vulnerabilities that may not be discovered. 

The condition of Greenbone mode is open (APEVALV) from infected chemistry (GVM) of the quality of the storage and the GitHub area. it is used in the Greenbone Security Manager device and is a comprehensive scan. An engine that runs an advanced and constantly updated Network Vulnerability Test Package (NVT).

Installing

To install Openvas and its dependencies on our Kali Linux system run the following command:

sudo apt update                   
sudo apt upgrade -y
sudo apt dist-upgrade -y
sudo apt install openvas

The next step is to run the installer, which will configure OpenVAS and download various network vulnerability tests (NVT) or signatures. Due to a large number of NVTs (50.000+),  the setting process may take some time and consume a lot of data. In the test setup we used for this tutorial, the complete setup process took 10 minutes, which is not bad.

Run the following command to start the setup process:

gvm-setup

After the configuration process is complete, all the necessary OpenVAS processes will start and the web interface will open automatically. The web interface is running locally on port 9392 and can be accessed through https://localhost:9392. OpenVAS will also set up an admin account and automatically generate a password for this account which is displayed in the last section of the setup output:

Verify the Installation

You can verify your installation with.

gvm-check-setup

Password reset

Did you forget to note down the password? You can change the admin password using the following commands:

gvmd --user=admin --new-password=passwd;

The next step is to accept the self-signed certificate warning and use the automatically generated admin credentials to login on to the web interface:

Starting and stopping

Before starting to install the virtual appliance, the last step I have to consider is to start and stop the OpenVAS service. OpenVAS services consume a lot of unnecessary resources, so it is recommended that you disable these services when you are not using OpenVAS.

Run the following command to start the services:

Sudo gvm-start

To stop the OpenVAS services again, run:

sudo gvm-stop

To create a new user

sudo runuser -u _gvm -- gvmd --create-user=admin2 --new-password=12345

To change the password of the existing user:

sudo runuser -u _gvm -- gvmd --user=admin --new-password=new_password

Configuration for a new target

Begin by navigating to Scans > Tasks and clicking on the purple magic wand icon to begin the basic configuration wizard. After successfully navigating to the wizard, you should see a pop-up window similar to the one shown above. You can set up the initial scan of the local host here to make sure everything is set up correctly.

Scanning may take a while. Please allow OpenVAS enough time to complete the scan. You will then see a new dashboard for monitoring and analyzing your completed and ongoing scans, as shown below.

Schedule the scanning process

Now that we know everything is normal, we can take a closer look at OpenVAS and how it works. Expand the car to scan and> start the task of creating a scan task for the managed computer.

Creating a Task

To create a custom task, navigate to the star icon in the upper right corner of the taskbar and select New task.

After selecting ” New Task” from the drop-down menu, you will see a large pop-up window with many options. We will introduce each option part and its purpose.

For this task, we’ll be specializing only in the Name, Scan Targets, and Scanner Type, and Scan Config. In later tasks, we will be focusing on the opposite choices for additional advanced configuration and implementation/automation.# Name: permits North American country to line the name the scan are going to be referred to as inside OpenVAS

  1. Scan Targets: The targets to scan, can embrace Hosts, Ports, and Credentials. to make a brand new target you may follow another pop-up, this can be lined later during this task.
  2. Scanner: The scanner to use by default will use the OpenVAS design but you’ll be able to set this to any scanner of your selecting within the settings menu.
  3. Scan Config: OpenVAS has seven totally different scan sorts you can choose from and can be used supported however you’re aggressive or what info you wish to gather from your scan.

Scoping a New Target

To scope a new target, navigate to the star icon next to Scan Targets.

Above is that the menu for configuring a replacement target. the 2 main choices you may have to be compelled to assemble are the Name and therefore the Hosts. This procedure is fairly uncomplicated and different options will solely be employed in advanced vulnerability management solutions. These are going to be lined in later tasks.

Now that we’ve got our target scoped we are able to still produce our task and start the scan. When the task is created, you’ll come to the scanning management panel, wherever you’ll track and execute the task. To run the task, navigate to the run icon within the operation.

Assets

It permits visualizing the vulnerability of the parts akin to hosts or in operation systems:  

Additional features

Allow adding common parameters to OpenVAS:

Administration

As the name suggests, you can manage passwords, users, etc.:

OpenVAS Usage Examples

Before trying to do anything with OpenVAS, you must first run the setup script, appropriately named openvas-setup. At the end of the (very long) setup process, the automatically created password will be displayed to you. Save the password somewhere safe.

# openvas-setup
ERROR: Directory for keys (/var/lib/openvas/private/CA) not found!
ERROR: Directory for certificates (/var/lib/openvas/CA) not found!
ERROR: CA key not found in /var/lib/openvas/private/CA/cakey.pem
ERROR: CA certificate not found in /var/lib/openvas/CA/cacert.pem
ERROR: CA certificate failed verification, see /tmp/tmp.YpvirUZgxc/openvas-manage-certs.log for details. Aborting.

ERROR: Your OpenVAS certificate infrastructure did NOT pass validation.
       See messages above for details.
Generated private key in /tmp/tmp.XwwD8IOl5u/cakey.pem.
Generated self signed certificate in /tmp/tmp.XwwD8IOl5u/cacert.pem.
Installed private key to /var/lib/openvas/private/CA/cakey.pem.
Installed certificate to /var/lib/openvas/CA/cacert.pem.
Generated private key in /tmp/tmp.XwwD8IOl5u/serverkey.pem.
Generated certificate request in /tmp/tmp.XwwD8IOl5u/serverrequest.pem.
[...]
znc_detect.nasl
znc_detect.nasl.asc
zone_alarm_local_dos.nasl
zone_alarm_local_dos.nasl.asc
OpenVAS community feed server - http://www.openvas.org/
This service is hosted by Greenbone Networks - http://www.greenbone.net/

All transactions are logged.

If you have any questions, please use the OpenVAS mailing lists
or the OpenVAS IRC chat. See http://www.openvas.org/ for details.

By using this service you agree to our terms and conditions.

Only one sync per time, otherwise the source ip will be blocked.

receiving incremental file list
./
COPYING
          1,493 100%    1.42MB/s    0:00:00 (xfr#1, to-chk=84/86)
COPYING.asc
            181 100%  176.76kB/s    0:00:00 (xfr#2, to-chk=83/86)
nvdcve-2.0-2002.xml

...

sha1sums
          2,002 100%    2.34kB/s    0:00:00 (xfr#33, to-chk=2/36)
timestamp
             13 100%    0.02kB/s    0:00:00 (xfr#34, to-chk=1/36)
timestamp.asc
            181 100%    0.21kB/s    0:00:00 (xfr#35, to-chk=0/36)

sent 719 bytes  received 41,272,464 bytes  398,774.71 bytes/sec
total size is 41,260,051  speedup is 1.00
/usr/sbin/openvasmd
User created with password 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx'.
After the setup completes, you will find two listening TCP ports
9390 and 9392

Port 9392 is likely the one of most interest to you as it is the web interface for OpenVAS. You can open the web interface using your browser of choice.

# ss -lnt4
State      Recv-Q Send-Q Local Address:Port               Peer Address:Port
LISTEN     0      128     127.0.0.1:9390                        *:*
LISTEN     0      128     127.0.0.1:9392                        *:*

# firefox https://127.0.0.1:9392

Despite reminding people to save the default password generated during setup, it still sometimes gets misplaced. Fortunately, the “openvasmd” utility can be used to create and remove users as well as reset their passwords.

root@kali:~# openvasmd --create-user=dookie
User created with password 'yyyyyyyy-yyyy-yyyy-yyyy-yyyyyyyyyy'.
root@kali:~# openvasmd --get-users
admin
dookie
root@kali:~# openvasmd --user=dookie --new-password=s3cr3t
root@kali:~# openvasmd --user=admin --new-password=sup3rs3cr3t

OpenVAS signatures can be updated with the “openvas-feed-update” utility.

root@kali:~# openvas-feed-update
Updating OpenVas Feeds
OpenVAS community feed server - http://www.openvas.org/
This service is hosted by Greenbone Networks - http://www.greenbone.net/

All transactions are logged.

If you have any questions, please use the OpenVAS mailing lists
or the OpenVAS IRC chat. See http://www.openvas.org/ for details.
[...]

Verify the certificates that are configured for OpenVAS.

root@kali:~# openvas-manage-certs -V
OK: Directory for keys (/var/lib/openvas/private/CA) exists.
OK: Directory for certificates (/var/lib/openvas/CA) exists.
OK: CA key found in /var/lib/openvas/private/CA/cakey.pem
OK: CA certificate found in /var/lib/openvas/CA/cacert.pem
OK: CA certificate verified.
OK: Certificate /var/lib/openvas/CA/servercert.pem verified.
OK: Certificate /var/lib/openvas/CA/clientcert.pem verified.

OK: Your OpenVAS certificate infrastructure passed validation.