OpenVAS CLI commands

I know that omp cli is deprecated already, and changed with gvm-cli

Is there a documentation on the list of commands for gvm-cli?

Thanks

This depends on how you want to use gvm-tools. If you want to use gvm-cli you have to issue xml based GMP commands. The Greenbone Management Protocol documentation can be found at

https://docs.greenbone.net/API/GMP/gmp-7.0.html

If you want to write gmp python scripts you can use the python API provided by python-gvm

https://python-gvm.readthedocs.io/en/latest/

Some example scripts can be found gvm-tools/scripts at main · greenbone/gvm-tools · GitHub

Also take a look at the GMP category description for some more hints

Thanks for the prompt reply.

If I want to create a new user should I still go with omp --username, or is there any other way to use the cli commands?

because it does not work whenever I try them

Thanks

You should NOT use omp anymore. It doesn’t support current versions of GMP!

As I wrote you can issue GMP xml commands via gvm-cli or run scripts via gvm-pyshell using the python API. Alternatively you can create admin users via openvasmd --create-user. This heavily depends on your use cases and personal preferences.

Btw. I assume you are using at least OpenVAS/GVM 9

Yes, I am using the OpenVAS/GVM 9.

I have tried some commands in here,

I get this in return,
[root@test openvas]# gvm-cli socket --xml “<get_version/s>”
bash: gvm-cli: command not found…

Do I have to install something with this before I can use gvm-cli commands?

Thanks

Of course you have to install gvm-tools before you can use them.

1 Like

And please please never run user space commands as root! That’s a bad habit by formerly windows users.

You have to configure openvasmd to listen on a socket with sufficient permissions for the user running gvm-tools.

2 Likes

Just to share a note on this; I agree it’s a bad idea to run user space commands as root, but in case of openvas/gvm this setup is all but simple. This is not documented anywhere, and there is a risk to loose functionalities.

Personally I’ve been trying to do this during the past week and it still doesn’t work. So advocating against root usage would be useful if we had this documented somewhere, or at least, if guidances were given as to how to achieve this.

I’ll continue testing this, and If I can find a solution, I’ll obviously share it here.

Best

I don’t see why gvmd would require to be run as root at all. gsad may use port 80 or 443. Using these ports requires some additional permissions. Either use another http server as proxy or take a look at man capabilities.

It’s not a question of why but a question of how. We all agree it’s best to run those packages as non root users; but once you have said that, if you don’t teach the users how to do it, it’s like screaming in the desert. And I’m not talking about gvmd only, but gvmd + openvassd + gsad + scan operations and make all of this works together without root permissions.

I don’t know how it’s managed in gvm or in the community edition; perhaps this is already setup out of the box; but on linux it just doesn’t work out of the box. And again, the lack of documentation makes it difficult for regular users to set it up.

Dear friends
I read this post because in the past I’m using OMP with openvas 8
and I’m using this tool to create target task and start a scan.
With a new greenbone and GMP it can’t be possibile but new gvm-tools
has got some little differences.
So I wanted to ask for confirmation of what I noticed using the new
gvm-cli.

The XML strings is very similars to the previous version, omp, the new tool gvm-cli have got more commands and the output string has some changes in a string structure.

Have you noticed the same thing too?
Best Regards
Willy

Hi,

GMP is just an evolution of the OMP. Therefore the XML is still very similar. Even the responses.

The omp CLI tool was written in C and got replaced by gvm-tools which is easier to maintain because it is written in Python.

2 Likes

have you got an old guide, pdf or link ?
I need it to read all omp api, command and return code, for making a proxy between omp and gvm
Thanks a lot !
Best Regards
Willy

The Greenbone Management Protocol (GMP) is the successor of the OpenVAS Management Protocol (OMP). The provided API depends on the version of the used management daemon. The current documentation of GMP can be found at our Tech Doc Portal

Without implementing the protocol by yourself in your desired programming language you need to use https://github.com/greenbone/gvm-tools There is no alternative.

1 Like

Dear Bricks,
I need an old guide for openvas-omp xml statement for this reason.

My network use Network Admin Control called packetfence. This software can launch
a scan when host make an access into the network. One of the backends that
packetfence can be use is Greenbone / openvas.

This integration has not been updated from Packetfence developers
and therefore the old “omp” program is used when installing the latest version of PF.

By doing this I will never get a scan because omp use the old port 9390 old protocol
and so on.

Having said that, I can tell you what I am doing.

I have renamed the executable “omp” from the packetfence server , I make a new
omp that reads the data from packetfence as input, in particular the xml ,
format it correctly and then run gvm-cli on the greenbone server.

At this point I have to check the output of gvm-cli and reformat it
in the old mode, omp, then pass the string back to packetfence.

This way packetfence doesn’t notice anything and continues to use
greenbone-openvas in the old way.

clarified this, can you send me some old documentation?

Many thanks
Best Regards
Willy

Hello. If you achieve using openvas with packetfence could you please tell me ? I personally tried to install old openvas versions but without success since a synchronisation with openvas dead servers is required :frowning: .