Net::Nessus::REST(3pm) | User Contributed Perl Documentation | Net::Nessus::REST(3pm) |
Net::Nessus::REST - REST interface for Nessus 6.0
This module provides a Perl interface for communication with Nessus scanner using REST interface.
use Net::Nessus::REST; my $nessus = Net::Nessus::REST->new( url => 'https://my.nessus:8834' ): $nessus->create_session( username => 'user', password => 's3cr3t', ); my $policy_template_id = $nessus->get_template_id( name => 'basic', type => 'policy' ); my $scan = $nessus->create_scan( uuid => $policy_template_id, settings => { text_targets => '127.0.0.1', name => 'localhost scan' } ); $nessus->launch_scan(scan_id => $scan->{id}); while ($nessus->get_scan_status(scan_id => $scan->{id}) ne 'completed') { sleep 10; } my $file_id = $nessus->export_scan( scan_id => $scan->{id}, format => 'pdf' ); while ($nessus->get_scan_export_status( scan_id => $scan->{id}, file_id => $file_id ) ne 'ready') { sleep 1; } $nessus->download_scan( scan_id => $scan->{id}, file_id => $file_id, filename => 'localhost.pdf' );
Creates a new Net::Nessus::Rest instance.
Creates a new session token for the given user.
See <https://your.nessus.server:8834/nessus6-api.html#/resources/session/create> for details.
Logs the current user out and destroys the session.
See <https://your.nessus.server:8834/nessus6-api.html#/resources/session/destroy> for details.
Returns the policy list.
See <https://your.nessus.server:8834/nessus6-api.html#/resources/policies/list> for details.
Returns the identifier for the policy with given name.
Returns a reference to a hash with all settings and parameters for a given scan policy.
See <https://your.nessus.server:8834/api#/resources/policies/details> for details.
Returns reference to hash with name and identifier of the policy imported. NB $file_id must be a valid identifier to a file uploaded to the Nessus server, e.g. with method file_upload()
Example: $result = $nessus->import_policy(file => $fileuploaded); print "Policy imported: " . $result->{'name'} . "\n";
See <https://your.nessus.server:8834/api#/resources/policies/import> for details.
Deletes a given scan policy off the Nessus server
See <https://your.nessus.server:8834/api#/resources/policies/delete> for details.
See <https://your.nessus.server:8834/api#/resources/policies/configure> for details.
See <https://your.nessus.server:8834/api#/resources/policies/create> for details.
Returns the scanner list.
See <https://your.nessus.server:8834/nessus6-api.html#/resources/scanners/list> for details.
Returns the current user's scan folders.
See <https://your.nessus.server:8834/nessus6-api.html#/resources/folders/list> for details.
Returns the identifier for the folder with given name.
Creates a scan
See <https://your.nessus.server:8834/nessus6-api.html#/resources/scans/create> for details.
Changes the schedule or policy parameters of a scan.
See <https://your.nessus.server:8834/nessus6-api.html#/resources/scans/configure> for details.
Deletes a scan.
See <https://your.nessus.server:8834/nessus6-api.html#/resources/scans/delete> for details.
Deletes historical results from a scan.
See <https://your.nessus.server:8834/nessus6-api.html#/resources/scans/delete-history> for details.
Download an exported scan. Without filename parameter it will return the content of the file.
See <https://your.nessus.server:8834/nessus6-api.html#/resources/scans/download> for details.
Export the given scan.
See <https://your.nessus.server:8834/nessus6-api.html#/resources/scans/export> for details.
Launches a scan.
See <https://your.nessus.server:8834/nessus6-api.html#/resources/scans/launch> for details.
Returns the scan list.
See <https://your.nessus.server:8834/nessus6-api.html#/resources/scans/list> for details.
Changes the status of a scan.
See <https://your.nessus.server:8834/nessus6-api.html#/resources/scans/read-status> for details.
Returns details for the given scan.
See <https://your.nessus.server:8834/nessus6-api.html#/resources/scans/details> for details.
Returns details for the given host.
See <https://your.nessus.server:8834/nessus6-api.html#/resources/scans/host-details> for details.
Check the file status of an exported scan.
See <https://your.nessus.server:8834/nessus6-api.html#/resources/scans/export-status> for details.
Returns the output for a given plugin.
See <https://your.nessus.server:8834/nessus6-api.html#/resources/scans/plugin-output> for details.
Returns the identifier for the scan with given name.
Returns the status for given scan.
Returns the identifier for the historical results for given scan and run.
Returns the template list.
See <https://your.nessus.server:8834/nessus6-api.html#/resources/editor/list> for details.
Returns the identifier for template with given name.
returns the details of a plugin
See <https://your.nessus.server:8834/nessus6-api.html#/resources/plugins/plugin-details> for details.
returns a list of plugin families
See <https://your.nessus.server:8834/nessus6-api.html#/resources/plugins/families> for details.
returns the details about a plugin family
See <https://your.nessus.server:8834/nessus6-api.html#/resources/plugins/family-details> for details.
returns the identifier for the scanner with given name.
Uploads a file to the Nessus server. Returns a reference to hash with identifier to the uploaded file.
Example: my $result = $nessus->file_upload(file => $file); my $fileuploaded = $result->{'fileuploaded'};
See <https://your.nessus.server:8834/api#/resources/file/upload> for details.
Returns details for the given scan.
See <https://your.nessus.server:8834/nessus6-api.html#/resources/scans/stop> for details.
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
2022-10-13 | perl v5.36.0 |