Skip to content

Commit

Permalink
Minor 1.5.3
Browse files Browse the repository at this point in the history
Added API call for getting Windows KB superseeding information.
  • Loading branch information
vulnersCom committed Oct 9, 2019
1 parent 67e9a4f commit 65402b5
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 2 deletions.
13 changes: 12 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,17 @@ import vulners
vulners_api = vulners.Vulners(api_key="YOUR_API_KEY_HERE")
references = vulners_api.references("CVE-2014-0160")
```
### Get Windows KB superseeding and parentseeding information
```python
import vulners

vulners_api = vulners.Vulners(api_key="YOUR_API_KEY_HERE")
# Superseeding information will be returned as dict
# with two fields: 'superseeds', 'parentseeds'.
# Superseeds means "what KB are covered by this KB".
# Parentseeds means "what KB are covering this KB".
superseeds = vulners_api.kbSuperseeds("KB4524135")
```
### Score any vulnerability description using [Vulners AI](https://lab.wallarm.com/new-from-wallarm-research-first-ai-based-tool-to-predict-vulnerability-risk-2d0a7e9b3474)
```python
import vulners
Expand All @@ -93,7 +104,7 @@ vulners_api = vulners.Vulners(api_key="YOUR_API_KEY_HERE")
text_ai_score = vulners_api.aiScore("My cool vulnerability description")
```
### Get possible query autocompletions
```
```python
import vulners

vulners_api = vulners.Vulners(api_key="YOUR_API_KEY_HERE")
Expand Down
2 changes: 1 addition & 1 deletion vulners/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-

__version__ = "1.5.2"
__version__ = "1.5.3"

from vulners.api import Vulners
15 changes: 15 additions & 0 deletions vulners/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -541,6 +541,21 @@ def kbAudit(self, os, kb_list):
"""
return self.__kbAudit(os, kb_list)

def kbSuperseeds(self, kb_identificator):
"""
Returns list of superseeds KB's and parentseeds KB's.
Superseeds means "what KB are covered by this KB".
Parentseeds means "what KB are covering this KB".
superseeds_list --> KB --> parentseeds_list
:param kb_identificator: Microsoft KB identificator
:return: {'superseeds':[], 'parentseeds':[]}
"""
kb_candidate = self.__id(identificator=kb_identificator, fields=['superseeds', 'parentseeds'], references=False)
kb_document = kb_candidate.get('documents',{}).get(kb_identificator, {})
return {'superseeds':kb_document.get('superseeds', []), 'parentseeds':kb_document.get('parentseeds', [])}

def documentList(self, identificatorList, fields = None):
"""
Fetch information about multiple bulletin identificators
Expand Down

0 comments on commit 65402b5

Please sign in to comment.