Yet another OSCP exam experience post..

A few weeks back I took the OSCP exam and wanted to put together a post about my experiences along with some links to resources I found useful.

I’ll begin by saying this was without a doubt the toughest exam I have done and probably the most stressful!

I began the OSCP/PWK course back the end of September 2020 and signed up for 2 months lab time. I originally scheduled the exam for Jan but ended up pushing it out to March as pretty much burnt myself out coming up to Christmas.

Part of this burn out was due to my (now previous) job role and the other was trying to do this course in with a full time job and single parent to 2 young kids. If you are wondering whether to do the PWK course whilst it is very rewarding it also is intensive and will require a significant investment of your time unless you are already doing this stuff as a career.

Offsec are rightly very strict about disclosing any details of the exam so I obviously wont be able to talk about the specifics so don’t ask!

My Strategy

After reading a heap of posts about other exam experiences and approaches I decided I’d approach the exam with the following strategy:

  • As it takes a while to enumerate a machine fully I might as well focus on the higher points machines and reach 70 points as quick as possible (passing mark) This meant I’d attack the buffer overflow (25pt) then another 25 pt followed by whichever 20pt looked easiest
  • I would begin with the Buffer overflow machine and run scans on the other machines in the background to make good use of time
  • I created a word doc for each machine and I’d write the steps and paste the screenshots in as I went along to hopefully avoid missing anything
  • If I got stuck for more than 2 hrs I would rotate to another machine – its very easy to get stuck on something that is not going to work from my lab experience
  • I put together a OneNote notebook of approaches for different ports/services and common commands that I would work through. Its very easy to forget to test something especially in stress of exam

My day went like this:

Of course my day ended up quite different to my original plan and went like this:

7:30 – I setup the proctoring software and wait nervously for exam connection details to arrive. Setup was straight forward and once running you don’t really notice it. It is worth noting that you do seem to occasionally need to click the proctoring window otherwise they’ll ping you to get you to share your camera again which is a bit distracting if you are in the middle of stuff

8am – VPN Details arrive and exam begins! I start on the buffer overflow using my pre-prepared scripts and approach. I kick off scans for the other machines

10am – Buffer overflow done and documented. I’m feeling good. In practice I got the buffer overflow process down to around 20 min in tryhackme room but it takes longer in the exam to do screenshots etc. I double check I have everything I’ll need for the report. I look over the scans for the other machines and continue with my strategy with approaching the higher value machines first

12:00 – Hmm i’m not making much progress on the 25 pointer I decided to take a look at one of the 20pt machines opting for the one with less services running..

13:00 – I got some lunch and had a walk around outside for 20 min to clear my head. I’m already feeling quite tired from 5 hours or so of this and the stress of the exam with only one machine complete..
I continue and I decided to take a look at the 10 pointer to get hopefully a quick win and some of my confidence back. This unfortunately doesn’t happen and I’m unable to make any progress on what I’d expected to be the easiest box pointwise which is er really discouraging ☹

15:00 – Really starting to feel pretty down about lack of progress as had hoped to complete a machine by now. Starting to wonder if I’ll end up chalking this whole exam up as a learning experience. I decided i’ll probably call it a day if I haven’t got any further by 20:00 (12hrs exam)

16:30 – Finally some progress on 25 pointer and I obtain low privilege access. Also realise I could have had this in the morning if I hadn’t made a dumb mistake..  !#$@

17:30 – Yay full access and 25 pointer done. Hmm start to feel a bit better as I “only” need another 20pts to pass which seems achievable in 12hrs

18:00 – Get some dinner and watch a bit of TV to clear head

19:00 – Try one of the 20 pointers for a couple of hours

20:00 – No luck on 20 pointer so switch to the other

20:30 – Yay low priv shell on 20pt!

22:00 – Root access and a sigh of relief as I now theoretically have enough points to pass 😊

23:00 – I double/triple check my notes and make sure I have a heap of screenshots. I find I’m missing a couple of steps so have to do them again grrr

23:30 – Go back to the 10 pointer – why is this so damn hard?!

01:00 – Get a really crappy 3 hours or so of sleep. I’m quite wired at this point from the stress and excitement of exam (and a few cups of coffee and cola)

05:30 – I wake up and have another go at 10 pointer with a few other things I thought to try

07:00 – Last check of notes, tidy up some items

07:45 – Exam ends. I’m actually quite glad about this as don’t want to look at any more machines, do any more labs etc

I then went and took a walk to get a big coffee and treated myself to a big almond croissant 🙂

Report

I have to write a lot of reports and proposals in my role so this is probably a strength for me.

During the exam I had been writing up the machines as I go along in separate Word documents. This makes it easier to edit each individually before pulling them into one report.

I decided to use the offsec official reporting template as figure this will make it easier for them to mark and will def contain everything they want to see.

I spend the next 6-7 hours or so writing up the report and double/triple checking I haven’t missed anything and that the format, filename etc is correct – I’d hate to screw up some minor detail now!

Finally I submit report and am absolutely exhausted and i’m pretty wrecked the next day as well but luckily have taken it off.

