Code Monkey home page Code Monkey logo

stix-cvebuilder's Introduction

Copyright (c) 2016 Crown Copyright (NCSC)

Permission is hereby granted, free of charge, to use, copy, modify, merge, distribute and/or sub-licence the software together with any associated documentation provided that it is solely for your own internal use and subject to the following conditions:

(1) The above copyright notice and this permission notice shall be included in all copies or substantial portions of the software.

(2) THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN ANY ACTION FOR CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

CVE-Builder

Code Health

CVE Builder script that generates STIX Exploit Targets.

The script will look at the first parameter as the CVE number and uses the ares module (https://github.com/mrsmn/ares), to provide data from https://cve.circl.lu/. This provides a quick and easy method of prototyping the core information from publicly available CVE information into a STIX package.

Once generated the script has support for ingestion using the NCSC Edge mods or using native TAXII. If neither of these methods are required then the script will dump the XML into the current directory of the script.

Status

The script is still under active development and as such shouldn't be considered a finished product.

Setup

To install the script you can clone the repository using git clone.

Before using the script you will need setup the config file with your own settings:

  1. Make a copy of the config.json.template file and rename it to config.json.
  2. Enter your own settings inside your config.json file.
  • The coas key defines any COAs you would like to relate to your ET object.
  • The ttp key defines if you want TTP objects to be built as part of the package.
  • The stix key defines your namespace and prefix.
  • The ingest key defines settings related to API ingestion.
  • The taxii key defines settings related to TAXII inboxing.

Once setup your file should look like this:

{
  "coas": [
    {
      "id": "avengers:coa-0c6e0337-18bc-4f58-a712-5fd743565180"
    }
  ],
  "ingest": [
    {
      "active": false,
      "endpoint": "http://kb.avengers.com/adapter/certuk_mod/import/",
      "user": "bot"
    }
  ],
  "stix":
    {
      "ns": "http://avengers.com",
      "ns_prefix": "avengers",
      "handling": "This information may be distributed without restriction."
    },
  "taxii": [
    {
      "active": false,
      "binding": "urn:stix.mitre.org:xml:1.1.1",
      "discovery_path": "/taxii-discovery-service",
      "host": "kb.avengers.com",
      "inbox_path": "/taxii-data",
      "password": "password",
      "ssl": false,
      "username": "username"
    }
  ],
  "ttp": false
}

Usage

From a terminal/command prompt you can use the -h option to get an output of the available arguments.

$ python cvebuilder.py -h
usage: cvebuilder.py [-h] [-i ID] [-l]

Search for a CVE ID and return a STIX formatted response.

optional arguments:
  -h, --help      show this help message and exit
  -i ID, --id ID  Enter the CVE ID that you want to grab
  -l, --last      Pulls down and converts the latest 30 CVEs

To get a single CVE ID returned you would use the following command.

$ python cvebuilder.py -i CVE-2015-5119

Or if you wanted to get the last 30 CVE IDs.

$ python cvebuilder.py -l

Both of these commands will generate the STIX file for the CVE ID unless you have enabled either the TAXII or CERT-UK Ingest options in the config.json file.

Or you can use it as a module within your own script.

from cve-builder import cveSearch

result = cveSearch("CVE-2015-5119")
print(cveSearch)

Example Output

An example output can be found in the Example file. This example uses CVE-2015-5119.

Dependencies

The following python libraries are required and can be installed with pip.

Installation

$ sudo pip install -r requirements.txt

Feedback

We would welcome feedback on this script and the functionality it provides. Please raise an issue on GitHub.

stix-cvebuilder's People

Contributors

cwtaylor avatar zebde avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

stix-cvebuilder's Issues

Help menu on blank call

When calling the script without any command line arguments the script should present the user with the help menu.

Tidy up and refactor code

Time has passed, lets refactor some of the code and make it look and perform better.

Remove the submodule integration.

Error checking for invalid CVE

Currently if the user enters an invalid CVE or a CVE that doesn't exist the program passes over it and returns no feedback.

Modify to provide feedback to the user.

Add example to the repository

Add example to the repository of a fully fledged STIX package that is built using the tool to show people what they are missing?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.