Exploit 300 CSAW 2013
Credit to Ryan
The first thing we did for this challenge was to look at the program headers:
From the headers we can see that the stack is given read, write, and execute permission therefore assuming the stack has enough space and we can overflow the buffer we should be able to place and execute shell code on the stack. Looking at the assembly in IDA pro we see a few interesting lines.
From the assembly we can also calculate what the stack will look like at run time:
We learned from reverse engineering the assembly the program is going to do the following:
- Prompt for username and password
- Compare the received username and password against “csaw2013” and “S1mplePWD”
- Prompt for entry number
- Verify that entry number is not zero
- Verify the entry number + 1 is less than or equal to 1024
- Prompt for dairy input (using entry number as the number of bytes to receive)
- Create a dairy file
- Save the input bytes into diary file
- Delete the dairy file
- Return
From here we wrote a script to send the shellcode that opens a bind shell on the remote server. To connect to the server and cat the key.
Flag = signness_oh_what_a_world_we_live_in
No comments:
Post a Comment