.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.29) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is turned on, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{ . if \nF \{ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "Net::Nessus::REST 3pm" .TH Net::Nessus::REST 3pm "2016-04-08" "perl v5.22.1" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" Net::Nessus::REST \- REST interface for Nessus 6.0 .SH "DESCRIPTION" .IX Header "DESCRIPTION" This module provides a Perl interface for communication with Nessus scanner using \s-1REST\s0 interface. .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 1 \& use Net::Nessus::REST; \& \& my $nessus = Net::Nessus::REST\->new( \& url => \*(Aqhttps://my.nessus:8834\*(Aq \& ): \& \& $nessus\->create_session( \& username => \*(Aquser\*(Aq, \& password => \*(Aqs3cr3t\*(Aq, \& ); \& \& my $policy_template_id = $nessus\->get_template_id( \& name => \*(Aqbasic\*(Aq, \& type => \*(Aqpolicy\*(Aq \& ); \& \& my $scan = $nessus\->create_scan( \& uuid => $policy_template_id, \& settings => { \& text_targets => \*(Aq127.0.0.1\*(Aq, \& name => \*(Aqlocalhost scan\*(Aq \& } \& ); \& \& $nessus\->launch_scan(scan_id => $scan\->{id}); \& while ($nessus\->get_scan_status(scan_id => $scan\->{id}) ne \*(Aqcompleted\*(Aq) { \& sleep 10; \& } \& \& my $file_id = $nessus\->export_scan( \& scan_id => $scan\->{id}, \& format => \*(Aqpdf\*(Aq \& ); \& \& while ($nessus\->get_scan_export_status( \& scan_id => $scan\->{id}, \& file_id => $file_id \& ) ne \*(Aqready\*(Aq) { \& sleep 1; \& } \& \& $nessus\->download_scan( \& scan_id => $scan\->{id}, \& file_id => $file_id, \& filename => \*(Aqlocalhost.pdf\*(Aq \& ); .Ve .SH "CLASS METHODS" .IX Header "CLASS METHODS" .ie n .SS "Net::Nessus::REST\->new(url => $url, [ssl_opts => $opts, timeout => $timeout])" .el .SS "Net::Nessus::REST\->new(url => \f(CW$url\fP, [ssl_opts => \f(CW$opts\fP, timeout => \f(CW$timeout\fP])" .IX Subsection "Net::Nessus::REST->new(url => $url, [ssl_opts => $opts, timeout => $timeout])" Creates a new Net::Nessus::Rest instance. .SH "INSTANCE METHODS" .IX Header "INSTANCE METHODS" .ie n .SS "$nessus\->create_session(username => $username, password => $password)" .el .SS "\f(CW$nessus\fP\->create_session(username => \f(CW$username\fP, password => \f(CW$password\fP)" .IX Subsection "$nessus->create_session(username => $username, password => $password)" Creates a new session token for the given user. .PP See for details. .ie n .SS "$nessus\->\fIdestroy_session()\fP" .el .SS "\f(CW$nessus\fP\->\fIdestroy_session()\fP" .IX Subsection "$nessus->destroy_session()" Logs the current user out and destroys the session. .PP See for details. .ie n .SS "$nessus\->\fIlist_policies()\fP" .el .SS "\f(CW$nessus\fP\->\fIlist_policies()\fP" .IX Subsection "$nessus->list_policies()" Returns the policy list. .PP See for details. .ie n .SS "$nessus\->get_policy_id(name => $name)" .el .SS "\f(CW$nessus\fP\->get_policy_id(name => \f(CW$name\fP)" .IX Subsection "$nessus->get_policy_id(name => $name)" Returns the identifier for the policy with given name. .ie n .SS "$nessus\->get_policy_details(id => $policy_id)" .el .SS "\f(CW$nessus\fP\->get_policy_details(id => \f(CW$policy_id\fP)" .IX Subsection "$nessus->get_policy_details(id => $policy_id)" Returns a reference to a hash with all settings and parameters for a given scan policy. .PP See for details. .ie n .SS "$nessus\->import_policy(file => $file_id)" .el .SS "\f(CW$nessus\fP\->import_policy(file => \f(CW$file_id\fP)" .IX Subsection "$nessus->import_policy(file => $file_id)" Returns reference to hash with name and identifier of the policy imported. \&\s-1NB\s0 \f(CW$file_id\fR must be a valid identifier to a file uploaded to the Nessus server, e.g. with method \fIfile_upload()\fR .PP Example: \&\f(CW$result\fR = \f(CW$nessus\fR\->import_policy(file => \f(CW$fileuploaded\fR); print \*(L"Policy imported: \*(R" . \f(CW$result\fR\->{'name'} . \*(L"\en\*(R"; .PP See for details. .ie n .SS "$nessus\->delete_policy(id => $policy_id)" .el .SS "\f(CW$nessus\fP\->delete_policy(id => \f(CW$policy_id\fP)" .IX Subsection "$nessus->delete_policy(id => $policy_id)" Deletes a given scan policy off the Nessus server .PP See for details. .ie n .SS "$nessus\->configure_policy(id => $policy_id, uuid => $uuid, settings => $settings)" .el .SS "\f(CW$nessus\fP\->configure_policy(id => \f(CW$policy_id\fP, uuid => \f(CW$uuid\fP, settings => \f(CW$settings\fP)" .IX Subsection "$nessus->configure_policy(id => $policy_id, uuid => $uuid, settings => $settings)" See for details. .ie n .SS "$nessus\->create_policy(uuid => $uuid, settings => $settings)" .el .SS "\f(CW$nessus\fP\->create_policy(uuid => \f(CW$uuid\fP, settings => \f(CW$settings\fP)" .IX Subsection "$nessus->create_policy(uuid => $uuid, settings => $settings)" See for details. .ie n .SS "$nessus\->\fIlist_scanners()\fP" .el .SS "\f(CW$nessus\fP\->\fIlist_scanners()\fP" .IX Subsection "$nessus->list_scanners()" Returns the scanner list. .PP See for details. .ie n .SS "$nessus\->\fIlist_folders()\fP" .el .SS "\f(CW$nessus\fP\->\fIlist_folders()\fP" .IX Subsection "$nessus->list_folders()" Returns the current user's scan folders. .PP See for details. .ie n .SS "$nessus\->get_folder_id(name => $name)" .el .SS "\f(CW$nessus\fP\->get_folder_id(name => \f(CW$name\fP)" .IX Subsection "$nessus->get_folder_id(name => $name)" Returns the identifier for the folder with given name. .ie n .SS "$nessus\->create_scan(uuid => $uuid, settings => $settings)" .el .SS "\f(CW$nessus\fP\->create_scan(uuid => \f(CW$uuid\fP, settings => \f(CW$settings\fP)" .IX Subsection "$nessus->create_scan(uuid => $uuid, settings => $settings)" Creates a scan .PP See for details. .ie n .SS "$nessus\->configure_scan(scan_id => $scan_id, uuid => $uuid, settings => $settings)" .el .SS "\f(CW$nessus\fP\->configure_scan(scan_id => \f(CW$scan_id\fP, uuid => \f(CW$uuid\fP, settings => \f(CW$settings\fP)" .IX Subsection "$nessus->configure_scan(scan_id => $scan_id, uuid => $uuid, settings => $settings)" Changes the schedule or policy parameters of a scan. .PP See for details. .ie n .SS "$nessus\->delete_scan(scan_id => $scan_id)" .el .SS "\f(CW$nessus\fP\->delete_scan(scan_id => \f(CW$scan_id\fP)" .IX Subsection "$nessus->delete_scan(scan_id => $scan_id)" Deletes a scan. .PP See for details. .ie n .SS "$nessus\->delete_scan_history(scan_id => $scan_id, history_id => $history_id)" .el .SS "\f(CW$nessus\fP\->delete_scan_history(scan_id => \f(CW$scan_id\fP, history_id => \f(CW$history_id\fP)" .IX Subsection "$nessus->delete_scan_history(scan_id => $scan_id, history_id => $history_id)" Deletes historical results from a scan. .PP See for details. .ie n .SS "$nessus\->download_scan(scan_id => $scan_id, file_id => $file_id, filename => $filename)" .el .SS "\f(CW$nessus\fP\->download_scan(scan_id => \f(CW$scan_id\fP, file_id => \f(CW$file_id\fP, filename => \f(CW$filename\fP)" .IX Subsection "$nessus->download_scan(scan_id => $scan_id, file_id => $file_id, filename => $filename)" Download an exported scan. Without filename parameter it will return the content of the file. .PP See for details. .ie n .SS "$nessus\->export_scan(scan_id => $scan_id, format => $format)" .el .SS "\f(CW$nessus\fP\->export_scan(scan_id => \f(CW$scan_id\fP, format => \f(CW$format\fP)" .IX Subsection "$nessus->export_scan(scan_id => $scan_id, format => $format)" Export the given scan. .PP See for details. .ie n .SS "$nessus\->launch_scan(scan_id => $scan_id)" .el .SS "\f(CW$nessus\fP\->launch_scan(scan_id => \f(CW$scan_id\fP)" .IX Subsection "$nessus->launch_scan(scan_id => $scan_id)" Launches a scan. .PP See for details. .ie n .SS "$nessus\->list_scans([folder_id => $id, last_modification_date => $date])" .el .SS "\f(CW$nessus\fP\->list_scans([folder_id => \f(CW$id\fP, last_modification_date => \f(CW$date\fP])" .IX Subsection "$nessus->list_scans([folder_id => $id, last_modification_date => $date])" Returns the scan list. .PP See for details. .ie n .SS "$nessus\->set_scan_read_status(scan_id => $scan_id, status => $status)" .el .SS "\f(CW$nessus\fP\->set_scan_read_status(scan_id => \f(CW$scan_id\fP, status => \f(CW$status\fP)" .IX Subsection "$nessus->set_scan_read_status(scan_id => $scan_id, status => $status)" Changes the status of a scan. .PP See for details. .ie n .SS "$nessus\->get_scan_details(scan_id => $scan_id, [history_id => $history_id])" .el .SS "\f(CW$nessus\fP\->get_scan_details(scan_id => \f(CW$scan_id\fP, [history_id => \f(CW$history_id\fP])" .IX Subsection "$nessus->get_scan_details(scan_id => $scan_id, [history_id => $history_id])" Returns details for the given scan. .PP See for details. .ie n .SS "$nessus\->get_scan_host_details(scan_id => $scan_id, host_id => $host_id, [history_id => $history_id])" .el .SS "\f(CW$nessus\fP\->get_scan_host_details(scan_id => \f(CW$scan_id\fP, host_id => \f(CW$host_id\fP, [history_id => \f(CW$history_id\fP])" .IX Subsection "$nessus->get_scan_host_details(scan_id => $scan_id, host_id => $host_id, [history_id => $history_id])" Returns details for the given host. .PP See for details. .ie n .SS "$nessus\->get_scan_export_status(scan_id => $scan_id, file_id => $file_id)" .el .SS "\f(CW$nessus\fP\->get_scan_export_status(scan_id => \f(CW$scan_id\fP, file_id => \f(CW$file_id\fP)" .IX Subsection "$nessus->get_scan_export_status(scan_id => $scan_id, file_id => $file_id)" Check the file status of an exported scan. .PP See for details. .ie n .SS "$nessus\->get_scan_plugin_output(scan_id => $scan_id, host_id => $host_id, plugin_id => $plugin_id, [history_id => $history_id])" .el .SS "\f(CW$nessus\fP\->get_scan_plugin_output(scan_id => \f(CW$scan_id\fP, host_id => \f(CW$host_id\fP, plugin_id => \f(CW$plugin_id\fP, [history_id => \f(CW$history_id\fP])" .IX Subsection "$nessus->get_scan_plugin_output(scan_id => $scan_id, host_id => $host_id, plugin_id => $plugin_id, [history_id => $history_id])" Returns the output for a given plugin. .PP See for details. .ie n .SS "$nessus\->get_scan_id(name => $name)" .el .SS "\f(CW$nessus\fP\->get_scan_id(name => \f(CW$name\fP)" .IX Subsection "$nessus->get_scan_id(name => $name)" Returns the identifier for the scan with given name. .ie n .SS "$nessus\->get_scan_status(scan_id => $scan_id)" .el .SS "\f(CW$nessus\fP\->get_scan_status(scan_id => \f(CW$scan_id\fP)" .IX Subsection "$nessus->get_scan_status(scan_id => $scan_id)" Returns the status for given scan. .ie n .SS "$nessus\->get_scan_history_id(scan_id => $scan_id, scan_uuid => $scan_uuid)" .el .SS "\f(CW$nessus\fP\->get_scan_history_id(scan_id => \f(CW$scan_id\fP, scan_uuid => \f(CW$scan_uuid\fP)" .IX Subsection "$nessus->get_scan_history_id(scan_id => $scan_id, scan_uuid => $scan_uuid)" Returns the identifier for the historical results for given scan and run. .ie n .SS "$nessus\->list_templates(type => $type)" .el .SS "\f(CW$nessus\fP\->list_templates(type => \f(CW$type\fP)" .IX Subsection "$nessus->list_templates(type => $type)" Returns the template list. .PP See for details. .ie n .SS "$nessus\->get_template_id(type => $type, name => $name)" .el .SS "\f(CW$nessus\fP\->get_template_id(type => \f(CW$type\fP, name => \f(CW$name\fP)" .IX Subsection "$nessus->get_template_id(type => $type, name => $name)" Returns the identifier for template with given name. .ie n .SS "$nessus\->get_plugin_details( id => $plugin_id )" .el .SS "\f(CW$nessus\fP\->get_plugin_details( id => \f(CW$plugin_id\fP )" .IX Subsection "$nessus->get_plugin_details( id => $plugin_id )" returns the details of a plugin .PP See for details. .ie n .SS "$nessus\->list_plugin_families( )" .el .SS "\f(CW$nessus\fP\->list_plugin_families( )" .IX Subsection "$nessus->list_plugin_families( )" returns a list of plugin families .PP See for details. .ie n .SS "$nessus\->get_plugin_family_details( id => $family_id )" .el .SS "\f(CW$nessus\fP\->get_plugin_family_details( id => \f(CW$family_id\fP )" .IX Subsection "$nessus->get_plugin_family_details( id => $family_id )" returns the details about a plugin family .PP See for details. .ie n .SS "$nessus\->get_scanner_id( name => $name )" .el .SS "\f(CW$nessus\fP\->get_scanner_id( name => \f(CW$name\fP )" .IX Subsection "$nessus->get_scanner_id( name => $name )" returns the identifier for the scanner with given name. .ie n .SS "$nessus\->file_upload(file => $file)" .el .SS "\f(CW$nessus\fP\->file_upload(file => \f(CW$file\fP)" .IX Subsection "$nessus->file_upload(file => $file)" Uploads a file to the Nessus server. Returns a reference to hash with identifier to the uploaded file. .PP Example: my \f(CW$result\fR = \f(CW$nessus\fR\->file_upload(file => \f(CW$file\fR); my \f(CW$fileuploaded\fR = \f(CW$result\fR\->{'fileuploaded'}; .PP See for details. .ie n .SS "$nessus\->stop_scan(scan_id => $scan_id )" .el .SS "\f(CW$nessus\fP\->stop_scan(scan_id => \f(CW$scan_id\fP )" .IX Subsection "$nessus->stop_scan(scan_id => $scan_id )" Returns details for the given scan. .PP See for details. .SH "LICENSE" .IX Header "LICENSE" This program is free software: you can redistribute it and/or modify it under the terms of the \s-1GNU\s0 General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. .PP This program is distributed in the hope that it will be useful, but \s-1WITHOUT ANY WARRANTY\s0; without even the implied warranty of \&\s-1MERCHANTABILITY\s0 or \s-1FITNESS FOR A PARTICULAR PURPOSE. \s0 See the \&\s-1GNU\s0 General Public License for more details. .PP You should have received a copy of the \s-1GNU\s0 General Public License along with this program. If not, see .