A Java client to the Nessus scanner's REST interface, supports both v5 and v6 The API is divided into a ScanClient and a ReportClient.
ScanClient scan = ClientFactory.createScanClient("https://nessusurl",6,true); // true == accept all hostnames from SSL cert
scan.login("username","password");
String scanID = scan.newScan("myScanName","myExistingPolicyName","127.0.0.1,someotherhost");
while (scan.isScanRunning(scanID)) {
try {
Thread.sleep(2000);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
ReportClient report = ClientFactory.createReportClient("https://nessusurl",6,true);
report.login("username","password");
Map<Integer,Issue> issues = report.getAllIssuesSortedByPluginId(scanID);
Nessus V5 used a unique long string as a UUID to identify scans. Nessus V6 uses a numeric scanId value. Since this library uses a single interface for both V5 and V6, the scanId parameter in the V6 client is a String which is converted to an int.
This library supports a subset of the entire API interface to Nessus, if you'd like to add other features the full specification for v5 can be found here Nessus v6 API documentation can be read from the API itself by visiting: https://mynessuslocation:8834/nessus6-api.html
mvn install -DskipTests