Of all the things that happened this weekend, I didn’t expect this! I registered but I probably wouldn’t have played if Tom Brennan hadn’t frantically raced up to me at about 6:30 on Friday to tell me that I had to =). Thanks Tom!
I’ll talk about some of the challenges I went through, but if you’re really interested in these kinds of things you should compete in one of the capture the flag competitions that I developed for these upcoming events:
- NYU-Poly’s Cyber Security Awareness Week - A yearly event for students that our lab puts on. Compete in 7 different information security competitions for prizes! If you win, we’ll pay for you to come to NYC and collect your prize!
- OWASP AppSec NYC - A 2-day web application security conference taking place downtown this September. There will be a web capture the flag contest, also with prizes. Everyone is welcome to play and challenges will be accessible to beginners and experts alike!
Now about HOPE/Packetwars CTF…
(many details are witheld as I’m unsure whether they reuse contest images for other events)
All the challenges were time-limited and you could only play them solo. This was awesome and is something I’m considering for the CTF’s that I run (OWASP and CSAW). I wouldn’t have played CTF if I knew I was going to miss 3 days of my life but 30 minutes was easy to give up.
The CTF was split into 3 rounds where the first round was a qualifier. The objective was to find all the hosts in your network and enumerate their services. It sounds simple but some services were specifically tuned to throw off nmap and pf and tcpwrappers were playing tricks on you. Still think it’s easy? Try building new tools (who really carries around more than just nmap?), figuring out how pf/tcpwrapper are protecting the services, bypassing that protection, and then scribbling down everything you know on a 3×5 index card (yep, an index card) in 30 minutes!
I started off the first challenge without realizing that we were being graded partially based on how fast we handed in our answers. I ended up in 7th place and just barely qualified for round 2 because of that! I don’t think anyone else got more information than me, but they all handed it in faster. Oops!
The Packetwars guys hinted that the later rounds would be based on the first, so Friday night I researched a few things about OpenBSD, ssh, dig, and tcpwrapper that might (did) help me out the next day.
That worked great, because round two was a .NET web application (a shopping cart) running on Windows. They gave us no direction and just told us to find the hidden codes inside it in 1 hour. “Awesome,” I said, “my day job is spent doing web security testing, I am going to blow everyone out of the water on this one”… The freakin’ app had Fortify Defender (a Web Application Firewall) in front of it and it caught every code injection, SQL injection, and session manipulation attack I tried! I figured they must be asking us to look for logic bugs, leaking credentials in the comments (gasp!) or something else lame like that. 2 clicks later, I used WebScarab’s “Fragments” tab to find the administrative credentials. Go me for thinking like a CTF developer!
So now I’m hard at work on the admin interface trying to steal money from other users and trying to buy things with my ill-gotten funds, reading other user’s shopping carts, and locking out my competitors. I tried to violate every single item in their security model. Some of it worked, most of it didn’t, but I couldn’t find those codes! In my last act of desperation, I started fuzzing every variable I could find with Burp Intruder. Time ended up running out and I never found anything, but luckily no one else did either.
After the second round was over they explained that all they wanted us to do was XSS the front page o_0. WHAT!? Who was there to XSS!? Ourselves!? Sheesh, I really overthought that one. I blame Erik for only teaching me how to 0wn the living daylights out of web apps (no cursing on the blog :-)). When they started looking through packet logs, they unanimously decided I won that round.
Round 3 was back to OpenBSD and was very similar to Round 1. The objective was to gain access to as many of 3 machines you could and to maintain that access. We had 2 hours. Since this one was a little longer and a little deeper, my explanations are abridged.
Problem #0 - There was a firewall between me and the targets and it wasn’t making it easy to even find the hosts. This resulted in lots of panicked mashing on keys and liberal use of the command history but I got around it soon enough. Bigger problems followed.
Problem #1 - All 3 machines were recent versions of OpenBSD (3.9+) which meant no scalp exploit and no sshutup-theo exploit.
Problem #2 - All 3 machines were running on Sparc which meant that, even if they were vulnerable to CORE’s mbuf exploit or mod_ssl’s SSLVerify_CRL() vulnerability, there was no chance I’d ever get working shellcode, especially not in 2 hours without a test platform.
So I gave up on ever getting remote code execution. How familiar that it was down to misconfigured services and weak passwords! Some services were still messing with nmap, but that wasn’t a problem since I had amap and a few protocols memorized for netcat. One or two services were tcpwrapped and played the same tricks as before, but I couldn’t seem to find the correct IP to authenticate with and those services remained inaccessible to me throughout the round. I used DirBuster to attempt to identify usernames on host 1, used dig to do a zone transfer out of host 2, and used the [previously unknown] DNS name for host 3 to talk to its FTP server. The FTP had a 15 second delay before displaying a USER prompt, so brute forcing it was impossible. The only other service I had to brute force was SSH, so what the heck, I went after it. I used 6 py_sshbrute threads to brute force the passwords for “root” and “hacme” (their domains were *.hacme.com) with john’s password.lst. It was right about this time that someone with Nessus managed to crash the SMTP, POP3, and HTTP daemons on a few of the hosts. SMTP and POP never came back up AFAIK (note to CTF developers: always have a console on your vuln box during the contest!).
It was now about an hour into the round and, as I was flailing about trying random attack after random attack, I took detailed notes on my index cards about what I had done so far and why. I didn’t think anyone else was going to get a shell on any of the boxes unless they got incredibly lucky and I thought the index cards would determine who won. Another 45 minutes went by and I discovered a few more things but nothing that gave me a shell. I spent my last 15 minutes writing down an epic 0wn strategy I could have tried had we been given more time.
Time ran out, no one got any shells, and they used the cards to determine the winner combined with weightings from Round 2. It pays off to carefully listen to and follow the rules :-).
After they announced the winner we all sat around in a circle and discussed the challenges. One of the guys from the Packetwars team actually told me, “We were running an old, almost 2 years old, version of OpenBSD with remotely exploitable services!” I’m sorry guys, no one is dropping fresh exploits or giving you big-endian shellcode for your CTF :-P. One guy also fessed up to running Nessus and bringing down said services heh.
Tools I used at some point: DirBuster, py_sshbrute, bash, Brutus, dig, w3af, THC-AMAP, netcat, john, Burp Suite, WebScarab, my brain, maybe some other ones…
All in all, I had a fun time and I would absolutely play in Packetwars CTFs in the future. Even though nothing was as epic-ly hacked as I wanted it to be, the time limits and varied challenges kept me from getting too frustrated. I was able to take away a lot of little techniques that I’ll be able to integrate into my own CTFs in the future. Thanks everyone!
If you made it this far, let me reiterate: play in the CTFs that I run! OWASP AppSec NYC CTF and CSAW CTF are both coming up in September.
On another note, I wasn’t the only one who won it big this weekend. Former ISIS member, Michael Aiello got a video interview on CNET news about his RFID-blocking apparel! Check out the video, he is wearing one of our shirts from HOPEĀ 6 :-).
“Michael Aiello, president of DIFRwear, demonstrates at Last HOPE how easy it is to swipe the data off someone’s RFID-enabled credit card, building access badge, or passport from a few feet away. DIFRwear sells wallets and cases to protect cards from data thieves.”













Thanks for competing, and congratulations! See you at Day Con!
Vache
congrats dude! Awesome blog post. Please keep pwning the shizz out of everything.