Skip to content

GSoC 2021 idea: Checker creation helper scripts #1063

@terriko

Description

@terriko

While writing #1062 I suggested that we could look in to providing some scripts to simplify the process of checker creation, specificially because windows users don't have access to all the same utility scripts we use, and a lot of that functionality is already built into the tool.

But I think we might want to do this in a grander scale: what would a helper tool for new checkers look like?

Input: a set of .rpm, .deb, .tar.gz or other files that represent packaged versions of the software to be detected, including the product name and version you're expecting to find in each. (similar to what we put in our long tests). You'd specifically want multiple versions of the same product here, so we could tell if a string was actually common across versions or not.

Output:

  • a list of common binary filenames found in all packages (maybe filtered for "this is likely to just be a man page" and "this is just a really common filename" type stuff)
  • a list of common strings that could maybe be used to indicate the presence of this library (again, heuristically filtered for stuff that's less likely to be a false positive, so probably longer strings with more human-readable words and ones that include the product name)
  • a list of strings that contain version numbers (as candidate for version detection patterns)

Basically, start by automating the process found in the checkers README to get some candidate strings, maybe even formulate the output as a full checker to minimize cut/paste errors.

Once you get that working, you could probably iterate to make it better:

  • make a utiltiy to check a candidate checker against existing packages (maybe even all the test files we have?) and filter out any suggestion that might generate false positives
  • use the utility to figure out a list of common false postitive filenames/patterns that occur in many files
  • try to guess actual simple regexes for version number detection (based on the numbers found in the NVD database)
  • once you start to know what "really common filename" looks like, add tests in cve-bin-tool to warn if the checker detects them
  • look at some of the "signature needs work" checkers where a signature couldn't be found and see if you can develop something based on strings that vary from version to version.

In the course of writing this tool, I expect you'd be able to add new checkers as you built and tested to cve-bin-tool as well.

Metadata

Metadata

Assignees

No one assigned

    Labels

    gsocTasks related to our participation in Google Summer of Code

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions