This actually made me laugh a little bit as it brought me back to my college days. The first week of February every year was when the yearly OS class covered fork(), and as a result the compute clusters all over campus were basically unusable due to people trying to run their homework. Ahh, memories.
I am surprised by the attitude against what he did, both on reddit and even more so here. Afterall this is "hacker news" and the submission is called "hack your way...". Any definition of hacking that I know includes cleverly exploiting the limitations and boundary cases of a system. I see this attitude as part of a larger trend of "sandbox"-ification, "theme park"-ization of computing.
Once they've run this for a while, I'd love to see a post and screencast on some of the techniques needed to solve it. I don't know much about this subject, and I'd enjoy having a chance to learn in a setting unlikely to get me arrested.
I would also like to see a detailed explanation of how they prepared the box to safely allow people to play (ie logins, permissions, etc). How to restrict privileges yet allow just enough to make it varied and fun.
I'd love to see how people solved #2, and if they used any special tools like I did or if there's an easier way to do it. And I can't wait to delve deeper into #3 tomorrow :)
FYI: the worker process for level05 isn't working anymore (I'm pretty confident it was not me that broke it, btw ;P); even with the simple "hello friend" example (exactly as given in the MOTD on the account), the server always returns "job timed out" (it is now about 3am PST).
(edit:)
...and as of almost 3:30am PST, it is no longer possible to log in to the server. :( (...and while typing the next paragraph, I finally got in, but spawning processes is now taking forever, and the two-second job timeout has worked its way up to almost 5 seconds. Maybe another sill attack.)
(Regardless, overall this has been rather well put together, and quite fun. I taught a freshman class at UCSB/CSS today on "how absinthe, the iPhone 4S jailbreak works", and got a few of the students interested in trying out the CTF to see what they might learn by working on it.)
Just a word on level2, I don't think that's a hint, if you think so I'll remove this comment asap.
The login to get on the page is: level02 and the password is what you've found in level01. I.e. The challenge is not to crack that "Authorization required" dialog.
> This one is a web-based vulnerability, so go ahead and point your browser to XXXXX. You'll need to provide the password for level02 using HTTP digest authentication.
I read this back in college, ages ago. Still relevant - not quite up there with K&R as far as technical writing goes, but it does indeed do the job of making a theoretical problem into an understandable & exploitable one, and for that reason "Smashing the Stack For Fun And Profit" is a phrase that has a special place in my heart.
Guys, I gotta say, this is SO much fun! I am actually learning a ton, and while I'm only up to level 3, I feel this is such an awesome learning experience! Plus, I feel totally "leet" for figuring out levels 2 and 3. The world definitely needs more of these.
Same here, but I'm stuck on level 3 though...maybe my strategy is wrong. I am able to execute the function run from /levels/level03 with the following command:
cat /home/level04/.password
But I'm still getting access denied. I thought that would have done it for sure. The program runs under the following credentials:
I think someone decided to forkbomb it. I'm still logged on and every external command I type gets me "bash: fork: retry: Resource temporarily unavailable".
I was in there 5 minutes ago, did cat /levels/level02.c and then it stopped responding. I don't think cat could crash the server, but if it did, I'm sorry?
You should note that the SSH key has been changed.
$ dsocks.sh ssh [email protected]
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
Someone could be eavesdropping on you right now (man-in-the-middle attack)!
It is also possible that a host key has just been changed.
The fingerprint for the RSA key sent by the remote host is
74:67:32:4a:04:b8:9f:05:b6:e8:29:43:26:12:75:11.
Please contact your system administrator.
Add correct host key in /home/jcr/.ssh/known_hosts to get rid of this message.
Offending RSA key in /home/jcr/.ssh/known_hosts:8
RSA host key for ctf.stri.pe has changed and you have requested strict checking.
Host key verification failed.
It may be something harmless/simple like round-robin DNS combined with a failure to replicate the key, or more likely, someone has rooted the box.
EDIT: As confirmed by gdb and ab below, there's a good reason for the key change.
Any tips? I want to actually learn from this - I'm not just looking for the answers. But I've read wikipedia on setuid, googled around a bit, and am still not sure what to do.
level06@ctf6:/tmp/tmp.0fPRsmsetz$ /levels/level06 /home/the-flag/.password %%%%%%%%%
Welcome to the password checker!
........................
Wait, how did you know that the password was %%%%%%%%%?
Level 5 seemed too easy -- it seems like they forgot a much easier exploit. The code was carefully constructed in a way that suggested a pickle injection attack which required understanding the pickle stack machine, but you didn't need that.
Level 6 was interesting. Some people got it with a timing attack. I used a different, more elegant method with a hint from reddit.
I think the machine was actually hosed due to fork bomb. (I kept bumping the rlimits as more people logged in and ran up against nprocs, but the last time I clearly just bumped nprocs way too high. Live and learn....)
You certainly should be able to solve all of the levels without tons of brute force though.
[+] [-] tzs|14 years ago|reply
Anyone else not at all surprised who it is?
[+] [-] bmohlenhoff|14 years ago|reply
[+] [-] lkozma|14 years ago|reply
[+] [-] mhartl|14 years ago|reply
[+] [-] david_xia|14 years ago|reply
[+] [-] mirkules|14 years ago|reply
[+] [-] dividuum|14 years ago|reply
[+] [-] saurik|14 years ago|reply
(edit:)
...and as of almost 3:30am PST, it is no longer possible to log in to the server. :( (...and while typing the next paragraph, I finally got in, but spawning processes is now taking forever, and the two-second job timeout has worked its way up to almost 5 seconds. Maybe another sill attack.)
(Regardless, overall this has been rather well put together, and quite fun. I taught a freshman class at UCSB/CSS today on "how absinthe, the iPhone 4S jailbreak works", and got a few of the students interested in trying out the CTF to see what they might learn by working on it.)
[+] [-] mpetrov|14 years ago|reply
[+] [-] nviennot|14 years ago|reply
[+] [-] lurker17|14 years ago|reply
[+] [-] sdfjkl|14 years ago|reply
[+] [-] phzbOx|14 years ago|reply
The login to get on the page is: level02 and the password is what you've found in level01. I.e. The challenge is not to crack that "Authorization required" dialog.
[+] [-] spicyj|14 years ago|reply
> This one is a web-based vulnerability, so go ahead and point your browser to XXXXX. You'll need to provide the password for level02 using HTTP digest authentication.
so no, it's not the challenge. :)
[+] [-] mjijackson|14 years ago|reply
[+] [-] dthunt|14 years ago|reply
I read this back in college, ages ago. Still relevant - not quite up there with K&R as far as technical writing goes, but it does indeed do the job of making a theoretical problem into an understandable & exploitable one, and for that reason "Smashing the Stack For Fun And Profit" is a phrase that has a special place in my heart.
[+] [-] mirkules|14 years ago|reply
gcc -S -o example1.s example1.c
However, example1.s looks very different on Mac than on Linux, in particular, on Mac the parameters are pushed in reverse order:
Leh_func_begin2: ...
Whereas on Linux, they are pushed in the order specified in that link: What is the reason behind this? Is it that the stack on OS X is implemented to grow up instead of down?[+] [-] mirkules|14 years ago|reply
[+] [-] Rudisimo|14 years ago|reply
[+] [-] ianbishop|14 years ago|reply
Run till exit from #0 run (str=0xffece7ec "cat /home/level04/.password") at level03.c:53 cat: /home/level04/.password: Permission denied
Ah well, a sign to go to sleep. Tomorrow I'll have to learn more things to figure it out if it's still up.
[+] [-] olalonde|14 years ago|reply
[+] [-] farnsworth|14 years ago|reply
[+] [-] unknown|14 years ago|reply
[deleted]
[+] [-] starnix17|14 years ago|reply
[+] [-] luckygerbils|14 years ago|reply
This is why we can't have nice things.
[+] [-] mirkules|14 years ago|reply
[+] [-] jnorthrop|14 years ago|reply
[+] [-] sidolin|14 years ago|reply
Can someone share the source and program of the first level so we can have a look?
[+] [-] rottencupcakes|14 years ago|reply
[+] [-] heywire|14 years ago|reply
[+] [-] gqwo|14 years ago|reply
[+] [-] lftl|14 years ago|reply
[+] [-] jcr|14 years ago|reply
EDIT: As confirmed by gdb and ab below, there's a good reason for the key change.
[+] [-] le_isms|14 years ago|reply
https://gist.github.com/1890401
[+] [-] jetsnoc|14 years ago|reply
[+] [-] farnsworth|14 years ago|reply
[+] [-] jetsnoc|14 years ago|reply
[+] [-] jessepollak|14 years ago|reply
[+] [-] olalonde|14 years ago|reply
[+] [-] simon_weber|14 years ago|reply
[+] [-] chubot|14 years ago|reply
level06@ctf6:/tmp/tmp.0fPRsmsetz$ /levels/level06 /home/the-flag/.password %%%%%%%%% Welcome to the password checker! ........................ Wait, how did you know that the password was %%%%%%%%%?
Level 5 seemed too easy -- it seems like they forgot a much easier exploit. The code was carefully constructed in a way that suggested a pickle injection attack which required understanding the pickle stack machine, but you didn't need that.
Level 6 was interesting. Some people got it with a timing attack. I used a different, more elegant method with a hint from reddit.
Very well done, stripe.
[+] [-] chrisacky|14 years ago|reply
Which by the looks of things, level03 is the furthest anyone is based on logs.
> [32041.680408] level03[17009]: segfault at ffdc50c4 ip 00000000080487b2 sp 00000000ffe0aee0 error 4 in level03[8048000+1000]
[+] [-] tlb|14 years ago|reply
[+] [-] unknown|14 years ago|reply
[deleted]
[+] [-] jcromartie|14 years ago|reply
[+] [-] unknown|14 years ago|reply
[deleted]
[+] [-] unknown|14 years ago|reply
[deleted]
[+] [-] unknown|14 years ago|reply
[deleted]
[+] [-] gdb|14 years ago|reply
You certainly should be able to solve all of the levels without tons of brute force though.
[+] [-] zx2c4|14 years ago|reply
Don't look at this if you actually want to enjoy the contest.
http://pastebin.com/VJ4xpawq