-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from ForAllSecure/add-package
Add package
- Loading branch information
Showing
8 changed files
with
295 additions
and
153 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,3 +2,4 @@ bazel-bin | |
bazel-out | ||
bazel-rules_mayhem | ||
bazel-testlogs | ||
pkg |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,49 +1,45 @@ | ||
# Mayhem by https://forallsecure.com | ||
# Mayhemfile: configuration file for testing your target with Mayhem | ||
# Format: YAML 1.1 | ||
{VERSION} | ||
|
||
# Project name that the target belongs to | ||
project: {PROJECT} | ||
project: xansec/ubuntu | ||
|
||
# Target name (should be unique within the project) | ||
target: {TARGET} | ||
target: ubuntu-latest | ||
|
||
# Base image to run the binary in. | ||
image: {IMAGE} | ||
image: ubuntu | ||
|
||
# Turns on extra test case processing (completing a run will take longer) | ||
{ADV_TRIAGE} | ||
{DURATION} | ||
{TASKS} | ||
{TESTSUITE} | ||
{UID} | ||
{GID} | ||
advanced_triage: false | ||
|
||
# List of commands used to test the target | ||
cmds: | ||
|
||
# Command used to start the target, "@@" is the input file | ||
# (when "@@" is omitted Mayhem defaults to stdin inputs) | ||
- cmd: {COMMAND} | ||
env: {ENV} | ||
{LIBFUZZER} | ||
{AFL} | ||
{HONGGFUZZ} | ||
{SANITIZER} | ||
{CWD} | ||
{FILEPATH} | ||
{SECOND_COMMAND} | ||
|
||
- cmd: /bin/bash | ||
env: {} | ||
libfuzzer: true | ||
extensions: {} | ||
|
||
## Uncomment to change default dir (/) from which the target is invoked | ||
#cwd: / | ||
|
||
## If this is a network target, uncomment the block below and remove | ||
## the @@ input file reference in the cmd (you can either test network or | ||
## file inputs, not both). | ||
#network: | ||
## Use "127.0.0.1" instead of "localhost" below if you want to test only | ||
## for IPv4. For IPv6, use "[::1]". By leaving as "localhost", Mayhem will | ||
## attempt to autodetect the one used by the target. | ||
{NETWORK} | ||
# url: tcp://localhost:8080 # protocol, host and port to analyze | ||
# client: False # target is a client-side program | ||
# timeout: 2.0 # max seconds for sending data | ||
|
||
## Max test case length (in bytes) to be taken into account. Test cases over | ||
## that length will be truncated. Be very careful about increasing this | ||
## limit as it can severely affect your fuzzer performance. | ||
{MAX_LENGTH} | ||
{CMD_TIMEOUT} | ||
{MEMORY_LIMIT} | ||
{DICTIONARY} | ||
# max_length: 8192 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
#include <stdio.h> | ||
#include <stdlib.h> | ||
#include <string.h> | ||
|
||
int mayhemit(char *buf) | ||
{ | ||
if(strlen(buf) >= 3) | ||
if(buf[0] == 'b') | ||
if(buf[1] == 'u') | ||
if(buf[2] == 'g') { | ||
printf("You've got it!"); | ||
abort(); | ||
} | ||
return 0; | ||
} | ||
|
||
int main(int argc, char *argv[]) | ||
{ | ||
FILE *f; | ||
char buf[12]; | ||
|
||
if(argc != 2){ | ||
fprintf(stderr, "Must supply a text file\n"); | ||
return -1; | ||
} | ||
f = fopen(argv[1], "r"); | ||
if(f == NULL){ | ||
fprintf(stderr, "Could not open %s\n", argv[1]); | ||
return -1; | ||
} | ||
if(fgets(buf, sizeof(buf), f) == NULL){ | ||
fprintf(stderr, "Could not read from %s\n", argv[1]); | ||
return -1; | ||
} | ||
mayhemit(buf); | ||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,5 +8,3 @@ bzl_library( | |
name = "mayhem", | ||
srcs = ["mayhem.bzl"], | ||
) | ||
|
||
exports_files(["mayhemfile.template"]) |
Oops, something went wrong.