Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Securing Stripe's Capture the Flag (gregbrockman.com)
135 points by gdb on Aug 27, 2012 | hide | past | favorite | 36 comments


Thanks for putting this together. Was very educational working through each level (and felt great to capture the flag). Loved that it was spread out across node.js/python/ruby/php/javascript.

Were any unexpected security vulnerabilities found (or patched mid-game by you) in the overall infrastructure?

Not sure if this was intentionally left open-ended but for example in Level 6 I exploited a Ruby session/cookie bug to gain access to the target user, before realizing that the easier way was just a simpler JavaScript XSS vulnerability.


There were a few unintentional vulnerabilities in the levels. Only one actually made the levels significantly easy enough that it was worth patching -- namely, the session cookie bug you reference (it actually affected three levels). There was also a bug in the CTF architecture where you could set your user's URL to a javascript: URL. But to my knowledge no one has found vulnerabilities in the rest of the infrastructure :).


And the ruby regex newline vulnerability that featured in one of the later XSS levels was also present in an earlier level, but wasn't necessary for the intended vector, so I wondered if it was an unintentional oversight, or left as an alternate exploit, or just a red-herring? (being intentionally vague so as not to spoil it for anyone...)


Actually, it wasn't supposed to be there in any of the levels :).


I was one of the ones who went through those three levels with the session cookie bug. How many people reported it? Do you have a problem with me posting a write-up on the bug somewhere (now that it's fixed)?


We fixed it as soon as it was reported, and have probably gotten four or five independent reports at this point. Feel free to post away!


I also used that bug for the three levels. At that time I was more concerned in catching up (I started late) and the thought of it being an unintentional bug never crossed my mind. Though hours later I thought it was a bit strange that all three levels had to be solved in a similar way.


I'd love to read a write-up of this bug if you get a chance.


There was the unintended XSS on level02 - granted, you could only XSS yourself, but having a space in the filename you could inject whatever you wanted. :)


There was an issue where a user could steal the nickname of other users. https://twitter.com/homakov/status/239061158043213824 https://twitter.com/homakov/status/239107933290520576

It looks like homakov had a little fun with it (the guy who griefed github a bit half a year ago with their whitelisted attributes vulnerability and got the rails core team to put whitelisting on by default).


heart attack

Thought for a minute after seeing the headline maybe the CTF was closed... I'd have thrown many (more) monitors out the window if I didn't get to finish lvl8 after spending so long on it...or at least ditch a few more monitors trying to finish it.


Thanks for the writeup - while going through the levels, I was wondering how some of this stuff was set up from the game-master's perspective.

This was really fun to play, and I learned a thing or two (specifically the manner in which you solve #7 was totally new to me).

Thanks for putting the CTF together!


Next time, use grsecurity & pax. No excuses not to. Kernel hardening that you must absolutely have on a shared box.

http://grsecurity.net/ http://en.wikibooks.org/wiki/Grsecurity http://en.wikipedia.org/wiki/Grsecurity http://en.wikipedia.org/wiki/PaX

Grsec's RBAC isn't strictly necessary, but it's quite nice too.


The CTF was one of the more educationally useful things I've done in a while, thanks!


You guys did an awesome job, great stuff to waste some evenings on. It's nice to read about all these measures, especially since I've already noticed most of them while capturing the flag :)


Really enjoyed the CTF, thanks for hosting it! Had to run my code twice to get the last chunk on level 8, not sure why though... Was it jitter? Also, will you be sending confirmation e-mails for the t-shirts?


I'll avoid posting spoilers here, but feel free to shoot me an email (gdb@stripe.com) if you want to discuss more. We will indeed send out confirmation emails for the shirts -- you'd be surprised by how many people typo their addresses.


Assuming you used the same strategy I am using now for level 8 (and which seemed popular on the IRC channel), I think the method for determining the other chunks doesn't work for the last one, since it is the last one in the series.


Awesome write up and awesome challenge - look forward to the next one!


Great job on the CTF, had only minor issues with level 8 because of the traffic (which made it more of a challenge) and I was wondering how you guys did the XSS vulns, really nice job!


Greg, I'm sorry I can't comment on the original article I don't have a FB account.

What was the amount of traffic at peak times between level 2 and 8?


I don't have numbers on that. We did have level02-2 hitting load 100 at one point, though. Also, from the first level08 server we put into the pool:

root@leveleight2:~# ifconfig eth0 |tail -n 2 RX bytes:8200746652 (8.2 GB) TX bytes:27399989757 (27.3 GB)


Thank you


Stripe CTF made me feel like I was in college again! It was a good feeling.


CTF was lots of fun, but I never really bothered finishing final level :(


There's still time (I think) and it's surprisingly easy once you realize what you're supposed to do!


"It's easy once you know the answer"

Well, of course it is...


Nice writeup. I loved the CTF. Need moar.

Seriously, what else is out there like this?


Glad you enjoyed :). We have a few places linked on https://stripe-ctf.com/about (namely http://google-gruyere.appspot.com/ and http://www.hackthissite.org/).


A commenter in another thread on CTF recommended io.smashthestack.org. It's very well done - I only got through a half-dozen levels or so before my attention wandered but I really enjoyed it.



I haven't done this yet, is it still online? How difficult is it?


It's not that hard until level 8. At that point I got too lazy to actually continue with it :)


"we make CTF and recommend using chroot"

/facepalm


While they're not great, chroots are much more powerful than most people give them credit for. The trouble comes when people think you can keep a root user contained in a chroot.


Correct, and that make them much less powerful than most people think :)




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: