Re:Hack your way through Stripe's Capture the Flag
by mirkules on Thursday February 23, 2012 @01:02AM
(#3623993)
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.
[ Parent
| on HN ]
Re:Hack your way through Stripe's Capture the Flag
by Rudisimo on Thursday February 23, 2012 @02:05AM
(#3624100)
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: uid=1003(level03) gid=1004(level03) groups=1001(chroot),1004(level03)
Which is kind of weird since /levels/level03 has a setuid of level04. It could be gdb...
Re:Hack your way through Stripe's Capture the Flag
by thirsteh on Thursday February 23, 2012 @02:41AM
(#3624167)
Since gdb is the parent of your process, it's running as level03, not root. You can't use gdb on a setuid binary unless you run gdb itself as root.
Re:Hack your way through Stripe's Capture the Flag
by ianbishop on Thursday February 23, 2012 @01:50AM
(#3624065)
Ah man, I couldn't agree more. I've learned a ton just messing around with the first few, though getting this was a real bummer:
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.
Re:Hack your way through Stripe's Capture the Flag
by jsharpe on Thursday February 23, 2012 @02:16AM
(#3624126)
setuid doesn't work inside of GDB. You have to run the program without a debugger to get level04 permissions.
(Disclaimer: I haven't succeeded yet.)
Re:Hack your way through Stripe's Capture the Flag
by mirkules on Thursday February 23, 2012 @03:16AM
(#3624213)
I mostly live inside a Java world or XCode world, so GDB is almost a totally foreign concept to me - and I definitely welcome the challenge. Never really had to look at assembly before either, so this is a fun learning experience.