OpenVAS Task Preferences via CLI Help

Hey everyone,

I am in desperate need of some help.

I am working on a project where I am running OpenVAS ( I know I know ) on a Raspberry Pi 3+ remotely.

Because of the hardware limitations I am unable to let the Task be created with default options. I need to reduce max checks to 5 and max hosts to 3. However when I run the following xml using the 'omp -u user -w password -X ’

<create_task>
<name>Test-10-247-93s24</name>
<config id="0e17063e-ef2d-4c12-aa76-53a4e1696f6e">
<target id="30ebc300-1aa8-4708-a3a3-add01b3d6241">
<hosts_ordering>random</hosts_ordering>
<schedule id="b4bb89d5-5a77-4c7d-b8e2-e50f41cd2c2d">
<preferences>
<preference><name>Maximum concurrently executed NVTs per host</name><scanner_name>max_checks</scanner_name><value>5</value></preference>
<preference><name>Maximum concurrently scanned hosts</name><scanner_name>max_hosts</scanner_name><value>3</value></preference>
<preference><name>Network Source Interface</name><scanner_name>source_iface</scanner_name><value></value></preference>
</preferences>
</create_task>'

It does not like the preferences. I exported a Task XML from when I used GSA Web App to create a task as my basis.

Is this even possible? If I build GVM 11 from source for Raspbian Buster will this offer better CLI tools to allow me make task preferences like this possible?

I appreciate your help and your patience. Thanks in advance.

Hi,

with gvm10 I was using the function gmp.create_task from https://github.com/greenbone/gvm-tools with preferences set to in your case {'max_checks':'5','max_hosts':'3'}

Maybe this helps you.

Cheers,
Carl

Yes, that is a huge help. I am going through the nightmare of compiling GVM 11 for Raspberry PI and it seems to be an impossible task.

Is it possible to run GVM-Tools (if I can compile it) with OpenVAS 9.0 on Raspbian Buster? Going to research now.

Well it appears that GVM-tools doesn’t exist for raspberry pi and I am not able to compile it.

gvm-tools is written in Python therefore nothing needs to be compiled. I guess you are mixing it up with gvm-libs.

And yes gvm-tools is compatible with GVM/OpenVAS 9.

2 Likes

:expressionless: YES! You are right. I was mixing it up. I am a silly goose. OK. Well pip didn’t work on raspian Buster. I am sure I can easily place in /opt/ manually or some such. Thank you.

OK. I got it to install on Raspbian Buster with PIP3. This is a good start to trying to set scanner task preferences as shown above… Looking at the docs now (any advice is welcome).

The next step after testing will be to get this deployed to devices in closed environments. My thinking is push out the gvm-tools git folder and use pip at each point to install locally.

I really appreciate the help here. Thanks!

Remove field name from preference.

sudo docker exec -t -u gvm openvas /usr/local/bin/gvm-cli --gmp-username yourusername --gmp-password yourpassword tls --xml "<create_task><name>Scan Suspect Host2</name><target id=\"905da526-9c2d-469d-8368-32e71af075a5\"/><config id=\"ccb449d9-ced7-4ea0-b879-c00574a6c14e\"/><scanner id=\"89df727c-0ec7-44b6-94dd-15a492d5bc2f\"/><preferences><preference><scanner_name>max_hosts</scanner_name><value>10</value></preference><preference><scanner_name>max_checks</scanner_name><value>1</value></preference></preferences></create_task>"

This is the solution for Docker, but it can also be applied to the native installation of gvm-cli.

1 Like