-
Notifications
You must be signed in to change notification settings - Fork 633
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
Add alternative for supporting snmp during scans #594
Conversation
545f56b
to
7a0d56c
Compare
Add snmp support through a spawn process calling snmpget
As we spawn the process asyncronously, we don't know the exit status of the process Therefore we need to check for errors in the output. We assume that if there is no errors, we have an output.
And fix format.
nasl/nasl_snmp.c
Outdated
/* As we spawn the process asyncronously, we don't know the exit | ||
status of the process. Therefore we need to check for errors in | ||
the output. | ||
We assume that if there is no erros, we have an output. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We assume that if there is no erros, we have an output. | |
We assume a valid output if there are no errors. |
#define SNMP_VERSION_2c 1 | ||
|
||
static void | ||
parse_snmp_error (char **result) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Function documentation missing.
} | ||
|
||
static int | ||
check_spwan_output (int fd, char **result) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Function documentation missing.
What:
Add alternative nasl function to perform snmp scan, spawning a new process and using the binary snmpget
** Why **
In case libsnmp is not present, but the binary, still have support for snmp scans
How:
running this nasl script with openvas-nasl against a target with a running snmp agent is a way to test the new functions. To test
the functions, be sure you don't have the libsnmp-dev installed or remove the add_definition of "HAVE_NETSNMP" in nasl/CMakeLists.txt.
openvas-nasl -X -d -D -i <path-to-script> snmp_test.nasl -t <ip-with-running-and_configured-snmp-server>
Checklist: