Creating Scan config based on Severity

I was working on some project,

Any idea on how can we scan in GVM based on the below marks:

  1. what if I want to scan host based on severity only, like critical and high only.
  2. How to speed up the scan, already removed extra NVT’s
  3. How to select only specific cve to be scanned on host.

Would be appreciable if someone could reply with best possible solution, as I don’t see anything related to this forum!

Here are some ways to accomplish this although there may be other methods to accomplish your goals with automation if you are a Python programmer and use python-gvm along with gvm-cli, part of the gvm-tools package.

You can create a custom scan configuration by cloning the Full and Fast scan config or the base scan config and then manually selecting the NVTs with the severity range you wish.

If you have already optimized the NVTs, you can select increase the concurrent NVTs setting in the scan task configuration.

Again, you could write a custom script and use python-gvm to automate the process to modify a custom scan configuration, or use the method described in item #1 to limit NVTs to your desired scope.

1 Like

For speed i already tweeked with this concurrent scan

but speed for single ip single port is 6-9 min approx, can we get it down to 1-2 min?

what are the other ways to speed up the process

also, any option to use socks5??

There are so many factors that contribute to scan time. It’s really a combination of the target server(s) response, scanner host system resources, configuration settings, and perhaps other factors. Modification to the openvas.conf configuration file could help speed your scans. You can modify the max_hosts, optimize_test, time_between_request, open_sock_max_attempts and timeout_retry to optimize the scan config, lower the tested port range with port_range, and increase max_sysload to use more CPU power on the scanner host, but this will not account for a slow response from the target.

I can also add that limiting the port_range from the web-interface should reduce the scan time, but I’m not sure it that alone would achieve the increase you are looking for.

My best guess to optimize the scan would be run thin server and interact with openvas-scanner directly via the command line. That way, you can have more control.

For example, you could manually filter the .nasl files (NVTs) by CVSS and run openvas-nasl from the command line as outlined in this post.

1 Like

thanks for this, this might guide me to right path

appreciated!

lastly just wanted to be clear, are there any gvm python library sources
not able to find proper documentation,
found only this: GMP v21.4 - python-gvm

i was trying to create a script to get all cves list and then from that use only high and crit ones, find nvt for those only and create new scan config, inspired from one of the post you posted!!

let me know what can be done would be more helpfull

issues i am facing:
not getting all cves list using get_cves
not able to properly parse xml, due to lack of doc
then nvt’s

Thanks again!

That page should provide everything you need from installation, to building out the base code (importing packages, authentication, all capabilities included in the web-interface), and has the usage for each GMP function and usage for each OSP function.

1 Like

tried all these functions, they are working

but why get_cves is limited to show only 10 cves?

i can use get_cve and pass cve but get_cves shows 10 cve only, how to get list of all cve’s

filter_cves = “severity>9.0&cvss>9.0”
cve = gmp.get_cves(filter_string=filter_cves,details=True)

for element in cve.iter():
    if str(element.tag).__contains__("name") or str(element.tag).__contains__("severity") or str(element.tag).__contains__("creation_time"):
        print(element.tag, element.text)

tried changing creation time, published time, but nothing works

You can use the filter keywords documentation, or watch the Greenbone filters Youtube tutorial to learn the core filter capabilities. You will find that the rows= keyword and others will be helpful.

2 Likes