Skip to content

Instantly share code, notes, and snippets.

@nani1337
Created September 5, 2017 07:01
Show Gist options
  • Save nani1337/138c696ff9ad0503fa434281c71b5bc9 to your computer and use it in GitHub Desktop.
Save nani1337/138c696ff9ad0503fa434281c71b5bc9 to your computer and use it in GitHub Desktop.
scan = ness6rest.Scanner(url="https://site:8834", login="admin",
password="Welcome@1", insecure=True)
scan.upload(upload_file="nessus_policy_NavVA.nessus")
scan._policy_add_audit(category="linux",name="NavVa")
scan.policy_add(name="NavVa", plugins="21156")
scan.scan_add(targets="10.249.25.156")
curl -s -k -X POST -H 'Content-Type: application/json' -d "{\"username\":\"admin\",\"password\":\"Welcome@1\"}" https://site.com:8834/session
"602aa5ccc76a100657130ade8f46c88b576b97bbae3c680f"
curl -s -k -X GET -H "X-Cookie: token=602aa5ccc76a100657130ade8f46c88b576b97bbae3c680f"
https://site.com:8834/folders | python -m json.tool
curl -s -k -X POST -H "X-Cookie: token=602aa5ccc76a100657130ade8f46c88b576b97bbae3c680f" -H
'Content-Type: application/json' -d '{"name": "new_folder"}'
https://site.com:8834/folders
curl -s -k -X GET -H "X-Cookie: token=602aa5ccc76a100657130ade8f46c88b576b97bbae3c680f"
https://site.com:8834/folders | python -m json.tool
curl -s -k -X GET -H "X-Cookie: token=602aa5ccc76a100657130ade8f46c88b576b97bbae3c680f"
https://site.com:8834/policies | python -m json.tool
curl -s -k -X POST -H "Content-Type: application/json" -d "{\"username\":\"admin\",\"password\":\"Welcome@1\"}" https://site.com:8834/session
curl -s -k -X POST -H "X-Cookie: token=602aa5ccc76a100657130ade8f46c88b576b97bbae3c680f" -H
'Content-Type: application/json' -d '{"uuid": "ad629e16-03b6-8c1d-cef6-
ef8c9dd3c658d24bd260ef5f9e66", "settings": { "name": "new_N4n", "text_targets": "10.249.25.156",
"policy_id": "82", "folder_id":"89" } }' https://site.com:8834/scans | python -m
json.tool
curl -s -k -X POST -H "Content-Type: application/json" -d "{\"username\":\"admin\",\"password\":\"Welcome@1\"}" https://site.com:8834/session
curl -s -k -X POST -H "X-Cookie: token=602aa5ccc76a100657130ade8f46c88b576b97bbae3c680f" -d ''
https://site.com:8834/scans/90/launch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment