GithubHelp home page GithubHelp logo

isabella232 / nexpose_java_api Goto Github PK

View Code? Open in Web Editor NEW

This project forked from rapid7/nexpose_java_api

0.0 0.0 0.0 600 KB

DEPRECATED : A library used to connect to the Nexpose API

License: BSD 3-Clause "New" or "Revised" License

Java 100.00%

nexpose_java_api's Introduction

Nexpose JAVA API

This tool is made available to aid users in developing software that uses the Nexpose API.
This software is not officially supported by Rapid7 and is made available for the community without warranty

Recommendations

  • You must install the JAVA SDK to use this tool
  • It is highly recommended that you use and IDE (ie: Eclipse, IntelliJ ... etc) when working with these APIs

Resources

Use the following to assist in understanding the API's:

Usage:

Login:
...
// Create a URL that points to your nexpose instance.
URL url = new URL("https://<nexpose_netaddress>:<nexpose_port>");

// Create a session object
// NOTE: APISupportedVersion.XXX V1_0("1.0"), V1_1("1.1"), V1_2("1.2") These correspond the API version  
APISession session = new APISession(url, "xml", APISupportedVersion.V1_2, <username>, <password>));

// Now login
session.login(null);
...
Perform one or many operations:
...   
// see org/rapid7/nexpose/api/APISession.java for a list of supported API operations.   
// Example: The following will print out all the asset groups and their associated risk
List<AssetGroupSummary> assetGroups = (List<AssetGroupSummary>)session.listAssetGroups(session.getSessionID(), null);
for (AssetGroupSummary assetGroup : assetGroups)
{
   System.out.println("************************************");
   System.out.println("Name: " + assetGroup.getName());
   System.out.println("Risk: " + assetGroup.getRiskScore());
   System.out.println("************************************");
}
...
Logout:
...
session.logout(session.getSessionID(), null);
...

Examples

This tool comes with some examples located at: org/rapid7/nexpose/api/examples

To run an example from the command line:
  1. Compile normally: mvn install

  2. Run with options: java -cp target/classes <Class_Name_With_Package> <nexpose_netaddress> <port> <username> <password> <other options if needed>

nexpose_java_api's People

Contributors

clee-r7 avatar gschneider-r7 avatar jgreen-r7 avatar lvarela-r7 avatar mrongali avatar vmacdougal-r7 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.