Then just under 48hrs later I then get the confirmation I have passed 😊

Tips

  • Don’t give up – I really very nearly decided to call it a day after making little progress for 8 or 9 hours but ended up passing. Stuff can come together really quickly once you find the “thing” and this could be just around the corner..
  • For the Buffer Overflow create fuzzer/overflow scripts prior to the exam and practice the approach several times on the tryhackme room or dobufferoverflowgood (see below). These 25pts are likely to be the easiest points you’ll get on the exam
  • Buffer overflow machine first and scans in background seems a good approach to make good use of time
  • I’m not sure whether beginning with 25pt was a good idea or not. It was quite disheartening not to make any progress for a while and put me in a negative mindset which I suspect made finding stuff more challenging
  • The points value of a machine may not reflect its difficulty – I’d love to know what I was doing wrong with the 10pt machine!
  • Don’t underestimate the impact of the exam stress and tiredness will have on you. I suspect I wouldn’t have struggled with some of these machines outside of the exam environment
  • Take lots of breaks to clear your head. The exam is very tiring and this is a marathon not a sprint. You have plenty of time
  • Dont plan on doing much after the exam – you’ll likely be exhausted. I’m er not sure whether 48hr exam format is a great idea healthwise tbh
  • Screenshot everything and leave shells open with a big history. I had to go back and get some pics of items I had missed as closed shell terminals which wasted time
  • Double check everything – you dont want to find you have missed a key screenshot

So what’s next?
I’m enjoying learning more about infosec and am currently reading Web Application Hackers handbook and working through PortSwigger web security labs.

The Portswigger labs are actually intended as the 3rd edition of the book (to make it easier to keep up to date) and whilst the book was published a while ago it still contains some very relevant content and this will be a great reference for years to come so I have a hard copy of this.

I have a play project I am working on to create a deliberately vunurable.NET core app that I’ll post more about shortly..

Study Tips

  • Get comfortable with debugging stuff and using tools such as TcpDump, Burp etc. Ippsec has some great examples of this in his videos and it will help you understand whats really going on. Note how he’ll start with the simplest thing to check if it works before expanding onto something more complex to check connectivity before finally trying things like a reverse shell
  • Dont rely on Metasploit when practicing. Remember in exam you only get to use this awesome tool on one machine
  • What is your weak area? For me it was Linux skills and privesc so I focussed on these. After you’ve done so many labs and have the approach nailed down you are probably better off focussing on weaker areas rather than doing yet another machine

Resources:

Below is a list of resources I found useful for preparing for the exam:

  • Ippsec HTB Videos. I tried to watch two of these a week and learnt a heap of techniques, approaches and Linux tips and tricks. Highly recommend and they are quite entertaining at times as well
  • Rana’s HTB machine writeups. Rana’s walkthroughs are really detailed and I read every single one prior to the exam.
  • Hacktricks book. This is really detailed and covers a lot of material including stuff to try on each port/service

Labs

  • Proving Grounds. Make sure you do the paid one/Practice machines are fairly similar to lab. I liked that these after 90 min provide an optional tip for scanning, initial foothold, privesc through to full walkthrough if you get stuck
  • Hack the box. You’ll want the paid VIP subscription to access retired machines. These all have walkthroughs and plenty on the web. The online VM works really well but is ParrotOS

Buffer Overflow:

  • Tib3rius TryHackMe Bufferoverflow Prep room. This is likely the best prep you can do and there’s a sample application with several variations, some well known apps like slmail all conviently on one VM
  • Tib3rius bufferoverflow script. I took the fuzzer and overflow scripts, modified them and added comments to describe step by step what to do. I then did two or 3 of the tryhackme buffer overflow challenges each week leading up to the exam
  • DoBufferOverflowGood Tutorial by Justin Steven. This is a really detailed explanation and tutorial that helped me understand a few things

I generally could get onto a box and found privesc the hardest aspect so really focussed on this area making use of the following:

Finally I wish you the best of luck if you are taking the exam. Its important to remember if it doesn’t work out that there are some really awesome folk in the industry who ended up taking this exam multiple times – I really liked Ian Coldwater’s tweets regarding this and they contain some great advice.

MXChip Microsoft Azure IoT Developer Kit

I recently ordered a MXChip Microsoft Azure IoT Developer Kit to have a play with.

It looks like this when it arrives:

pic1

The MXChip Dev Kit is an awesome solution designed for prototyping IoT and cloud-based solutions and comes with a heap of functionality and sensors including:

  • WiFi
  • OLED
  • Headphone
  • Microphone
  • Temperature sensor
  • Humidity sensor
  • Motion sensor
  • Programmable buttons
  • Security encryption chip

Lots of goodies to play with without having to order and setup more components and sensors!

Setup
Setup couldn’t be easier and within about 10 minutes I had my dev kit sending data to Azure IoT hub (setup would have been even shorter had I typed in the WiFi password correctly – duh!).

Setup was basically:

  • Create an Azure IoT hub in the Azure portal
  • Plug in the dev kit via USB
  • Download the latest firmware and copy it onto device like you were copying to a USB stick
  • Connect to the MXChips WiFi access point
  • Browse to a setup web page page, enter WiFi and IoT hub connection details
  • You are good to go and the device will then send temperature info to Azure IoT hub

