diff --git a/README.md b/README.md index 26dce03..6a38688 100644 --- a/README.md +++ b/README.md @@ -31,6 +31,7 @@ For more information: [Extending MISP with Python modules](https://www.misp-proj * [CIRCL Passive SSL](misp_modules/modules/expansion/circl_passivessl.py) - a hover and expansion module to expand IP addresses with the X.509 certificate(s) seen. * [countrycode](misp_modules/modules/expansion/countrycode.py) - a hover module to tell you what country a URL belongs to. * [CrowdStrike Falcon](misp_modules/modules/expansion/crowdstrike_falcon.py) - an expansion module to expand using CrowdStrike Falcon Intel Indicator API. +* [CPE](misp_modules/modules/expansion/cpe.py) - An expansion module to query the CVE Search API with a cpe code, to get its related vulnerabilities. * [CVE](misp_modules/modules/expansion/cve.py) - a hover module to give more information about a vulnerability (CVE). * [CVE advanced](misp_modules/modules/expansion/cve_advanced.py) - An expansion module to query the CIRCL CVE search API for more information about a vulnerability (CVE). * [Cuckoo submit](misp_modules/modules/expansion/cuckoo_submit.py) - A hover module to submit malware sample, url, attachment, domain to Cuckoo Sandbox. diff --git a/doc/README.md b/doc/README.md index 1225780..2245c3c 100644 --- a/doc/README.md +++ b/doc/README.md @@ -222,6 +222,27 @@ Module to expand country codes. ----- +#### [cpe](https://github.com/MISP/misp-modules/tree/master/misp_modules/modules/expansion/cpe.py) + + + +An expansion module to query the CVE search API with a cpe code to get its related vulnerabilities. +- **features**: +>The module takes a cpe attribute as input and queries the CVE search API to get its related vulnerabilities. +>The list of vulnerabilities is then parsed and returned as vulnerability objects. +> +>Users can use their own CVE search API url by defining a value to the custom_API_URL parameter. If no custom API url is given, the default cve.circl.lu api url is used. +> +>In order to limit the amount of data returned by CVE serach, users can also the limit parameter. With the limit set, the API returns only the requested number of vulnerabilities, sorted from the highest cvss score to the lowest one. +- **input**: +>CPE attribute. +- **output**: +>The vulnerabilities related to the CPE. +- **references**: +>https://cve.circl.lu/api/ + +----- + #### [crowdstrike_falcon](https://github.com/MISP/misp-modules/tree/master/misp_modules/modules/expansion/crowdstrike_falcon.py) diff --git a/misp_modules/modules/expansion/cpe.py b/misp_modules/modules/expansion/cpe.py index 9298876..8ea0f65 100644 --- a/misp_modules/modules/expansion/cpe.py +++ b/misp_modules/modules/expansion/cpe.py @@ -88,7 +88,7 @@ class VulnerabilitiesParser(): def check_url(url): - return "{}/".format(url) if not url.endswith('/') else url + return url if url.endswith('/') else f"{url}/" def handler(q=False):