Example #1
0
    def search_cve(self):
        """ basic search CVE identifiers """

        self.result = json.loads(Information(self.id).get_info())

        if self.result['description'] != []:
            return utility.serialize_data(self.result)
Example #2
0
    def load_data(self):
        """ load metadata related to vuln"""

        # loading data
        response = json.loads(Information(self.id).get_all())
        classification = json.loads(Classification(self.id).get_all())
        risk = json.loads(Risk(self.id).get_cvss())
        inspection = json.loads(Inspection(self.id).get_all())
        exploitation = json.loads(Exploitation(self.id).get_exploits())
        defense = json.loads(Defense(self.id).get_all())

        # formatting the response
        response.update(classification)
        response.update(risk)
        response.update(inspection)
        response.update(exploitation)
        response.update(defense)

        return response
Example #3
0
    def search_cve(self):
        """ basic search CVE identifiers """

        # set the CVE as uppercase
        self.id = self.id.upper()

        # check if valid CVE
        if not self.id.startswith('CVE-'):
            response = utility.serialize_error(False, self.id, "Not a valid CVE identifier")
            return response

        # load CVE data
        response = json.loads(Information(self.id).get_info())
        exploits = json.loads(Exploitation(self.id).get_exploits())

        if response['description'] != []:
            # new tag added to search whenever an exploits is available
            if exploits['exploitation'] != []:
                response.update(exploits)

            return utility.serialize_data(response)
Example #4
0
#!/usr/bin/env python3

# API Python wrapper for The Next Generation Vulnerability & Threat Intelligence Database  - https://vfeed.io
# Copyright (C) 2013 - 2019 vFeed IO

import json

cve = "CVE-2017-5715"

# loading a vulnerability information
from core.Information import Information

info = Information(cve).get_info()
# printing the response (by default in JSON)
print(info)

# now printing only Idenfitier or any other specific key
# first we load the response with json.loads
info = json.loads(info)

# Access to key values.
for key in info['description']:
    for source in key:
        values = key[source]
        if "id" in source:
            print(values)
        if "parameters" in source:
            print(values['published'])
            print(values['modified'])
            print(values['summary'])
Example #5
0
                        nargs=1)
    parser.add_argument("--plugin", metavar="Plugin name", type=str, help="Load third party plugins",
                        nargs=2)
    args = parser.parse_args()

    if args.version:
        ver = APIversion()
        print(ver.api_all_info())

    if args.update:
        update = Update()
        update.update()

    if args.information:
        id = args.information[0]
        print(Information(id).get_all())

    if args.classification:
        id = args.classification[0]
        from core.Classification import Classification
        #print(Classification(id).get_packages())
        print(Classification(id).get_all())

    if args.risk:
        id = args.risk[0]
        print(Risk(id).get_cvss())

    if args.inspection:
        id = args.inspection[0]
        print(Inspection(id).get_all())