Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix hosts count when reverse_lookup_only preferences is enabled. #715

Merged
merged 2 commits into from
Apr 27, 2021

Conversation

jjnicola
Copy link
Member

What:
Fix hosts count when reverse_lookup_only preferences is enabled.

Why:
When this option is enabled, hosts without a hostname are removed from the host list, which changes the host count.
As this differs from the host expected by ospd-openvas, finishes the scan as INTERRUPTED.

How:
Run a scan (I tested via gvm-tools) with reverse_lookup_only enabled. Also, I added an excluded host, as this part of the code was modified as well. Ensure that some hosts in the target list can be reversed-lookup'ed.

gvm-cli --protocol OSP --timeout 120 socket --socketpath=/home/jnicola/install/var/run/ospd/openvas.sock --xml "<start_scan scan_id='829097a9-85d5-4bb8-bac0-e64c362b2836'>192.168.0.0/24<exclude_hosts>192.168.0.10</exclude_hosts><finished_hosts/>22testtest<reverse_lookup_only>1</reverse_lookup_only><scanner_params></scanner_params><vt_selection><vt_single id='1.3.6.1.4.1.25623.1.0.14259'/></vt_selection></start_scan>" |xmlstarlet fo

Checklist:

src/attack.c Outdated
g_message ("exclude_hosts: Skipped %d host(s).", ret);
if (ret < 0)
g_message ("exclude_hosts: Error.");
}

if (hosts == NULL)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does not seem useful here. We return nonetheless. Should probably be at the top of the function.
This check might be needed at the top of the other new functions as well?

@ArnoStiefvater ArnoStiefvater merged commit bdb5df6 into greenbone:openvas-20.08 Apr 27, 2021
jjnicola added a commit that referenced this pull request Apr 27, 2021
Fix hosts count when reverse_lookup_only preferences is enabled. (backport #715)
jjnicola added a commit that referenced this pull request Apr 27, 2021
Fix hosts count when reverse_lookup_only preferences is enabled. (backport #715)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants