Favorite Color
60 points Medium

What's your favorite color? Would you like to share with me? Run the command: ssh [email protected] -p 1001 (pw: guest) to tell me!

Flag
Rating 4.70
5
4
3
2
1

Discussion

difficult

0

I got to admit that thekidofarcrania gives the best opportunities to learn new things!

0

I had some weird issues with the server yesterday. I got the shell, but when I entered the command to show the flag, I just got a segmentation fault. Tried it today, and everything worked fine (executed the same commands as yesterday).

0
Protected
-1

If you think you've got your solution, try it outside of GDB! (Learnt this the hard way ...)

0
Protected
0

very difficult

0

I tested it on my local machine. But buf is ABOVE good. So with a buffer overflow I cannot get to an address below the starting point. What am I missing?

0

Maybe you don't need to alter the "good" variable.

1
Protected
2
Protected
0

Hmm ... I always get that: Enter your favorite color: Me too! That's my favorite color too! You get a shell! Flag is in flag.txt Segmentation fault (core dumped) It seems the process does not have enough privilege to call system() and a shell is not spawned. That is why it goes to the normal path and crashes with segfault when the stack is restored. You might want to revisit the permissions on the guest user.

1

I have got the same problem :/

1

I got the same output, And it took me way too long to overcome this error, but it is not a problem with the CTF. it is possible to get a shell. if you get this error, you missed something.

0

I know the problem is, you have got the shell but your input has reached EOF so shell will exit immediately. Example if you type something like "./color < payload", input will stopped since it has reached EOF. In order to fix this try "(cat payload -) | ./color", this command will not make the shell exit immediately because input from payload continue to stdin. Hope it help you all. I waste 2 hours man to figure out what's the problem

10