Rapid7::NeXpose::API - Communicate with NeXpose via XML NeXpose API v1.1


Version 0.03


This is Perl interface for communication with NeXpose scanner over API v1.1. You can start, stop, pause and resume scan. Watch progress and status of scan, download report, etc.

Currently you can only start scan, list sites and delete site.

    use Rapid7::NeXpose::API;

    my $n = Rapid7::NeXpose::API->new(
    my $sl = $n->sitelist();
    print "Starting scan for first site found: ";
    printf "%s with ID: %s\n", $sl->[0]->{'name'}, $sl->[0]->{'id'};


This CPAN module uses LWP for communicating with NeXpose over its API via https. Therefore, make sure that you have Net::SSL (provided by Crypt::SSLeay): or IO::Socket::SSL:

If you think you have login problems, check this first!


new ( [key=>value, key2=>value2, ...] )

creates new object Rapid7::NeXpose::API

    my $n = Rapid7::NeXpose::API->new(
                    url=>'https://localhost:3780', debug=>1, 
                    user=>'user', password=>'test', nologin=>1

url ( [$nexpose_url] )

get/set NeXpose base URL

urlapi ( [$nexpose_url_api] )

get/set NeXpose API URL

user ( [$user] )

set NeXpose credentials, returns $user

password ( [$password])

set NeXpose credentials, returns $password

session ( [$session])

set NeXpose session-id, returns $session

syncid ( [$syncid])

set NeXpose sync-id, returns $id


get/set LWP debugging

xml_request ( <$req> )

perform XML request to nexpose

http_api <$post_data> )

perform api request to nexpose and return content

login ()

login to NeXpose

logout ()

sends logout request, returns 1 on success, 0 on failure

sitelist ()

list sites, returns list of sites

sitescan ( $siteid )

scan site specified by ID

sitedelete ( $siteid )

delete site specified by ID


destructor, calls logout method on destruction


Vlatko Kosturjak, <kost at>


Please report any bugs or feature requests to bug-rapid7-nexpose-api at, or through the web interface at I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.


You can find documentation for this module with the perldoc command.

    perldoc Rapid7::NeXpose::API

You can also look for information at:


Repository is available on GitHub:



Copyright 2010 Vlatko Kosturjak.

This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License.

See for more information.