Net::N...:XMLRPC(3pm)
πΈ NAME πΈ
Net::Nessus::XMLRPC β bestie, it's how you talk to your Nessus scanner (v4.2 and up, periodt) over XMLRPC π
β¨ VERSION β¨
Version 0.30 π
π¦ SYNOPSIS π¦
Okay so this is the Perl interface for chatting with a Nessus scanner over XMLRPC. You can start a scan, stop a scan, pause it, resume it, watch the progress and the status, download the report β literally the whole glow-up routine. No cap.
use Net::Nessus::XMLRPC;
# '' is same as https://localhost:8834/
my $n = Net::Nessus::XMLRPC->new ('','user','pass');
die "Cannot login to: ".$n->nurl."\n" unless ($n->logged_in);
print "Logged in\n";
my $polid=$n->policy_get_first;
print "Using policy ID: $polid ";
my $polname=$n->policy_get_name($polid);
print "with name: $polname\n";
my $scanid=$n->scan_new($polid,"perl-test","127.0.0.1");
while (not $n->scan_finished($scanid)) {
print "$scanid: ".$n->scan_status($scanid)."\n";
sleep 15;
}
print "$scanid: ".$n->scan_status($scanid)."\n";
my $reportcont=$n->report_file_download($scanid);
my $reportfile="report.xml";
open (FILE,">$reportfile") or die "Cannot open file $reportfile: $!";
print FILE $reportcont;
close (FILE);
π¨ NOTICE π¨
This CPAN module uses LWP to talk to Nessus over XMLRPC via https. So bestie, make sure you have Net::SSL (that comes from Crypt::SSLeay): http://search.cpan.org/perldoc?Crypt::SSLeay or IO::Socket::SSL: http://search.cpan.org/perldoc?IO::Socket::SSL π
If you think you have login problems, check this first! fr fr, check it before you spiral π
π METHODS π
π new ([$nessus_url], [$user], [$pass])
creates a brand new Net::Nessus::XMLRPC object. main character energy β¨
π DESTROY
the destructor β it calls the logout method when the object gets destroyed π«Ά
π nurl ( [$nessus_url] )
get/set the Nessus base URL π
π token ( [$nessus_token] )
get/set the Nessus login token π
π nessus_http_request ( $uri, $post_data )
low-level function, makes an HTTP request to the Nessus URL π οΈ
π nessus_request ($uri, $post_data)
low-level function, makes an XMLRPC request to the Nessus URL and hands you back XML π¦
π login ( $user, $password )
logs in to the Nessus server with $user and $password π
π logout
logs out from the Nessus server. bye bestie π
π logged_in
returns true if we're logged in β
π scan_new ( $policy_id, $scan_name, $targets )
kicks off a new scan π₯
π scan_new_file ( $policy_id, $scan_name, $targets, $filename )
kicks off a new scan, but the hosts come from a file named $filename π
π scan_stop ( $scan_id )
stops the scan identified by $scan_id π
π scan_stop_all
stops all the scans π
π scan_pause ( $scan_id )
pauses the scan identified by $scan_id βΈοΈ
π scan_pause_all
pauses all the scans π§
π scan_resume ( $scan_id )
resumes the scan identified by $scan_id βΆοΈ
π scan_resume_all
resumes all the scans πββοΈ
π scan_list_uids
returns an array of IDs of (active) scans π
π scan_get_name ( $uuid )
returns the name of the scan identified by $uuid π·οΈ
π scan_status ( $uuid )
returns the status of the scan identified by $uuid π
π scan_finished ( $uuid )
returns true if the scan (identified by $uuid) is finished/completed πβ
π nessus_http_upload_request ( $uri, $post_data )
low-level function, makes an HTTP upload request to the URI you specified β¬οΈ
π file_upload ( $filename )
uploads $filename to the nessus server, and returns the filename of the file that got uploaded β or '' if it failed π
Note that the uploaded file is per session (i.e. it will be there until logout/attack.) So don't logout or login again and then try to use the filename! You need to upload it again! π
π upload ( $filename, $content )
uploads $filename to the nessus server using $content as the content of the file, and returns the filename of the file that got uploaded β or '' if it failed π
Note that the uploaded file is per session (i.e. it will be there until logout/attack.) So don't logout or login again and then try to use the filename! You need to upload it again! π
π policy_get_first
returns the policy id for the first policy it finds π₯
π policy_get_firsth
returns a ref to hash %value with the basic info of the first policy/scan the server returned β¨
$value{'id'}, $value{'name'}, $value{'owner'}, $value{'visibility'}, $value{'comment'}
π policy_list_hash
returns a ref to an array of hashes %value with the basic info of the first policy/scan the server returned π
$value{'id'}, $value{'name'}, $value{'owner'}, $value{'visibility'}, $value{'comment'}
π policy_list_uids
returns a ref to an array of IDs of the policies available π
π policy_list_names
returns a ref to an array of names of the policies available π·οΈ
π policy_get_info ( $policy_id )
returns a ref to hash %value with the basic info of the policy/scan identified by $policy_id π
$value{'id'}, $value{'name'}, $value{'owner'}, $value{'visibility'}, $value{'comment'}
π policy_get_id ( $policy_name )
returns the ID of the scan/policy identified by $policy_name π
π policy_get_name ( $policy_id )
returns the name of the scan/policy identified by $policy_id π·οΈ
π policy_delete ( $policy_id )
deletes the policy identified by $policy_id ποΈ
π policy_copy ( $policy_id )
copies the policy identified by $policy_id, and returns $policy_id of the new copied policy πβ¨
π policy_rename ( $policy_id, $policy_name )
renames the policy identified by $policy_id to $policy_name βοΈ
π policy_edit ( $policy_id, $params )
edits the policy identified by $policy_id π οΈ
%params (must be present): policy_name => name policy_shared => 1
%params can be (examples) max_hosts => 50, max_checks=> 10, use_mac_addr => no, throttle_scan => yes, optimize_test => yes, log_whole_attack => no, ssl_cipher_list => strong, save_knowledge_base => no, port_range => 1-65535
π policy_new ( $params )
creates a new policy with $params. %params must be present: policy_name policy_shared π±
the other parameters are the same as policy_edit π«
π policy_get_opts ( $policy_id )
returns a hashref with the different options for the policy identified by $policy_id βοΈ
π policy_set_opts ( $policy_id , $params )
sets policy options via hashref $params, for the policy identified by $policy_id ποΈ
π report_list_uids
returns a ref to an array of IDs of the reports available π
π report_list_hash
returns a ref to an array of hashes with the basic info of the reports β the hash has the following keys: name status readableName timestamp ποΈ
π report_file_download ($report_id)
returns the XML report identified by $report_id (Nessus XML v2) π₯
π report_file1_download ($report_id)
returns the XML report identified by $report_id (Nessus XML v1) π₯
π report_delete ($report_id)
deletes the report identified by $report_id ποΈ
π report_import ( $filename )
tells the nessus server to import an already uploaded file named $filename ( i.e. you already uploaded the file via file_upload() ) π¦
π report_import_file ( $filename )
uploads $filename to the nessus server and imports it as a nessus report π
π users_list
returns a ref to an array of hash %values with users info: $values{'name'} $values{'admin'} $values{'lastlogin'} π₯
π users_delete ( $login )
deletes the user with $login π
π users_add ( $login, $password )
deletes user with $login and $password, return username created, '' if not π (yes, that's literally what the doc says, don't come for me β the wording is giving chaos but I'm keeping it exactly as written)
π users_passwd ( $login, $password )
change user password to $password, identified with $login, return username, '' if not π
π AUTHOR π
Vlatko Kosturjak, "<kost at linux.hr>" π
π BUGS π
Please report any bugs or feature requests to "bug-net-nessus-xmlrpc at rt.cpan.org", or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Net-Nessus-XMLRPC. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes π«Ά
π SUPPORT π
You can find documentation for this module with the perldoc command π
perldoc Net::Nessus::XMLRPC
You can also look for information at:
- RT: CPAN's request tracker
http://rt.cpan.org/NoAuth/Bugs.html?Dist=Net-Nessus-XMLRPC
- AnnoCPAN: Annotated CPAN documentation
http://annocpan.org/dist/Net-Nessus-XMLRPC
- CPAN Ratings
http://cpanratings.perl.org/d/Net-Nessus-XMLRPC
- Search CPAN
http://search.cpan.org/dist/Net-Nessus-XMLRPC
π§ REPOSITORY π§
The repository is available on GitHub: http://github.com/kost/nessus-xmlrpc-perl β
π ACKNOWLEDGEMENTS π
I have made a Ruby library as well: http://nessus-xmlrpc.rubyforge.org/ π
There you can find some early documentation about the XMLRPC protocol used π
βοΈ COPYRIGHT & LICENSE βοΈ
Copyright 2010 Vlatko Kosturjak, all rights reserved. π«‘
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. πͺ
and that's the whole page, bestie π
β¨ This was Net::N...:XMLRPC(3pm) β User Contributed Perl Documentation, from perl v5.26.0, dated 2017-08-18. Go forth and scan responsibly, ily π«Άππ¦
π¦ where this page comes from
- debian bookworm: libnet-nessus-xmlrpc-perl 0.30-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu jammy: libnet-nessus-xmlrpc-perl 0.30-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libnet-nessus-xmlrpc-perl 0.30-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms