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

Replace bogus data with a better message and the vendor. #665

Merged
merged 2 commits into from
Feb 19, 2021
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 @@ -12,6 +12,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
[#653](https://github.com/greenbone/openvas/pull/653)

### Changed
- Replace bogus data with a better message and the vendor. [#665](https://github.com/greenbone/openvas/pull/665)
### Fixed
- Fix issues discovered with clang compiler. [#654](https://github.com/greenbone/openvas/pull/654)
- Fix gcc-9 and gcc-10 warnings. [#655](https://github.com/greenbone/openvas/pull/655)
Expand Down
15 changes: 10 additions & 5 deletions nasl/nasl_misc_funcs.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,10 @@

#include "nasl_misc_funcs.h"

#include "../misc/ftp_funcs.h" /* for ftp_log_in */
#include "../misc/network.h" /* read_stream_connection_min */
#include "../misc/plugutils.h" /* plug_get_host_open_port */
#include "../misc/ftp_funcs.h" /* for ftp_log_in */
#include "../misc/network.h" /* read_stream_connection_min */
#include "../misc/plugutils.h" /* plug_get_host_open_port */
#include "../misc/vendorversion.h" /* for vendor_version_get */
#include "byteorder.h"
#include "exec.h"
#include "nasl_debug.h"
Expand Down Expand Up @@ -243,6 +244,7 @@ nasl_end_denial (lex_ctxt *lexic)
int to = lexic->recv_timeout;
struct script_infos *script_infos = lexic->script_infos;
tree_cell *retc = NULL;
char *bogus_data;

/*
* We must wait the time the DoS does its effect
Expand Down Expand Up @@ -270,13 +272,16 @@ nasl_end_denial (lex_ctxt *lexic)
if (soc > 0)
{
/* Send some data */
#define BOGUS "are you dead ?"
if ((nsend (soc, BOGUS, sizeof (BOGUS) - 1, 0)) >= 0)
bogus_data = g_strdup_printf (
"Network Security Scan by %s in progress", vendor_version_get ());
if ((nsend (soc, bogus_data, strlen (bogus_data), 0)) >= 0)
{
g_free (bogus_data);
retc->x.i_val = 1;
close_stream_connection (soc);
return retc;
}
g_free (bogus_data);
}
}

Expand Down