COMP6841 Something Awesome

z5418112 (Sam Zheng)

Reflections & Learnings

The reflections of the challenges I have completed in one place. They are ordered in the order that I completed them.

I have found that writing reflections on the challenges I have completed has been very beneficial in helping me understand the concepts and techniques that I have learned. It has also helped me to remember what I should do in future challenges, and can serve as a good resource for people who are looking to learn more about web pen testing as well.

Overall Learnings

  • I have learned a lot from doing these challenges - from the many different types of web vulnerabilities that exist, how they can be exploited, and the tools and techniques that are used in web pen testing.
  • In the beginning, I found it difficult to know what exactly I was looking for and was to do. I didn't have a clear methodology or process to follow. However, as I did more challenges, I started taking the time to perform proper recon, plan, research before executing the attacks. This helped me follow a more clear-cut path, and allowed me to more efficiently and effectively find and exploit vulnerabilities.
  • Another key learning was to not spend too much time on a single task when trying to solve a challenge. In my earlier challenges, I would often find myself going deep into a rabbit hole, thinking that I was on the right track, only to find out that I was completely wrong. I learned that it is important to take a step back, and try to look at the problem from a different perspective, using context clues and hints that are given in the challenge. The best example of this was with Pop Restaurant, where I was stuck for a very long time, until I realised that the name of the challenge itself gave a big hint.
  • Using the right tools is also very important, as well as knowing when to use tools that already exist. In the beginning, I was doing a lot of manual work, realising that there were tools that already did the job for me, saving lots of time and effort.
  • Finally, I learnt about the importance of security as a whole. Before undertaking these challenges, I had no idea how many different vulnerabilities exist out there, and just scrolling through HackTricks and other blogging websites made me realise the scope of this field. It's crazy to think that with humans inventing computing and on the bleeding edge of technology, there are also people who have nefarious intents. It's a constant battle between the good and the bad, with the bad always trying to find new ways to exploit systems and the good always trying to find new ways to protect them.

Process

This is an overview of the process I eventually followed, including tips and resources that I found useful.

The first step in doing these kinds of challenges is to gather intel, or the fancy term being reconnaissance. This involves finding out as much information about the target as possible, such as the technologies being used, skimming through the source code (if provided), playing around with the website normally etc.

What I like to normally look for are:

  • Source Code: This is a goldmine of information. I like to look for comments, hidden fields, endpoints, etc.
  • Technologies: Knowing the technologies being used can help in finding vulnerabilities that are specific to that technology. These can be found in the package.json, requirements.txt, or even the Dockerfile.
  • Endpoints: Looking for hidden endpoints, APIs, etc.
  • Where the flag is: This is of course your end goal, so knowing where the flag is can help you plan your attack. Sometimes it's in a config, a variable, most of the time it's in a file. There have been some instances where the flag was copied to a random location (as defined in the Dockerfile), so in these cases RCE of some sort is typically involved.
  • Obvious vulnerability entry points: Sometimes, vulnerabilities can be spotted very quickly - and may have a part to play in the challenge. Keep a mental note (or physical note!) of it.

Sometimes, if you have little idea of what to do by this point, it may be worth starting to consider vulnerabilities being present within libraries. For example, if you see a NextJS website or HAProxy configuration - look for CVEs on Google - this can often lead straight to some form of answer.

Do be careful when checking for CVEs though - there were often times when I got so invested in a particular CVE, just to realise that the version that the challenge was running had been patched. Make sure you check those versions!

Other useful resources in discovering/finding out vulnerabilities:

  • HackTricks - A great resource for finding out about different vulnerabilities and how to exploit them.
  • PortSwigger - An online learning platform with tutorials and labs on web security for various pen-testing techniques.
  • CVE Details - A database of known vulnerabilities and their details.
  • Google! - Google is your best friend. If you're stuck, Google the error message or the technology you're working with.
Try to avoid getting too deep into anything specific - I found it quite detrimental to the overall flow by getting too side-tracked with one particular thing.

This is also the stage to research anything that you are not sure of that you are seeing - without pre-requisite knowledge, it can be very difficult to solve some challenges.