• Stars
    star
    107
  • Rank 323,587 (Top 7 %)
  • Language
    C
  • License
    Apache License 2.0
  • Created over 4 years ago
  • Updated almost 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Reproduce CVEs from ForAllSecure Vulnerabilities Lab

ForAllSecure Vulnerability Labs

We open source our vulnerabilities after our responsible disclosure period has terminated. You will find:

  • A reproducible environment for building the vulnerable code inside docker.
  • Proof of concept artifacts that show how to trigger the discovered vulnerability.
  • (Optional) If you are a ForAllSecure Mayhem subscriber, you can run all of these locally.

We will be adding to this as find more bugs! Currently we have:

Please report any issues on the GitHub issue tracker. This is not an official ForAllSecure product.

Running from Dockerhub

All vulnerabilities are in pare-built images on our ForAllSecure Dockerhub account. The image name is the same as the directory name, prefixed with "forallsecure". For example, to run openssl-cve-2014-0160:

docker run forallsecure/openssl-cve-2014-0160

Mayhem Subscribers

Mayhem subscribers can run all examples within their Mayhem instance. The mayhemit.sh utility script helps with migration.

If you have access to dockerhub.com from your network:

./mayhemit.sh run

If you do not have access to dockerhub.com from your network, you will need to migrate the docker images to your local Mayhem docker repository, and rewrite the Mayhemfile to point to that registry. You can do this by running:

To start Mayhem fuzzing, you can use mayhem run, or use this script as follows:

mayhem run .

Building Locally

You can build and run the image locally. For example, if you are a researcher you can build the docker image to better understand the vulnerability.

To build:

./mayhemit.sh --build <directory>  # A single CVE
./mayhemit.sh --build --all        # Every CVE in this repository

Two notes:

  • You may need Mayhem to fuzz some targets. Mayhem supports binary-only fuzzing, network inputs (TCP & UDP), and many other features. Some targets, however, are libfuzzer or AFL. These you can fuzz yourself with the standard AFL or libfuzzer tool.

  • A single docker image includes multiple CVEs when they are all based on the same source code build.

If you are wondering what Mayhem runs, look in <dir>/mayhem/<name>/Mayhemfile. A Mayhemfile is a yaml file, and Mayhem fuzzing executes the cmd as given.

You always can run the vulnerable program/target locally. Run the docker image, and look at the associated cmd. E.g., for heartbleed, do:

host$ docker run -ti openssl-cve-2014-0160 bash
docker$ /build/handshake-fuzzer

Migrating to a closed network or your own Mayhem docker registry

These directions also apply to any Mayhem subscriber who does not wish to run the images from dockerhub (e.g., a closed network).

Migration steps:

  1. On a host with access to dockerhub, run:

    # Build all the images, rewriting the tag with your registry name.
    ./mayhemit.sh --all --save

    This will build all images, and save the docker images as tgz files.

  2. Tar up this entire directory with the previously saved docker images from the previous step. For example:

    cd .. && tar zcf vulnlabs.tgz ./vulnlabs
  3. Copy over the resulting tar file (e.g., vulnlabs.tgz) to your a host on the closed network. You must have docker installed on this machine as well, but no internet access is required.

  4. Untar the tar file on the closed network host:

    tar zxf vulnlabs.tgz
  5. Rewrite all the Mayhemfile files to point to your local docker registry, load up the images (the image is tagged with baseimage from the Mayhemfile), and push to your registry. It is important that you give the --rewrite flag first, as --load uses the registry baseimage directive in the Mayhemfile to determine the proper place to load the image:

    ./mayhemit.sh --all --rewrite \"your-registry:your-port/openssl-cve-2014-0160\" --load

    Replace openssl-cve-2014-0160 with the folder of the project you are analyzing.

  6. Test out a run, e.g.,:

    ./mayhemit.sh --run ./openssl-cve-2014-0160

More Repositories

1

bncov

Scriptable Binary Ninja plugin to enable automated coverage analysis and visualization
Python
122
star
2

rootfs_builder

Extract rootfs from a Docker image
Go
48
star
3

mayhem-examples

Mayhem example templates for programming languages and fuzzers that you love!
Dockerfile
27
star
4

mapi-action

πŸ€– Run a Mayhem for API scan in GitHub Actions
TypeScript
23
star
5

c2c-rapidfire-challenges

Challenges used at the Cambridge 2 Cambridge event
C
22
star
6

mcode-action

⏳ πŸ› Run a Mayhem for Code scan in GitHub Actions to automate security testing for your applications!
TypeScript
7
star
7

mapi-action-examples

πŸ€– Example showing how to run Mayhem for API in GitHub Actions
Python
6
star
8

cansecwest22

C
4
star
9

Mayhem-with-Jenkins-openssl-example

A fork of openssl to demonstrate Jenkins integration for fuzz testing with Mayhem by ForAllSecure, Inc.
C
4
star
10

mapi-examples

πŸ€– Examples for working with Mayhem for API
Rust
3
star
11

starter-testsuites

A collection of initial test cases (aka corpus) for various file formats.
JavaScript
3
star
12

fuzzing-essentials-federal

Dockerfile
2
star
13

api-fuzzer-swagger-petstore-demo

ForAllSecure API Fuzzer demonstration using swagger-petstore
Java
2
star
14

mapi-coverage-example

Demonstrate how Mayhem for API uncovers non-trivial endpoints with Coverage Guided Fuzzing
Python
2
star
15

keycloak-atlassian-identity-provider

Keycloak Identity Provider for Atlassian OAuth 2.0 (3LO) Applications
Java
2
star
16

mapi-grpc-example

πŸ€– Example showing how to run Mayhem for API against a gRPC server
Go
1
star
17

mapi-azure-pipelines-example

πŸ€– Example showing how to run Mayhem for API in Azure DevOps Pipelines
Python
1
star
18

mapi-circleci-orb

Shell
1
star
19

healthcare-ci-pipelines

An open-source collection of CI pipelines for healthcare software.
1
star
20

rules_mayhem

Bazel rules for generating Mayhemfiles
Starlark
1
star