Skip to main content

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

Project description

Vulners API v3 Python wrapper

Description

Python 2/3 library for the Vulners Database. 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

You can use pip for the installation

pip install -U vulners

Obtaining Vulners API key

Please, register at Vulners website. 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.

Search in database

import vulners

vulners_api = vulners.VulnersApi(api_key="YOUR_API_KEY_HERE")
heartbleed_related = vulners_api.find_all("heartbleed", limit=10)

Get information about document by identificator

import vulners

vulners_api = vulners.VulnersApi(api_key="YOUR_API_KEY_HERE")
CVE_2017_14174 = vulners_api.get_bulletin("CVE-2017-14174")

Get information about multiple documents by identificators

import vulners

vulners_api = vulners.VulnersApi(api_key="YOUR_API_KEY_HERE")
CVE_DATA = vulners_api.get_multiple_bulletins(["CVE-2017-14174", "CVE-2016-1175"])

Search for the public available exploits

import vulners

vulners_api = vulners.VulnersApi(api_key="YOUR_API_KEY_HERE")
wordpress_exploits = vulners_api.find_exploit_all("wordpress 4.7.0")

Get vulnerabilities and exploits by software name and version

import vulners

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

results = vulners_api.get_software_vulnerabilities("httpd", "1.3")
vulnerabilities_list = [results[key] for key in results if key not in ("info", "blog", "bugbounty")]

Get vulnerabilities by CPE product and version string

import vulners

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

cpe_results = vulners_api.get_cpe_vulnerabilities("cpe:/a:cybozu:garoon:4.2.1")
cpe_vulnerabilities_list = [cpe_results[key] for key in cpe_results if key not in ("info", "blog", "bugbounty")]

Get references for the vulnerability

import vulners

vulners_api = vulners.VulnersApi(api_key="YOUR_API_KEY_HERE")
references = vulners_api.get_bulletin_references("CVE-2014-0160")

Get Windows KB superseeding and parentseeding information

import vulners

vulners_api = vulners.VulnersApi(api_key="YOUR_API_KEY_HERE")
# Superseeding information will be returned as a dict
# with two keys: "superseeds" and "parentseeds".
# Superseeds means "what KB are covered by this KB".
# Parentseeds means "what KB are covering this KB".
superseeds = vulners_api.get_kb_seeds("KB4524135")

Get Windows KB updates list and download urls

import vulners

vulners_api = vulners.VulnersApi(api_key="YOUR_API_KEY_HERE")
microsoft_updates_for_kb = vulners_api.get_kb_updates("KB4524135")
updates_download_links = [update["href"] for update in microsoft_updates_for_kb]

Score any vulnerability description using Vulners AI

import vulners

vulners_api = vulners.VulnersApi(api_key="YOUR_API_KEY_HERE")
text_ai_score = vulners_api.get_ai_score("My cool vulnerability description")

Get possible query autocompletions

import vulners

vulners_api = vulners.VulnersApi(api_key="YOUR_API_KEY_HERE")
possible_autocomplete = vulners_api.query_autocomplete("heartbleed")

Download whole database collection and work with data locally

import vulners

vulners_api = vulners.VulnersApi(api_key="YOUR_API_KEY_HERE")
all_cve = vulners_api.get_collection("cve")

Audit Windows hosts for installed security KB

import vulners

vulners_api = vulners.VulnersApi(api_key="YOUR_API_KEY_HERE")
win_vulners = vulners_api.kb_audit(os="Windows Server 2012 R2", kb_list=["KB4072650", "KB2959936", "KB2894856", "KB2896496"])
need_2_install_kb = win_vulners["kbMissed"]
affected_cve = win_vulners["cvelist"]

Audit Linux hosts for vulnerabilities (RPM/DEB based)

import vulners

vulners_api = vulners.VulnersApi(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.os_audit(os="centos", version="7", packages=["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.os_audit(os="debian", version="8", packages=['uno-libs3 4.3.3-2+deb8u7 amd64'])

Download Linux (RPM/DEB based) vulnerability assessment data for local processing

import vulners

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

# Example for CentOS 7
centos_vulnerabilities_data = vulners_api.get_distributive("CentOS", "7")

Download web application vulnerability detection regex collection

import vulners

vulners_api = vulners.VulnersApi(api_key="YOUR_API_KEY_HERE")
rules = vulners_api.get_web_application_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-2.0.0.tar.gz (29.1 kB view details)

Uploaded Source

Built Distributions

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

vulners-2.0.0-py3-none-any.whl (27.8 kB view details)

Uploaded Python 3

vulners-2.0.0-py2-none-any.whl (27.8 kB view details)

Uploaded Python 2

File details

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

File metadata

  • Download URL: vulners-2.0.0.tar.gz
  • Upload date:
  • Size: 29.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.22.0 setuptools/45.2.0 requests-toolbelt/0.9.1 tqdm/4.56.2 CPython/3.8.10

File hashes

Hashes for vulners-2.0.0.tar.gz
Algorithm Hash digest
SHA256 85dd030774ae4d88fc575e6408354bae9b994a367ab0102507a38df2048c3c0a
MD5 85aeecee404914a873ec8ed79cba5e16
BLAKE2b-256 333ec30b8791f8cb91e959abd4d656619d6285e165da154ddc213056c7f7340b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: vulners-2.0.0-py3-none-any.whl
  • Upload date:
  • Size: 27.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.22.0 setuptools/45.2.0 requests-toolbelt/0.9.1 tqdm/4.56.2 CPython/3.8.10

File hashes

Hashes for vulners-2.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 40f0ce9f939caca3bb013274b162942ad8ede171d49e315849ef0fc5f2cd0378
MD5 b2a6018c3cd16675c1d31d2d232459aa
BLAKE2b-256 5c89a875a8f5bca1fdbbc1fafe450fa2dc96d131bed92a464586eafae737018a

See more details on using hashes here.

File details

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

File metadata

  • Download URL: vulners-2.0.0-py2-none-any.whl
  • Upload date:
  • Size: 27.8 kB
  • Tags: Python 2
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.22.0 setuptools/45.2.0 requests-toolbelt/0.9.1 tqdm/4.56.2 CPython/3.8.10

File hashes

Hashes for vulners-2.0.0-py2-none-any.whl
Algorithm Hash digest
SHA256 78e3e1b982c37a79d2b636638b0470c7a353d16db15ea7aabf6d99cd2dd777d5
MD5 899573873a89333cb319df69d0f465e2
BLAKE2b-256 61782340e07845c2fa46fe139d0810d43703d508827b5ab9a2de7006cc3d41d3

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