pic3

Development
So how do you create your own applications?

The kit is Arduino compatible and Microsoft has developed a heap of extensions, samples and tutorials for Visual Studio Code aimed at making it easy to develop, debug and deploy your own applications.

Setup was mostly painless although one of the extensions had some trouble installing and I couldn’t get the debug stuff that would allow me to see what the device was sending. I think this may be some USB driver issue and will require further fiddling..

One of the extensions gives you access to several tutorial projects and samples making it easy to explore the devices capabilities further.

I haven’t touched C++ for many years but the sample code was very readable and could easily be tweaked for your own projects.

Overall whilst the MXChip dev board is more expensive than some other options I was really impressed by all the functionality contained on the board, tutorial and sample support and ease of setup with Azure IoT hub.

If you want your own kit I purchased mine for about $90 AUD (American readers will find this considerably cheaper) from Core Electronics (https://core-electronics.com.au/mxchip-microsoft-azure-iot-developer-kit-pre-order.html).

NDC Oslo 2019 – Developing Solutions for Everyone

It was great to have the chance to speak at NDC Oslo 2019 on the subject of developing solutions for everyone.

This was a very personal talk for me and a bit different to the more technical talks I generally focus on.

This is a talk about how we sometimes can exclude, make harder or even harm groups of people to use what we create software and how we can avoid this.

ndcAlexSpeak

I found this one a challenging one to give given the subject matter which touches on everything from discrimination to hate groups.

For those wanting to know more about this area the talk was influenced by Sara Wachter-Boettcher’s book Technically Wrong. I also attended a few other talks at NDC Oslo that talk about this area such as Tess’s “We are the guardians of the future” and Sasha’s “Why our products and communities need our empathy” that i’d highly recommend watching when the videos are released.

The talk video will be available shortly but slides are online in the downloads section of my website/NDC Oslo 2019 folder.

Alpaka Gear 7venMessenger Bag

 

My friend Jin of Alpaka gear kindly sent me a prototype of his kickstarter project the 7venMessenger bag.

The 7venMessenger bag describes itself as “the only bag you will need” and aims to be suitable for everyday work & leisure usage and also for a short weekend away.

When I was working for IT consultancies there was a regular discussion around what is the best laptop bag which is very relevant when you are frequently travelling.

I have always favoured Samsonite Backpacks as found them comfortable and hard wearing so was interested to see the 7venMessenger bag and how it compares.

Here’s a picture of my bag – note this is the prototype and Jin tells me there may be a couple of changes coming so the final bag may be slightly different:

IMG_20160816_061929

Well I am probably not the best judge of aesthetics (2 kids soon change your priorities to robustness of any clothing or gear) but the 7venMessenger certainly looks smart & wouldn’t be out of place at the smartest of soirees which er i’d never get invited to. The bag also receives a nod of approval from my wife (who knows a heap more about bags than I do) so this is a good sign.

The bag is constructed out of 1000D Ballistic Nylon – I don’t know what that is and what its bullet protection abilities are but it certainly feels tough, durable and looks smart. The bag is also water proof and easy to clean according to the website.

The bag feels reasonably light although is certainly heavier than some of my other bags. Its pyramid shape also means it stands on its own rather than collapses.

The attention to detail & quality on the bag is impressive. There is a massive amount of pockets, mesh compartments and storage (even on the strap!) which I love as there are always various cable chargers, USB sticks etc that need a storage location.

The bag can be worn in a number of ways such as over the shoulder, as a brief case or backpack – it also has a sleeve for fitting over a case handle that you might use at airports. The bag is very comfortable to carry using its leather handle and I find this is the preferred option standing on the train.

The bag has a magnetic clip on the front that looks like it would be released by pulling it up but is actually opened by sliding it sideways. It did confuse me at first and I spent a couple of minutes puzzled but I do like how the magnet pulls the clip together.

The bag is a decent size and easily holds my Dell XPS 13 inch in a padded section. I understand from Jin & his team that the final bag will hold a Macbook 15 inch comfortably. It does feel a little wider than the average messenger bag and I notice sitting on the train with it on my lap it expands slightly beyond my seat area but it’s not a huge issue.

In conclusion the 7venmessenger bag is an awesome product that I would highly recommend.

You can get this bag at a great price by backing the kick starter project at: https://www.kickstarter.com/projects/alpaka/7ven-messenger-the-only-bag-you-need what are you waiting for?

 

Building Resilient Systems

No one likes using unreliable computer systems.

There can be few things more annoying (in terms of 1st world problems anyway) than having an application freeze and losing a load of work.

Losing work is annoying but what if the system performed a more important function such as managing your bank account or maybe even helping an aircraft navigate?

  • How can we measure resiliency?
  • What are the best ways to ensure our systems are resilient?
  • How do companies such as Netflix approaching this?

Check out my post on this at gooroo.io:
https://gooroo.io/GoorooTHINK/Article/16830/Building-Resilient-Systems/23364#.V2-0Irh96M9