L1im1tL355
Last updated
Was this helpful?
Last updated
Was this helpful?
Just pwn this program and get a flag. Its also found in /problems/l1im1tl355_3_d7480b654799978caea481ab65d5bbea on the shell server. Source.
Looking at the I notice the replaceIntegerInArrayAtIndex()
function looks interesting since it is simply a wrapper around the built-in method of changing an element of an array.
This program declares an array on the stack, then allows us to write a DWORD to any array index. If we choose an index between 0
and 666/4
(DWORD is 4 bytes long), we'll end up writing to the array. There are no checks on the index value for the array, so we should be able to go out of bounds and write anywhere to memory. We can input the address of the win()
function as the "integer value you want to put in the array" and for the "index in which you want to put the value", we can input the offset from the array to the return address of replaceIntegerInArrayAtIndex()
.
Layout of stack ():
The script bruteforces the offset and finds it to be -5
.
Run the python script.py USER=<username> PASSWORD=<password>
:
picoCTF{str1nG_CH3353_3fe0db39}