Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a 'c' program to fuzz a fuzz a function in binary ( a specific function in binary) using libfuzzer? The inputs to the program

Write a 'c' program to fuzz a fuzz a function in binary ( a specific function in binary) using libfuzzer?

The inputs to the program is binary and the function address .

void* handler = dlopen("./libcrackme.so", RTLD_LAZY); // libcrackme.so is the shared binary and using dynamic linking for linking the binary

0x11a9 - this is the function address in hexadecimal.

extern "C" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) // fuzzer function

//C code

#include
#include  
#include  

#define NOINLINE __attribute__ ((noinline))

NOINLINE int check_found(char* input) {
if (strcmp(input, "easy") == 0) {
return 1;
}
return 0;
}

int main(int argc, char** argv) {

if (argc != 2) {
printf("Usage: %s flag", argv[0]);
exit(-1);
}

if (check_found(argv[1])) {
printf("Well done!");
} else {
printf("Wrong!");
}
return 0;

}

The above is the target c program and check_found is the target function to fuzz

Step by Step Solution

3.46 Rating (156 Votes )

There are 3 Steps involved in it

Step: 1

include FuzzerDataFlowTraceh include FuzzerCommandh include FuzzerIOh include FuzzerRandomh include FuzzerSHA1h include FuzzerSHA1h include FuzzerUtilh include include include include include include ... blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Thermodynamics An Engineering Approach

Authors: Yunus A. Cengel, Michael A. Boles

8th edition

73398179, 978-0073398174

More Books

Students also viewed these Computer Engineering questions

Question

In your opinion, who should define normal versus abnormal behavior?

Answered: 1 week ago