Net::OpenVAS - Perl extension for OpenVAS Scanner
use Net::OpenVAS qw( -commands ); my $openvas = Net::OpenVAS->new( host => 'localhost:9390', username => 'admin', password => 's3cr3t' ) or die "ERROR: $@"; my $task = $openvas->create_task( name => [ 'Scan created via Net::OpenVAS' ], target => { id => 'a800d5c7-3493-4f73-8401-c42e5f2bfc9c' }, config => { id => 'daba56c8-73ec-11df-a475-002264764cea' } ); if ( $task->is_created ) { my $task_id = $task->result->{id}; say "Created task $task_id"; my $task_start = $openvas->start_task( task_id => $task_id ); say "Task $task_id started (" . $task_start->status_text . ')' if ( $task_start->is_accepted ); } if ( $openvas->error ) { say "ERROR: " . $openvas->error; }
This module provides Perl scripts easy way to interface the OMP (OpenVAS Management Protocol) of OpenVAS.
For more information about the OPM follow the online documentation:
https://docs.greenbone.net/API/OMP/omp.html
Create a new instance of Net::Net::OpenVAS::OMP.
Params:
host : OpenVAS host (and port)
host
username, password : OpenVAS Credentials
username
password
timeout : Request timeout in seconds (default is 60) If a socket open, read or write takes longer than the timeout, an exception is thrown.
timeout
ssl_options : A hashref of SSL_* options to pass through to IO::Socket::SSL.
ssl_options
SSL_*
logger : A logger instance (eg. Log::Log4perl or Log::Any for log the REST request and response messages.
logger
Execute a command to OpenVAS via OMP and return Net::OpenVAS::OMP::Response class instance.
my $task = $openvas->command( 'get_tasks', task_id => '46f15597-b721-403c-96a1-cce439af63a7' );
Return Net::OpenVAS::Error class instance.
Net::OpenVAS::OMP provide a flag (-commands) for import all OpenVAS OMP commands.
-commands
use Net::OpenVAS::OMP; [...] my $version = $openvas->command('get_version'); use Net::OpenVAS::OMP qw( -commands ); [...] my $version = $openvas->get_version;
Available commands:
authenticate : Authenticate with the manager.
authenticate
commands : Run a list of commands.
commands
create_agent : Create an agent.
create_agent
create_config : Create a config.
create_config
create_escalator : Create an escalator.
create_escalator
create_lsc_credential : Create an LSC credential.
create_lsc_credential
create_note : Create a note.
create_note
create_override : Create an override.
create_override
create_report_format : Create a report format.
create_report_format
create_schedule : Create a schedule.
create_schedule
create_slave : Create a slave.
create_slave
create_target : Create a target.
create_target
create_task : Create a task.
create_task
delete_agent : Delete an agent.
delete_agent
delete_config : Delete a config.
delete_config
delete_escalator : Delete an escalator.
delete_escalator
delete_lsc_credential : Delete an LSC credential.
delete_lsc_credential
delete_note : Delete a note.
delete_note
delete_override : Delete an override.
delete_override
delete_report : Delete a report.
delete_report
delete_report_format : Delete a report format.
delete_report_format
delete_schedule : Delete a schedule.
delete_schedule
delete_slave : Delete a slave.
delete_slave
delete_target : Delete a target.
delete_target
delete_task : Delete a task.
delete_task
get_agents : Get all agents.
get_agents
get_configs : Get all configs.
get_configs
get_dependencies : Get dependencies for all available NVTs.
get_dependencies
get_escalators : Get all escalators.
get_escalators
get_lsc_credentials : Get all LSC credentials.
get_lsc_credentials
get_notes : Get all notes.
get_notes
get_nvts : Get all NVTs.
get_nvts
get_nvt_families : Get a list of all NVT families.
get_nvt_families
get_nvt_feed_checksum : Get checksum for entire NVT collection.
get_nvt_feed_checksum
get_overrides : Get all overrides.
get_overrides
get_preferences : Get all preferences.
get_preferences
get_reports : Get all reports.
get_reports
get_report_formats : Get all report formats.
get_report_formats
get_results : Get results.
get_results
get_schedules : Get all schedules.
get_schedules
get_slaves : Get all slaves.
get_slaves
get_system_reports : Get all system reports.
get_system_reports
get_target_locators : Get configured target locators.
get_target_locators
get_targets : Get all targets.
get_targets
get_tasks : Get all tasks.
get_tasks
get_version : Get the OpenVAS Manager Protocol version.
get_version
help : Get the help text.
help
modify_config : Update an existing config.
modify_config
modify_lsc_credential : Modify an existing LSC credential.
modify_lsc_credential
modify_note : Modify an existing note.
modify_note
modify_override : Modify an existing override.
modify_override
modify_report : Modify an existing report.
modify_report
modify_report_format : Update an existing report format.
modify_report_format
modify_task : Modify an existing task.
modify_task
pause_task : Pause a running task.
pause_task
resume_or_start_task : Resume task if stopped, else start task.
resume_or_start_task
resume_paused_task : Resume a paused task.
resume_paused_task
resume_stopped_task : Resume a stopped task.
resume_stopped_task
start_task : Manually start an existing task.
start_task
stop_task : Stop a running task.
stop_task
test_escalator : Run an escalator.
test_escalator
verify_agent : Verify an agent.
verify_agent
verify_report_format : Verify a report format.
verify_report_format
Please report any bugs or feature requests through the issue tracker at https://github.com/giterlizzi/perl-Net-OpenVAS/issues. You will be notified automatically of any progress on your issue.
This is open source software. The code repository is available for public review and contribution under the terms of the license.
https://github.com/giterlizzi/perl-Net-OpenVAS
git clone https://github.com/giterlizzi/perl-Net-OpenVAS.git
Giuseppe Di Terlizzi <gdt@cpan.org>
This software is copyright (c) 2020 by Giuseppe Di Terlizzi.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install Net::OpenVAS, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Net::OpenVAS
CPAN shell
perl -MCPAN -e shell install Net::OpenVAS
For more information on module installation, please visit the detailed CPAN module installation guide.