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

Send message to the client if the port list is not valid. #453

Merged
merged 1 commit into from
Feb 24, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- Improve signal handling when update vhosts list. [#425](https://github.com/greenbone/openvas/pull/425)
- Wait for all children instead of waiting just for one a time. [#428](https://github.com/greenbone/openvas/pull/428)
- Don't detect MongoDB as a HTTP service. [#447](https://github.com/greenbone/openvas/pull/447)
- Set status finished and send a message if the port list is invalid. [#453](https://github.com/greenbone/openvas/pull/453)

[Unreleased]: https://github.com/greenbone/openvas/compare/openvas-7.0...master

Expand Down
11 changes: 11 additions & 0 deletions src/attack.c
Original file line number Diff line number Diff line change
Expand Up @@ -1074,6 +1074,17 @@ attack_network (struct scan_globals *globals, kb_t *network_kb)
port_range = prefs_get ("port_range");
if (validate_port_range (port_range))
{
kb_t main_kb = NULL;

connect_main_kb (&main_kb);
error_message_to_client2 (
main_kb, "Invalid port list. Ports must be in the range [1-65535]",
NULL);
kb_lnk_reset (main_kb);
g_warning ("Invalid port list. Ports must be in the range [1-65535]. "
"Scan terminated.");
set_scan_status ("finished");

return;
}

Expand Down