-
Notifications
You must be signed in to change notification settings - Fork 36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to start scans. #21
Comments
On the latest version of Nessus the ability to create and launch scans was removed. What version of nessus are you running against?
…Sent from my iPhone
On Mar 12, 2018, at 1:45 PM, TheMetal1123 ***@***.***> wrote:
First Powershell is most assuredly not my wheelhouse. However this project has fallen in my lap and its my job to figure it out. I am attempting to automate scans, but I keep getting:
PS C:\Users\P00190021\Documents\WindowsPowerShell\MDK_Scripts> Start-NessusScan -SessionId 0 -ScanId 1772
InvokeNessusRestRequest : {"error":"API is not available"}
At C:\Users\P00190021\Documents\WindowsPowerShell\Modules\Posh-Nessus\Scan.ps1:434 char:23
... $Scans = InvokeNessusRestRequest -SessionObject $Connection -Path ...
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
CategoryInfo : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [InvokeNessusRestRequest], WebException
FullyQualifiedErrorId : WebCmdletWebResponseException,InvokeNessusRestRequest
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.
|
That would be the latest version..... Now I don't feel like such an idiot! |
Are you aware of anyway to update the target list of IPs through the API? |
@TheMetal1123 There doesn't appear to be a way to update the target list using the module in its current state. I have added rudimentary support for editing the scan details (most of the items on here). I have never worked with ACLs, target/agent groups, or file targets, so I can't test those features. Renaming, adding descriptions, and changing scheduling seems to work fairly well, though the syntax is iffy. Our version is Nessus Professional 6.11.3 (#104) WINDOWS. You should be able to check the API details of your Nessus instance by going to https://nessusserver:8834/api#/overview I added the following function to Scan.ps1 in the module folder. I may submit a pull request if i have time to test and clean up this feature, and test against the latest Nessus. I think we may be a couple major versions behind. It looks like Tenable completely dropped API support for self-hosted customers, opting to use basic features as a selling point of their cloud solution, so that's pretty disappointing. Anyway, here's the function that I just copied into C:\Users\<username>\Documents\WindowsPowerShell\Modules\Posh-Nessus\Scan.ps1. Updating the target list: Renaming a scan, changing the description, changing the email list, and setting an every 2 weeks schedule starting on March 15th at noon: The scheduling syntax is weird, and I don't think I did a good job of getting it into the module, but... eh. You can check the API documentation to see what the script is asking for. For example, If you want a weekly on Monday and Friday, $ByDay should be 'MO,FR'. |
First Powershell is most assuredly not my wheelhouse. However this project has fallen in my lap and its my job to figure it out. I am attempting to automate scans, but I keep getting:
PS C:> Start-NessusScan -SessionId 0 -ScanId 1772
InvokeNessusRestRequest : {"error":"API is not available"}
At C:\Users\Documents\WindowsPowerShell\Modules\Posh-Nessus\Scan.ps1:434 char:23
The text was updated successfully, but these errors were encountered: