Download binary file, open with IDA and HexRay, i have:
Program prompts user to input a string, then saved to v4.
Seem like there is a buffer over flow here.
So, we should fill the junk data to the string then overwrite return address to execute shellcode.
Have a look at the below code again, we can calculate the length of string (0x80 or 128)
However, we have other issue. The program uses v5 to verify and avoid overflowing the buffer.
I use gdb-peda to view stack, find out the value which is used to verify.
I use the following 24 bytes to append 128 junk bytes of payload
0x475a31a5 0x40501555 0x00000000 0xf7fc8000 0x00000000 [new-return-address]
What is ‘new-return-address’ ?
Do you remember the gift, which program give us everytime we try to run the binary ? It is address of first byte of payload. So, we can put our shellcode there, and put that address to new-return-address