James Thomas

Kernel Panic! A brief README for the OSCP

A Lil' Backstory

Like thousands before me, I've slowly fell into a deep state of madness over the past month in the OSCP labs, working towards total understanding of everything Offsensive Security deems appropriate for an entry level pentester to master.

Pentesting? Me? Not quite. I do security R&D during the day, but I figured I'd just continuously tackle something new and difficult for me, which this year was the OSCP.

The Course Material

Do yourself a massive favor - don't skip this. When you begin the oscp training, nobody tells you the "right" method. You get hints here and there but it's totally up to you to figure it out and make the best with what you're given. Some folks jump right into the lab, which isn't an issue if you've got previous pentesting (and really, previous enumeration) experience. That said, there are a few techniques used in the lab and on the exam covered by the course materials (the big pdf you get sent to you at the start). Some of these things are very specific to a particular software or technique - and skipping them could certainly cost you in both time and blood pressure.

The Excercises

As for moving through the material, it's not too hard. There are points where things won't work, where the material appears out of date, and where you swear "it's just the machine". Rule one in not only pentesting but in being competent is to never blame anything but yourself. Yes, there might be a configuration issue going on, but it's 100% up to you to understand how to debug everything, forever. There is no such thing as "well x is stupid and sucks therefore it's not up to me to figure this part out". There is only ever "how do I get more data out of this to figure out what's going on under the hood". This applies not only in the OSCP labs, but in the real world, be it in development, infrastructure, networking, or hell even sewing. You have all the tools you need to figure it out, and if you can't, then you'll lose your job, promotion, or respect to someone who can.

At the very least, skim through all of it and ensure you feel confident in each section. It's all game to be on the exam, and all of it is valuable.

Taking Notes

I'll cover lab-specific note techniques below, but for here there are a few ways to take notes that have become popular with many folks. I actually didn't use those at first, instead opting for Hack MD. Being a huge markdown supporter, I write all my notes in MD, and hackmd is a great way to store that in the cloud and be able to control-v images into your notes. Also, you're going to want to access your notes from your host, your kali vm, and probably another computer - sometimes all at once, so being stored remotely helps a ton. Also, I accidentally deleted my VM right before the exam, and having all of my notes stored here and my exploits stored in NextCloud, I totally mitigated that disaster.

Aside from that, OneNote is great as well. I ended up using hackmd for the excercises, general notes, guides, script storage, etc - and OneNote online for the lab box documentaiton (such as steps to exploit a box or storing loot/data I found).

Note: I ran my own instance of hackmd

The Labs

Alpha

There's a special box with a complete walkthrough in the forums. This isn't obvious unless you go digging for it. If you have the time and willpower, I'd advise you ignore the walkthrough as long as possible and try to go for it alone first. That said, there are many many boxes in this lab, so if you find yourself totally stuck on the first few with no idea how to even get started (in both getting a shell or privesc), then go through that guide - it's going to give you a solid test case for the lab boxes, and it's methodology generally applies to the entire lab.

The Bosses

There are a few "harder" boxes in the lab. Do everything you can to solve these on your own. They teach not only the techniques, but how to identify rabbit holes, how to pivot when needed, and how to take breaks appropriately. So so so many times I've walked away from a 8 hour session only to root a box 15 minutes into it after sleeping because I felt "alright" with re-trying previously failed exploits, or simply because I noticed a new attack vector that I skimmed past before.

Taking Notes

It's super important to take notes when you learn a new technique - you'll find yourself wanting to copy and paste commands over and over and over. Hackmd was a massive help here, in fact I still have a huge "Techniques" page that I use for hacking these days that stemmed from the notes I took during the OSCP. Things like proxychains and socat shell stablization I tend to use scripts that I've saved there rather than googling the techniques every single time I need them.

The Exam

I'll write up a blog post dedicated to the exam in a few months here... until then, just note that the exam isn't that big of a deal. It's mostly all in your head. You'll get 5 boxes with fairly obvious vulnerabilities, and the entire exam is just a test to see if you keep calm and chase down every single loose end possible without getting sucked into a 4 hour rabbit hole on a method that isn't working out.