Code Monkey home page Code Monkey logo

cve-bin-tool's Introduction

CVE Binary Tool

Build Status codecov Gitter Code style: black On PyPI

The CVE Binary Tool scans for a number of common, vulnerable open source components (openssl, libpng, libxml2, expat and a few others) to let you know if a given directory or binary file includes common libraries with known vulnerabilities. (If you have a list of components with versions and want a list of CVEs, check out csv2cve below.)

Usage: cve-bin-tool <flags> <path to directory>

You can also do python -m cve_bin_tool.cli <flags> <path to directory> which is useful if you're trying the latest code from the cve-bin-tool github.

  -h, --help            show help message and exit
  -V, --version         show program's version number and exit


  Output options:
  -q, --quiet           suppress output
  -l {debug,info,warning,error,critical}, --log {debug,info,warning,error,critical}
                        log level. The default log level is info
  -o OUTPUT_FILE, --output-file OUTPUT_FILE
                        provide output filename (default: output to stdout)
  -f {csv,json,console}, --format {csv,json,console}
                        update output format (default: console)


  Functional options:
  -x, --extract         autoextract compressed files
  -s SKIPS, --skips SKIPS
                        comma-separated list of checkers to disable
  -r CHECKERS, --runs CHECKERS
                        comma-separated list of checkers to enable
  -m, --multithread     enable multithread
  -u {now,daily,never}, --update {now,daily,never}
                        update schedule for NVD database. Default is daily.

The 0.3.1 release is intended to be the last release to officially support python 2.7; please switch to python 3.6+ for future releases and to use the development tree. You can check our CI configuration to see what versions of python we're explicitly testing.

This readme is intended to be a quickstart guide for using the tool. If you require more information, there is also a user manual available.

How it works

This scanner looks at the strings found in binary files to see if they match certain vulnerable versions of the following libraries and tools:

  • binutils
  • bluez
  • bzip2
  • curl
  • expat
  • ffmpeg
  • gnutls
  • gstreamer
  • hostapd
  • icu
  • kerberos
  • libcurl
  • libdb
  • libgcrypt
  • libjpeg
  • libnss
  • libtiff
  • ncurses
  • ngnix
  • node.js
  • openssh
  • openssl
  • png
  • python
  • rsyslog
  • sqlite
  • strongswan
  • syslogng
  • systemd
  • varnish
  • xerces
  • xml2
  • zlib

All the checkers can be found in the checkers directory, as can the instructions on how to add a new checker. Support for new checkers can be requested via GitHub issues.

Limitations

This scanner does not attempt to exploit issues or examine the code in greater detail; it only looks for library signatures and version numbers. As such, it cannot tell if someone has backported fixes to a vulnerable version, and it will not work if library or version information was intentionally obfuscated.

This tool is meant to be used as a quick-to-run, easily-automatable check in a non-malicious environment so that developers can be made aware of old libraries with security issues that have been compiled into their binaries.

Requirements

To use the auto-extractor, you may need the following utilities depending on the type of file you need to extract. Belows are required to run the full test suite on linux:

  • ar
  • cabextract
  • cpio
  • rpm2cpio

Most of these are installed by default on many Linux systems, but cabextract and rpm2cpio in particular might need to be installed.

On windows systems, you may need:

  • ar
  • 7z
  • Expand

Windows has ar and Expand installed in default, but 7z in particular might need to be installed. If you wan to run our test-suite or scan a zstd compressed file, We recommend installing this 7-zip-zstd fork of 7zip. We are currently using 7z for extracting jar, apk, msi, exe and rpm files.

CSV2CVE

The CVE Binary Tool package also includes a tool called csv2cve which is a helper tool that allows you to search the local database for a list of known products. This can be useful if the list of products is known.

Usage: csv2cve <csv_file>

The CSV file must contain the following columns: vendor,product,version where the vendor and product names are exact matches to the strings in the National Vulnerability Database. You can read more about how to find the correct string in the checker documentation, and the csv2cve manual has more information on using this tool.

Note that csv2cve, unlike cve-bin-tool, will work on any product known in the National Vulnerability Database, not only those that have checkers written.

Feedback & Contributions

Bugs and feature requests can be made via GitHub issues. Be aware that these issues are not private, so take care when providing output to make sure you are not disclosing security issues in other products.

Pull requests are also welcome via git.

The CVE Binary Tool uses the Black python code formatter to keep coding style consistent; you may wish to have it installed to make pull requests easier. We've provided a pre-commit hook (in .pre-commit.config.yaml) so if you want to have the check run locally before you commit, you can install pre-commit and install the hook as follows from the main cve-bin-tool directory:

pip install pre-commit
pre-commit install

Security Issues

Security issues with the tool itself can be reported to Intel's security incident response team via https://intel.com/security.

If in the course of using this tool you discover a security issue with someone else's code, please disclose responsibly to the appropriate party.

cve-bin-tool's People

Contributors

aanchal-n avatar ableabhinav avatar akechishiro avatar ananthan-123 avatar anthonyharrison avatar bksahu avatar brainwane avatar captaindavinci avatar freeshabh avatar giridharprasath avatar mariuszskon avatar niraj-kamdar avatar nitishsaini706 avatar oh6hay avatar param211 avatar pdxjohnny avatar prajwalm2212 avatar purvanshsingh avatar rossburton avatar sakshatshinde avatar sanketsaurav avatar sannanansari avatar saurabhk122 avatar sbs2001 avatar shreyamalviya avatar singhhrmn avatar svnv avatar terriko avatar utkarsh261 avatar wzao1515 avatar

Watchers

 avatar

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.