Net::N...s::REST(3pm)
okay bestie, sit DOWN, because this one is a whole moment π
β¨ This is the manual page for Net::N...s::REST(3pm) β User Contributed Perl Documentation β and it's your backstage pass to the Net::Nessus::REST module, which is literally a REST interface for Nessus 6.0. buckle up, we're going API-ing. π¦π
πΈ NAME πΈ
Net::Nessus::REST β a REST interface for Nessus 6.0. that's the name, that's the whole personality. periodt. π
π« DESCRIPTION π«
This module is your lil Perl bestie that talks to a Nessus scanner over the REST interface. like, it just does that. no notes. π«Ά
β¨ SYNOPSIS β¨
here's the whole glow-up, copy it exactly, don't freestyle it:
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'
);
yes bb, that):after thenewcall is exactly what the page says. we do not fix it, we respect it. π
π CLASS METHODS π
π Net::Nessus::REST->new(url => $url, [ssl_opts => $opts, timeout => $timeout])
Spins up a fresh Net::Nessus::Rest instance. new instance, new me, main character energy fr fr.
π INSTANCE METHODS π
okay this is the long part and yes we're doing ALL of them, no skipping, I'm not letting you skim. π
π $nessus->create_session(username => $username, password => $password)
Mints a brand new session token for whichever user you hand it. your lil hall pass. β¨
See https://your.nessus.server:8834/nessus6-api.html#/resources/session/create for details.
π $nessus->destroy_session()
Logs the current user out and destroys the session. it's giving closing the tab on a toxic ex. π
See https://your.nessus.server:8834/nessus6-api.html#/resources/session/destroy for details.
π $nessus->list_policies()
Gives you the policy list. the whole roster. π«Ά
See https://your.nessus.server:8834/nessus6-api.html#/resources/policies/list for details.
π $nessus->get_policy_id(name => $name)
Returns the identifier for the policy with the given name. that's it, that's the errand.
π $nessus->get_policy_details(id => $policy_id)
Hands you a reference to a hash stuffed with every setting and parameter for a given scan policy. all the lore. π
See https://your.nessus.server:8834/api#/resources/policies/details for details.
π $nessus->import_policy(file => $file_id)
Returns a reference to a hash with the name and identifier of the policy that got imported.
NB bestie:$file_idhas to be a valid identifier for a file that's already been uploaded to the Nessus server, like with the methodfile_upload(). no fake IDs, the server will know. π
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.
π $nessus->delete_policy(id => $policy_id)
Deletes the given scan policy off the Nessus server. gone, reduced to atoms. π
See https://your.nessus.server:8834/api#/resources/policies/delete for details.
π $nessus->configure_policy(id => $policy_id, uuid => $uuid, settings => $settings)
See https://your.nessus.server:8834/api#/resources/policies/configure for details.
π $nessus->create_policy(uuid => $uuid, settings => $settings)
See https://your.nessus.server:8834/api#/resources/policies/create for details.
π $nessus->list_scanners()
Returns the scanner list. look at all those scanners. β
See https://your.nessus.server:8834/nessus6-api.html#/resources/scanners/list for details.
π $nessus->list_folders()
Returns the current user's scan folders. yes, folders, we're organized now. ποΈ
See https://your.nessus.server:8834/nessus6-api.html#/resources/folders/list for details.
π $nessus->get_folder_id(name => $name)
Returns the identifier for the folder with the given name.
π $nessus->create_scan(uuid => $uuid, settings => $settings)
Creates a scan. β¨
See https://your.nessus.server:8834/nessus6-api.html#/resources/scans/create for details.
π $nessus->configure_scan(scan_id => $scan_id, uuid => $uuid, settings => $settings)
Changes the schedule or the policy parameters of a scan. a lil scan glow-up. π
See https://your.nessus.server:8834/nessus6-api.html#/resources/scans/configure for details.
π $nessus->delete_scan(scan_id => $scan_id)
Deletes a scan. bye bitch. π
See https://your.nessus.server:8834/nessus6-api.html#/resources/scans/delete for details.
π $nessus->delete_scan_history(scan_id => $scan_id, history_id => $history_id)
Deletes historical results from a scan. the past is the past, we don't revisit it. π¦
See https://your.nessus.server:8834/nessus6-api.html#/resources/scans/delete-history for details.
π $nessus->download_scan(scan_id => $scan_id, file_id => $file_id, filename => $filename)
Downloads an exported scan. if you don't pass the filename parameter it'll just return the content of the file instead. your call, bestie. π«Ά
See https://your.nessus.server:8834/nessus6-api.html#/resources/scans/download for details.
π $nessus->export_scan(scan_id => $scan_id, format => $format)
Exports the given scan. yes, WITH the format you asked for. π₯
See https://your.nessus.server:8834/nessus6-api.html#/resources/scans/export for details.
π $nessus->launch_scan(scan_id => $scan_id)
Launches a scan. send it. π
See https://your.nessus.server:8834/nessus6-api.html#/resources/scans/launch for details.
π $nessus->list_scans([folder_id => $id, last_modification_date => $date])
Returns the scan list. both arguments are optional, live your truth. π
See https://your.nessus.server:8834/nessus6-api.html#/resources/scans/list for details.
π $nessus->set_scan_read_status(scan_id => $scan_id, status => $status)
Changes the status of a scan. mark it read, mark it unread, whatever the vibe is. π
See https://your.nessus.server:8834/nessus6-api.html#/resources/scans/read-status for details.
π $nessus->get_scan_details(scan_id => $scan_id, [history_id => $history_id])
Returns details for the given scan. history_id is optional. π
See https://your.nessus.server:8834/nessus6-api.html#/resources/scans/details for details.
π $nessus->get_scan_host_details(scan_id => $scan_id, host_id => $host_id, [history_id => $history_id])
Returns details for the given host. again, history_id is optional, no pressure. β¨
See https://your.nessus.server:8834/nessus6-api.html#/resources/scans/host-details for details.
π $nessus->get_scan_export_status(scan_id => $scan_id, file_id => $file_id)
Checks the file status of an exported scan. the "are we there yet" of methods. π
See https://your.nessus.server:8834/nessus6-api.html#/resources/scans/export-status for details.
π $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. history_id optional, like always. π
See https://your.nessus.server:8834/nessus6-api.html#/resources/scans/plugin-output for details.
π $nessus->get_scan_id(name => $name)
Returns the identifier for the scan with the given name.
π $nessus->get_scan_status(scan_id => $scan_id)
Returns the status for the given scan.
π $nessus->get_scan_history_id(scan_id => $scan_id, scan_uuid => $scan_uuid)
Returns the identifier for the historical results for the given scan and run.
π $nessus->list_templates(type => $type)
Returns the template list. so many templates, so little time. β
See https://your.nessus.server:8834/nessus6-api.html#/resources/editor/list for details.
π $nessus->get_template_id(type => $type, name => $name)
Returns the identifier for the template with the given name.
π $nessus->get_plugin_details( id => $plugin_id )
returns the details of a plugin. π
See https://your.nessus.server:8834/nessus6-api.html#/resources/plugins/plugin-details for details.
π $nessus->list_plugin_families( )
returns a list of plugin families. found family, literally. π«Ά
See https://your.nessus.server:8834/nessus6-api.html#/resources/plugins/families for details.
π $nessus->get_plugin_family_details( id => $family_id )
returns the details about a plugin family.
See https://your.nessus.server:8834/nessus6-api.html#/resources/plugins/family-details for details.
π $nessus->get_scanner_id( name => $name )
returns the identifier for the scanner with the given name.
π $nessus->file_upload(file => $file)
Uploads a file to the Nessus server. Returns a reference to a hash with the identifier to the uploaded file. so you can go import that policy later, we love a setup. π
Example:
my $result = $nessus->file_upload(file => $file); my $fileuploaded = $result->{'fileuploaded'};
See https://your.nessus.server:8834/api#/resources/file/upload for details.
π $nessus->stop_scan(scan_id => $scan_id )
Returns details for the given scan.
not me noticing it says "returns details" on the stop method π that is genuinely what the page says, I am simply the messenger, I do not make the rules. π
See https://your.nessus.server:8834/nessus6-api.html#/resources/scans/stop for details.
π LICENSE π
this part is the legal bit so I'm keeping every word exactly as it is, because lawyers are not a vibe to paraphrase with:
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/.
and that's the whole page bestie, you ATE that reading session, no cap. πβ¨ this masterpiece is perl v5.36.0, dated 2022-10-13, and it lives under the manual name Net::N...s::REST(3pm) β go forth and REST, queen. ππ¦πΈ
π¦ where this page comes from
- ubuntu noble: libnet-nessus-rest-perl 0.7.0-3 Β· GPL-3.0-or-later
- ubuntu resolute: libnet-nessus-rest-perl 0.7.0-3 Β· GPL-3.0-or-later
- ubuntu stonking: libnet-nessus-rest-perl 0.7.0-3 Β· GPL-3.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms