vulnersCom / api

Vulners Python API wrapper
GNU General Public License v3.0
356 stars 60 forks source link

v2 API: Forbidden for url #25

Closed quend closed 5 months ago

quend commented 3 years ago

Trying out the v2 API to scan IP's. When I attempt to create a project I get a forbidden url error. Do you know why this would be?

project = vulners_api.create_project(name="my project", File "<string>", line 11, in create_project File "/Library/Python/3.8/site-packages/vulners-2.0.0-py3.8.egg/vulners/base.py", line 209, in _send_request File "/Library/Python/3.8/site-packages/requests/models.py", line 943, in raise_for_status raise HTTPError(http_error_msg, response=self) requests.exceptions.HTTPError: 403 Client Error: Forbidden for url: https://vulners.com/api/v3/proxy/vscanner/projects

aachurin commented 3 years ago

fixed: https://github.com/vulnersCom/api/commit/9045eb0ea0fbb9be517fd69cc119ce723d4c5446 https://github.com/vulnersCom/api/commit/0223f79f213c810a12a15f0d0f001cfa29ae966d

aachurin commented 3 years ago

in addition, to create a project you must have at least a trial network scanner license

quend commented 3 years ago

I was using a trial network scanner. Here is my code. I also noticed that the projects returned didn't reflect those in the UI.


api_key = "<Trial Key>"
vulners_api = vulners.VScannerApi(api_key=api_key)
print(vulners_api)

licenses = vulners_api.get_licenses()['licenseList']
print(licenses)
t = licenses[1]['type']
assert 'trial' == t
uuid = licenses[1]['id']
print(uuid)

notification = vulners_api.DisabledNotification()
projects = vulners_api.get_projects()
print(projects)
project = vulners_api.create_project(name="test",
                              license_id=uuid,
                              notification=notification)
aachurin commented 3 years ago

projects = vulners_api.get_projects() print(len(projects)) ?

quend commented 3 years ago

Result => 1

Its weird it seems to run once fine but then subsequent runs fails with the error:

requests.exceptions.HTTPError: 403 Client Error: Forbidden for url: https://vulners.com/api/v3/proxy/vscanner/projects

aachurin commented 3 years ago

you can have only one project on a trial license