This guide will show you how to get started with Mayhem using the web interface.
Time to complete: About 5 minutes
Create a new account by navigating to mayhem.forallsecure.com and select sign in with GitHub:
On the GitHub sign in page, enter your GitHub credentials or click Create an account:
If you're creating a new GitHub account, follow the onscreen instructions.
In either case, if you're creating a new account or logging in with an existing account, you should eventually be prompted to authorize Mayhem. Click "Authorize ForAllSecure".
Let's reproduce an exploit for lighttpd! (version 1.4.15, to be specific).
- Create a new project by clicking the "plus" icon at the top of the screen.
- On the Choose Image page, enter the following:
forallsecure/lighttpd:vulnerable
. - Once you've entered the image, click Next.
There are two tabs of analysis options: Basic and Advanced. We will be configuring three values:
- Under Basic, set the analysis to run 90 seconds.
- Under Advanced, enable the Advanced Triage option and the Code Coverage task.
Click the start run button at the bottom of your screen to begin analysis!
The run will take a few minutes to complete, as analysis and post-analysis processing need to finish. Once the run completes, the web page should look similar to this:
Congratulations!
You've just:
- Learned how to start a new Mayhem analysis job using the web interface.
- Found your first exploitable bug using Mayhem!
This guide will show you how to start a run using the Mayhem CLI.
Time to complete: About 5 minutes
Before using the Mayhem CLI, you need to install it. Fortunately, Mayhem provides instructions for you.
- Click on "Download Mayhem CLI"
- Follow the on-screen instructions.
The mayhem
CLI authenticates to the Mayhem server using an API token. The API
token can be generated in your profile settings: located in the top-left under your username, then "Settings", then "API Tokens".
- Open your settings.
- Select API Tokens.
- Click "Issue New Token".
- Enter a name for the Token.
- Copy the CLI Command.
At this point the entire login command has been copied to your clipboard. Paste this into a terminal window.
The command should look similar to this:
mayhem login https://mayhem.forallsecure.com/ <YOUR API KEY>
Clone the cansecwest22 repo and change into the lighttpd directory.
git clone https://github.com/ForAllSecure/cansecwest22
cd cansecwest22/lighttpd/
For this tutorial, no changes to the Mayhemfile are neccesary. We're starting the same run as in lab 1a, but this time with the CLI.
mayhem run .
You should see output that looks similar to this:
WARNING: corpus is not a file or directory, skipping
Run started: tutorial/lighttpd/2
Run URL: https://training.forallsecure.com:443/nathan/tutorial/lighttpd/2
tutorial/lighttpd/2
Note the warning regarding the corpus directory is normal for this tutorial.
Navigate to the Web interface for this run by clicking on the "Run URL" from the output in the VM's shell.
Like lab 1a, the run may take a few minutes to complete, as analysis and post-analysis processing need to finish. Once the run completes, the web page should look similar to this:
Congratulations!
You've just:
- Learned how to start a new Mayhem analysis job using the CLI.
- Learned how to find a run in the UI after starting it with the CLI.