Question: Description: bof _ practice is a precompiled program that asks the user for a serial string and prints out CORREC SERIAL if the serial string
Description: bofpractice is a precompiled program that asks the user for a serial string and prints out CORREC SERIAL if the serial string is correct and prints out INCORRECT SERIAL otherwise. This file was compiled without source code and stack protection and of course, is vulnerable to buffer overflow. Note: you will need to turn off virtual address randomization inside SEED Ubuntu Image.
Goal: The goal of this practice is to exploit the program to let it print out CORRECT SERIAL Note: A Segmentation fault is fine if the program prints out the desired message.
Tasks: Present three methods to exploit buffer overflow to archive the goal.
Submission format: Answer the following questions for each method. Include screenshots and gdbbash commands to support your answer
What is your approach?
What data eg internal variables, adjacent buffer, return address, etc. do you want buffer overflow to overwrite? Why? Where are they located on the stackheap
What is your attack vector? And why?
Were you successful in exploiting buffer overflow to achieve the goal? Whywhy not?
This is solutions for the first one:
Method $ echo $perl e 'print axb inputbofpracticeatxt
Method $ echo $perl e 'print axax& inputbofpracticebtxt
Method $ echo $perl e 'print axxcbxxx inputbofpracticectxt
C code:
#include
#include
void printOK
printfCORRECT SERIAL
;
int checkPasschar passstr
int ok ;
long xx ;
char passlocal;
strcpypasslocal, passstr;
if ok x xx x
return ;
else
if passlocal# && passlocal@
return ;
return ;
int mainint argc, char argv
printfEnter your serial number chars max: ;
char pass;
scanfs pass;
if checkPass pass
printOK;
else
printfWRONG SERIAL
;
return ;
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
