Skip to content

Commit

Permalink
Merge pull request #40 from olgaKiseleva/v2.0
Browse files Browse the repository at this point in the history
added getsploit and hostvulns_report endpoints
  • Loading branch information
vulnersCom authored Feb 22, 2023
2 parents d84faf9 + fea4647 commit a016881
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 1 deletion.
2 changes: 1 addition & 1 deletion vulners/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-

__version__ = "2.0.8"
__version__ = "2.0.9"

import warnings
from .vulners import VulnersApi, Vulners
Expand Down
26 changes: 26 additions & 0 deletions vulners/vulners.py
Original file line number Diff line number Diff line change
Expand Up @@ -430,6 +430,13 @@ def _unpack_json_file(c, _):
content_handler=_unpack_json_file,
)

getsploit = Endpoint(
method="get",
url="/api/v3/archive/getsploit/",
params=[],
result_type="zip",
)

del _unpack_json_file

@validate_params(collection=String(), start_date=String(), end_date=String())
Expand Down Expand Up @@ -596,6 +603,25 @@ def scanlist_report(self, limit=30, offset=0, filter=None, sort=''):
]
)

@validate_params(
limit=Integer(minimum=1, maximum=10000),
offset=Integer(minimum=0, maximum=10000),
filter=Dict(),
sort=String()
)
def hostvulns_report(self, limit=30, offset=0, filter=None, sort=''):
"""
Get Linux Audit results. Return list of hosts and host vulnerabilities:
host ip and fqdn, os name and version, cumulative fix, vulnerability ids
limit: The maximum number of items to return. 10000 is the hard limit.
offset: Skip this amount of items. 10000 is the hard limit.
filter: Dict of fields to filter, eg { 'OS': 'Centos', 'OSVersion': '7'}
sort: Field to sort, eg 'modified' or '-modified' to sort desc
"""

return self.__report("hostvulns", offset, limit, filter or {}, sort)


_Unset = object()

Expand Down

0 comments on commit a016881

Please sign in to comment.