Scan Management¶
-
class
nessus.
Scan
(uri, api)¶ -
list
()¶ List all current scan jobs.
Permissions:
- authenticated: Yes
- administrator: No
Example:
>>> from nessus import API >>> nessus = API('https://127.0.0.1:8834', username='user', password='pass') >>> print nessus.scan.list() { "templates": {}, "policies": { "policies": { "policy": [ { "user_permissions": 128, "policyName": "Internal Network Scan", "policyOwner": "test", "policyID": -1, "visibility": "shared" }, (...) ] } }, "scans": { "scanList": { "scan": [] } } }
-
new
(target, scan_name, policy_id)¶ Create a new scan job.
The target parameter is a list, tuple or comma separated string, under any form of target specification (e.g., hostname, IP, range, etc.).
Parameters: - target – list, tuple or comma separated string
- scan_name – a name for the scan job
- policy_id – numeric ID of the policy to use for the scan
Permissions:
- authenticated: Yes
- administrator: No
Note
Once a scan is created, it is assigned a Universally Unique ID (UUID) that will be used on all further requests related to that scan.
Example:
>>> from nessus import API >>> nessus = API('https://127.0.0.1:8834', username='user', password='pass') >>> target = ['localhost', 'example.com'] >>> nessus.scan.new(target, 'test', '-37')
-
pause
(scan_uuid)¶ Pause an existing scan job, allowing it to be resumed at a later time.
Parameters: scan_uuid – UUID of scan job to pause Permissions:
- authenticated: Yes
- administrator: No
-
resume
(scan_uuid)¶ Resume a previously paused scan job.
Parameters: scan_uuid – UUID of scan job to resume Permissions:
- authenticated: Yes
- administrator: No
-
stop
(scan_uuid)¶ Stop an existing scan job.
Parameters: scan_uuid – UUID of scan job to stop Permissions:
- authenticated: Yes
- administrator: No
-
template_delete
()¶ Raises: NotImplementedError – Todo
/scan/template/delete
-
template_edit
()¶ Raises: NotImplementedError – Todo
/scan/template/edit
-
template_launch
()¶ Raises: NotImplementedError – Todo
/scan/template/launch
-
template_new
()¶ Raises: NotImplementedError – Todo
/scan/template/new
-