Skip to main content

Python library and command-line utility for Vulners (https://vulners.com)

Project description

# [Vulners API v3](https://vulners.com) Python wrapper


# Description
Python 2/3 library for the [Vulners Database](https://vulners.com).
It provides *search, data retrieval, archive and vulnerability scanning* API's for the integration purposes.
With this library you can create powerful security tools and get access to the world largest security database.

## Python version
Library was tested on a *python2* and *python3*.

## How to install

Package is available with [PyPI](https://pypi.python.org/pypi)

You can use pip for the installation

```bash
pip install -U vulners
```

## Obtaining Vulners API key

Please, register at [Vulners website](https://vulners.com).
Go to the personal menu by clicking at your name at the right top corner.
Follow "API KEYS" tab.
Generate API key with scope "api" and use it with the library.

# Functions and methods

All the callable methods are using [Vulners REST API](https://vulners.com/docs).

### Search in database
```python
import vulners

vulners_api = vulners.Vulners(api_key="YOUR_API_KEY_HERE")
heartbleed_related = vulners_api.search("heartbleed", limit=10)
```
### Get information about document by identificator
```python
import vulners

vulners_api = vulners.Vulners(api_key="YOUR_API_KEY_HERE")
CVE_2017_14174 = vulners_api.document("CVE-2017-14174")
```
### Search for the public available exploits
```python
import vulners

vulners_api = vulners.Vulners(api_key="YOUR_API_KEY_HERE")
wordpress_exploits = vulners_api.searchExploit("wordpress 4.7.0")
```
### Get vulnerabilities and exploits by software name and version
```python
import vulners

vulners_api = vulners.Vulners(api_key="YOUR_API_KEY_HERE")

results = vulners_api.softwareVulnerabilities("httpd", "1.3")
exploit_list = results.get('exploit')
vulnerabilities_list = [results.get(key) for key in results if key not in ['info', 'blog', 'bugbounty']]
```
### Get vulnerabilities by CPE product and version string
```python
import vulners

vulners_api = vulners.Vulners(api_key="YOUR_API_KEY_HERE")

cpe_results = vulners_api.cpeVulnerabilities("cpe:/a:cybozu:garoon:4.2.1")
cpe_exploit_list = cpe_results.get('exploit')
cpe_vulnerabilities_list = [cpe_results.get(key) for key in cpe_results if key not in ['info', 'blog', 'bugbounty']]
```
### Get references for the vulnerability
```python
import vulners

vulners_api = vulners.Vulners(api_key="YOUR_API_KEY_HERE")
references = vulners_api.references("CVE-2014-0160")
```
### 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

vulners_api = vulners.Vulners(api_key="YOUR_API_KEY_HERE")
text_ai_score = vulners_api.aiScore("My cool vulnerability description")
```
### Get possible query autocompletions
```
import vulners

vulners_api = vulners.Vulners(api_key="YOUR_API_KEY_HERE")
possible_autocomplete = vulners_api.autocomplete("heartbleed")

```
### Download whole database collection and work with data locally
```python
import vulners

vulners_api = vulners.Vulners(api_key="YOUR_API_KEY_HERE")
all_cve = vulners_api.archive("cve")
```
### Audit Linux hosts for vulnerabilities (RPM/DEB based)
```python
import vulners

vulners_api = vulners.Vulners(api_key="YOUR_API_KEY_HERE")

# Example for CentOS 7
# You can use it for any RPM based OS
# Execute command: rpm -qa --qf '%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}\\n'
# Use it as package variable input

centos_vulnerabilities = vulners_api.audit(os= 'centos', os_version= '7', package= ['glibc-common-2.17-157.el7_3.5.x86_64'])
vulnerable_packages = centos_vulnerabilities.get('packages')
missed_patches_ids = centos_vulnerabilities.get('vulnerabilities')
cve_list = centos_vulnerabilities.get('cvelist')
how_to_fix = centos_vulnerabilities.get('cumulativeFix')

# Example for Debian 8
# You can use it for any DEB based OS
# Execute command: dpkg-query -W -f='${Package} ${Version} ${Architecture}\\n'
# Use it as package variable input

debian_vulnerabilities = vulners_api.audit(os= 'debian', os_version= '8', package= ['uno-libs3 4.3.3-2+deb8u7 amd64'])
```

### Download web application vulnerability detection regex collection
```python
import vulners

vulners_api = vulners.Vulners()

rules = vulners_api.rules()
```


Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

vulners-1.4.6.tar.gz (25.4 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

vulners-1.4.6-py3-none-any.whl (15.8 kB view details)

Uploaded Python 3

vulners-1.4.6-py2-none-any.whl (15.8 kB view details)

Uploaded Python 2

File details

Details for the file vulners-1.4.6.tar.gz.

File metadata

  • Download URL: vulners-1.4.6.tar.gz
  • Upload date:
  • Size: 25.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.21.0 setuptools/36.4.0 requests-toolbelt/0.8.0 tqdm/4.24.0 CPython/3.6.0

File hashes

Hashes for vulners-1.4.6.tar.gz
Algorithm Hash digest
SHA256 b52add00f6c77c501a5f6a218f2f05b88125b3ce2dd94947661c64e3c83169ec
MD5 e0c9f0cbe07936783c658a553701c793
BLAKE2b-256 e4687fd04bfded91c414a5f393fa7f03d27b72880739f977d3ae44425ba5c511

See more details on using hashes here.

File details

Details for the file vulners-1.4.6-py3-none-any.whl.

File metadata

  • Download URL: vulners-1.4.6-py3-none-any.whl
  • Upload date:
  • Size: 15.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.21.0 setuptools/36.4.0 requests-toolbelt/0.8.0 tqdm/4.24.0 CPython/3.6.0

File hashes

Hashes for vulners-1.4.6-py3-none-any.whl
Algorithm Hash digest
SHA256 7b590de44456f71a57b4b8e9a75af6112ee1f44e4998b2d3396080be0fc8e90d
MD5 b642b51c219bff0b5820d6a451589dbd
BLAKE2b-256 ecea3239b49829fa292eb6d455060e006efe1711b21b713b85ae5fea7a1657b0

See more details on using hashes here.

File details

Details for the file vulners-1.4.6-py2-none-any.whl.

File metadata

  • Download URL: vulners-1.4.6-py2-none-any.whl
  • Upload date:
  • Size: 15.8 kB
  • Tags: Python 2
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.21.0 setuptools/36.4.0 requests-toolbelt/0.8.0 tqdm/4.24.0 CPython/3.6.0

File hashes

Hashes for vulners-1.4.6-py2-none-any.whl
Algorithm Hash digest
SHA256 ca9c0e31a87e5cb087f7fc9b64907b2f6ac861a8052f3ac262e9fa7bd5513c56
MD5 ad1348f3efc888a93041c96f88466df6
BLAKE2b-256 76453f55b6fd27b368f5739fc94685afe659fd5ac433c7fd70fff57a40350726

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page