Skip to content

The goal is to overwrite the value of the variable modified by giving a long input to gets(buffer).

I used the source code from the protostar stackzero to perform the modification

Qemu system has been install throgh firefox from VM

Then I booted the qemu through Ubuntu VM to start the assignment from protostar

I used the code to check file in the bin and run to see it

/opt/protostar/bin
ls -l stack0
-rwsr-xr-x 1 root root ... stack0

The above code shows that the file and exercise for stack0 exist. The final result after the source code has been inputed in the protostar shows that the variable has been modified.

What does “Segmentation fault” mean?

A Segmentation fault (Segfault) happens when a program tries to access memory that it is not allowed to access.

For example: - Writing to protected memory - Jumping to an invalid address - Overwriting a return address and changing program execution

During a buffer overflow, if we overwrite important stack information such as: return address

Example: Segmentation fault (core dumped) means: The operating system stopped the program because it attempted an illegal memory operation.