# Omar Tsai — Complete Blog Archive > Full text of all blog posts by Omar Tsai (cybersecurity researcher, AI engineer, OSCP/OSWE/OSDA certified). > Website: https://thaomar.com | Email: omar@9tsai.ca | GitHub: https://github.com/omar2535 --- # OSDA Writeup - **URL**: https://thaomar.com/blog/2026-04-08-osda-writeup/ - **Date**: 2026-04-08 - **Tags**: certification - **Summary**: My long overdue writeup of the OSDA certification I think this is going to be a short -- because I completed this exam back in November, I actually don't remember too much for the exam. But! I have some study tips & what I found to be useful about the course and what I didn't find to be useful. # Background My day job at least at the time involved a lot of threat hunting and diving deep into incident response. Usually I work with data at the petabyte level, so sifting through mountains of data was not too foreign to me. However! I am mostly a cloud analyst. Pivoting to host based data through the elastic agent really changed my view on how useful that data is. # The course The course itself is fine. If you took the OSCP and have a decent understanding of the different attack techniques, a lot of the course will feel the same. Emulating the techniques & analyzing them in the data. # The exam I think if you followed the course and did all the labs, it'll be fine. # General takes This course is much cooler than other ones I've done. There's way more data and it really feels like you're investigating a live incident. From the initial access to the exfiltration portions, it really gives you the vibe of an investigator looking at a breadcrumb trail of bad-guys. Defintely a super fun course! --- # How I vibe code - **URL**: https://thaomar.com/blog/2026-03-30-how-i-vibe-code/ - **Date**: 2026-03-30 - **Tags**: workflow - **Summary**: Now that working with AI is a must, here's what I've learned so far. # Where we began I think it was around 2022, when the first ChatGPT came out. Everyone was so excited about it, while I was just like "it's just a chatbot, nothing fancy!". Where I was coming from were the [markov chain chatbots](https://stackoverflow.com/questions/5306729/how-do-markov-chain-chatbots-work) that were so prevalent back in the 2010's. Asking the chatgpt UI some simple questions was all I did. There were no LLM tools, no agentic, basically nothing. So I took a look, and turned away. Fast forward a little bit to 2023, some of my classmates during my master's program were using it to generate code! Real code! I was pleasantly surprised, as the code their AI wrote was like 80% of the way there! This was a project to write an [encrypted filesystem](https://github.com/omar2535/encrypted-secure-fs) -- and anyone that has written one before will know the oddness of integrating with OpenSSL between different versions. So at this point, I realized the power it can bring in just quickly templating my code for me, and letting me figure out the complex parts such as integration & logic. # Copy pasting code After my classmates showed me their generated code, I started playing around with it too! I would generate a bunch of lines of code in the chat window, and paste it into my IDE! This was absolutely awesome! Quickly, I surrendered more and more of the quick functions I would do (tail recursion, graph-search, etc.) to the AI. They weren't 100% of the time correct, but their mistakes were usually minor enough that I could just fix a few lines and be done with it! This was miles ahead of writing function templates and filling in the blanks. This was -- context aware! # Autocomplete code [image: Inline suggestions from GitHub Copilot in VS Code] Around this time, a new feature was starting to emerge called autosuggestions. Autosuggestions paired with some reasoning back and forth with an LLM meant that I could write code way faster! I just pressed tab autocomplete and it was done. I was still kind of unhappy my job / fun was being taken away, but at least it got what I needed done! Anyone that has used ZSH + Autocomplete + Syntax Highlighting knows what it feels like -- familiar and l337. # Agentic A few months later, in early 2025, agents really started taking off. Agent coding, RAG, all these kinds of AI-assisted coding tools starting to become really integrated. Before 2025, I dabbled in things like [cursor](https://cursor.com/). But going to another editor to vibe code felt a bit off (I do understand the limitations with Microsoft locking down vscode so much that the cursor team had to do what they did). My first real tool I used for agent development was Github Copilot. The extension worked seamlessly into VSCode and the agent would read and edit my code. There were some obvious bugs, and sometimes it continuously edited the same file with the same code. But overall, it was OK for my use case. No more having to switch between both a chat prompt on the web and my IDE. I would still review all the lines generated and accept their changes; but no more writing actual code anymore. This was a turning point. # CLI Agents Now it's 2026. Even [Andrej Karpathy](https://karpathy.ai/) -- who still wrote many things by hand just a few months ago, has fully embraced AI. [Github Copilot CLI](https://github.com/features/copilot/cli) just came out. [Opencode](https://opencode.ai/) is awesome. [Claude code](https://code.claude.com/docs/en/overview) is dominating the vibe coding market. I've also fully transitioned basically into the CLI. Before, with agentic coding, I would make a prompt, watch the AI fix my files, and accept each edit on each individual file. However, now I would review the code if I felt like it. I still don't let the AI do commits for me since I would like to see the diff of the entire session before it gets committed. But I find that the CLI approach is way faster. I still keep my Github copilot subscription, as that's been so useful especially with the integration to Github itself. I prompt the AI on my CLI, get it to do work and commit to my branch. Github copilot has a feature to review pull requests for me as well -- and surprisingly, it works insanely well! I use claude code when my tokens expire or I get rate-limited by copilot. Opencode sometimes when I feel like it. All in all, my workflow now has transitioned from being an in-the-weeds coder to being an overseer of agents coding / reviewing / doing the full SDLC for me! From time to time, I do find myself looking up the latest documentation to fix things that the AI missed. Just recently, integrating fastMCP into [GraphQLer](https://github.com/omar2535/GraphQLer) -- the AI kept referring to old documentation and messing up. Things like these will be fixed over time, especially as models get trained on more recent data. Agentic grep & tooling will bridge the gap between training data and any new ones coming in. [image: My terminal vibe coding] # Final thoughts on the outlook of software development So, obviously I'm bullish on agentic coding. I do still believe that at the current state, we need more software developers than ever before. Especially good ones. Why? Because now that AI is producing so much code (slop), we as humans need to be even better at reviewing, debugging, and guiding. Our role goes from a developer to more of a mentor / overseer of these agents. Just recently, [AWS required all AI-generated code to be reviewed by senior engineers](https://medium.com/@kakamber07/amazon-just-put-senior-engineers-in-charge-of-ai-code-f236c86b5789) due to ongoing outages caused by bad code. More and more junior engineers rely super heavily on AI, while not actually understanding the "why" or even the "what" is being solved, just the "how". As development transitions, coding by hand becomes a more original process. Just like a blacksmith's craft -- sure it can be done in a factory end-to-end, but there's a certain form of art in seeing the project through. --- # Updating wazuh manager password in kubernetes - **URL**: https://thaomar.com/blog/2025-11-06-wazuh-kubernetes/ - **Date**: 2025-11-06 - **Tags**: kubernetes, devops - **Summary**: Updating wazuh manager password in kubernetes [image: Blogger logo] After scouring the internet (where even the LLM was giving me wrong answers), I had to scour for information scattered across GitHub issues and various blog posts. All of them were slightly wrong so I want to document my steps on updating the wazuh dashboard admin password for a kubernetes deployment of wazuh. Here is how I did it. The guide assumes the [wazuh-kubernetes](https://github.com/wazuh/wazuh-kubernetes) repository was used to deploy the cluster. # Step 1 - Generate the password hash Shell into wazuh-indexer pod ```sh kubectl exec -it -n wazuh pod/wazuh-indexer-0 -- bash ``` Generate password (the output will be a hash. Remember this!): ```sh export JAVA_HOME=/usr/share/wazuh-indexer/jdk bash /usr/share/wazuh-indexer/plugins/opensearch-security/tools/hash.sh ``` # Step 2 - Base64 encode your password Outside of the indexer pod, base64 encode your password. We will need both later. ```sh echo -n | base64 ``` So we should have a from step1 and a from step2. # Step 3 - Replace the secret files - In wazuh-kubernetes/wazuh/secrets/indexer-cred-secret.yaml - replace the password with - In wazuh-kubernetes/wazuh/indexer_stack/wazuh-indexer/indexer_conf/internal_users.yml - replace the hash with And run `kubectl apply -k envs/local-env/` # Step 4 - Run securityadmin script This is where my steps differed slightly. Instead of port 9300 - mine was 9200. Also, instead of /usr/share/wazuh-indexer/plugins/opensearch-security/securityconfig/, mine was /usr/share/wazuh-indexer/config/opensearch-security/. Basically i just had to find the yaml files that were edited. They were somewhere in /usr/share/wazuh-indexer/ so I just did a grep. ```sh export INSTALLATION_DIR=/usr/share/wazuh-indexer export OPENSEARCH_PATH_CONF=${INSTALLATION_DIR}/config export CACERT=$OPENSEARCH_PATH_CONF/certs/root-ca.pem export KEY=$OPENSEARCH_PATH_CONF/certs/admin-key.pem export CERT=$OPENSEARCH_PATH_CONF/certs/admin.pem export JAVA_HOME=/usr/share/wazuh-indexer/jdk bash /usr/share/wazuh-indexer/plugins/opensearch-security/tools/securityadmin.sh -cd /usr/share/wazuh-indexer/config/opensearch-security/ -nhnv -cacert $CACERT -cert $CERT -key $KEY -p 9200 -icl -h localhost ``` # Step 5 - Restart the pods & login ```sh kubectl delete -n wazuh pod/wazuh-manager-master-0 pod/wazuh-manager-worker-0 and login to the wazuh dashboard. It should work now! ``` # References - https://k8s.co.il/security/deploying-wazuh-on-air-gapped-kubernetes-cluster/wazuh/wazuh#14795 - https://groups.google.com/g/wazuh/c/zO0V28J3oLQ --- # Back to My Old Blogger Roots - **URL**: https://thaomar.com/blog/2023-03-27-back-to-blogger/ - **Date**: 2023-03-27 - **Tags**: meta - **Summary**: Moving back to Blogger for casual writing, for now. [image: Blogger logo] I've been really slacking on maintaining my website these days. Writing in Markdown is proving to be both a difficult task and time-consuming at the same time. What started out as me thinking that I would be able to do the entire CMS myself has now turned into a minor overhead every time I want to make a blog post but not make it something really big. I also recently dug up my old Blogger blog which my Mom encouraged me to start back when I was still an elementary school kid. I'd like to continue with that blog, just posting about anything really. Link to blog: [thaomar.blogspot.com](https://thaomar.blogspot.com) *(This post was originally published on the old site. The new site — the one you're reading now — is where I'm writing again.)* --- # Setting Up Vulnserver for OSED Practice - **URL**: https://thaomar.com/blog/2022-09-21-vulnserver-for-osed/ - **Date**: 2022-09-21 - **Tags**: cybersecurity, osed, tools, guide - **Summary**: How I set up a Windows 10 VM with Vulnserver, WinDBG, and IDA Free to simulate the OSED lab environment. [image: OSED X Vulnserver] For some background, I'm currently taking the OSED course. I started in June but my lab time ended in August. I haven't taken my exam yet so I'd like to emulate what the lab machines looked like through setting up my own virtual machine with Vulnserver to practice. Below I will outline the steps I took to get my machine to simulate a lab environment. ## 1. Setting up my Windows 10 VM For this section, I used VMware and set up a simple Windows 10 Pro virtual machine. There are already many guides online so I will skip this part. ## 2. Setting up WinDBG For WinDBG, I'm going to download the one on Microsoft's website instead of the preview edition as that's what the course teaches. [Windows SDK](https://developer.microsoft.com/en-us/windows/downloads/windows-sdk/) (comes with WinDBG) ## 3. Setting up IDA Free Only the free version of IDA is allowed on the exam, so that is what I download: [IDA Free](https://hex-rays.com/ida-free/#download) ## 4. Process Monitor & Process Hacker - [Process Monitor (Procmon)](https://learn.microsoft.com/en-us/sysinternals/downloads/procmon) - [Process Hacker](https://sourceforge.net/projects/processhacker/) ## 5. Vulnserver Install Vulnserver from the GitHub repo using the "Download as ZIP" option and extract it to the desktop: [Vulnserver](https://github.com/stephenbradshaw/vulnserver) ## 6. Results [image: Vulnserver machine desktop] Finally, we get our server up and running on port 9999 of the machine. And now time to do some practice! --- # Meaningful Work & Meaningful Relationships - **URL**: https://thaomar.com/blog/2022-07-03-meaningful-work-and-relationships/ - **Date**: 2022-07-03 - **Tags**: life, books, finance, reflection - **Summary**: Taking inspiration from Ray Dalio, Robert Kiyosaki, and the mid-2022 market pullback. Recently I've finished a few audiobooks and I'd just like to document my thoughts here. ## Ray Dalio — Principles Ray Dalio's guiding principle of **meaningful work and meaningful relationships** made me realize that life really boils down to this fundamental idea. Money can't buy relationships, and money can't buy you work that is fun. Moreso, money can't buy you meaningful connections that will last you a lifetime. As my mom always says: > 能用錢解決的事是最簡單的 In English: *The problems solvable with money are the easiest.* When I was young, I didn't really appreciate the strength of this quote. I thought as long as I had money, I could do anything! Yet, as I grow older, I've come to realize that money is just a tool — it gives you options, but doesn't solve the problems for you. [image: Principles cover] ## Rich Dad Poor Dad Robert Kiyosaki has given me a new way to think about money. To realize that a job is just to earn money — but to make money work for you is even more important. I've been investing since I was in first year of university, starting from my very first paycheck. The whole reason I took on two part time jobs over the summer of my first year was to invest! At that time, I realized that making money work for you is crucial. I've also been thinking: how can this possibly be sustainable if everyone keeps receiving money from dividends? Well, that is how technology works. Technology not only allows for improvements in our daily lives, but also reduces the number of workers needed to perform a job. This is precisely why, while many jobs are being automated, it is even more important than ever to be part of the change — either by updating skill-sets or by investing in the future. ## More Books I'm Reading I'm also in the process of listening to Steve Jobs and Obama's autobiographies. Knowing their thoughts might unlock some realization for me too. [image: T-Bill rates 2008-2022] ## A Note on Current Market Conditions Right now, the Federal Reserve is rapidly performing quantitative tightening in addition to raising interest rates. This has been a much-needed pullback. And while they quote supply chain issues with high demand but low supply, the reality is that credit has been too easy to come by. As Warren Buffett has said: > Only when the tide goes out do you discover who's been swimming naked. Many companies that borrowed too much on credit now can't pay it back and will go bankrupt. This includes homeowners with mortgages and shareholders of over-leveraged companies. Anyhow, I think I've rambled too much. This has been my half-year mark for 2022 — and definitely one of the most interesting years in my life. That's all! --- # 2021: A Year of Digital Experiences - **URL**: https://thaomar.com/blog/2022-01-09-reflection-2021/ - **Date**: 2022-01-09 - **Tags**: life, reflection, annual-review - **Summary**: Graduation, grad school, relationships, and goals for 2022. [image: chess-all-white] Closing out this year, I must say that it was a terrific experience. In the start of the year, I was able to lose 20 kilos in 5 months. This was no small accomplishment, as I was very overweight from all the staying at home due to COVID. My lifestyle also improved drastically, going to sleep much earlier and being much better at controlling my temper. Towards the middle of the year, I had my second internship with Amazon. This was a wonderful experience as I got to meet so many new people. While the work was online, I was still able to go into the office and experience what life would be like once people were working normally again. It was around this time where I also graduated from UBC! It's absolutely unbelievable that looking back to when I just graduated high school, I could have never known what degree I would end up graduating with! Such is life. Towards the last quarter of the year, I started my masters program at Simon Fraser University. I met a lot of friends, pulled many late nights working on many group projects, and met my wonderful girlfriend. Absolutely one of the most memorable experiences of my university career. ## Goals of 2022 1. **Be better at interpersonal skills.** This year has made me realize that so much of professionalism is not about how smart you are, or how much you can do. It's how you treat others, and how you communicate with them. 2. **Learning much more about security & technology.** I'm still only dabbling in bits and pieces of the information security space. There's still so much to learn and I would love to further improve my skills. 3. **Read 10 books this year.** Reading has always been my top priority. ## Final Words If I have learned anything from this previous year, it's that change is sudden and comes at the least expected time. I would have never imagined that meeting my classmates would change my life so much. If you told me that I would have made more friends in this past year than I have over my entire 4 years of undergrad, I would have called you nuts! Being prepared for the unexpected. Being adaptable. That is what life is all about. As Seneca said: > *Luck is what happens when preparation meets opportunity.* Good luck everyone. *Omar Tsai* --- # AWAE & OSWE — A Review from a Software Developer - **URL**: https://thaomar.com/blog/2021-09-01-oswe-review/ - **Date**: 2021-09-01 - **Tags**: cybersecurity, oswe, certification, review - **Summary**: My review of the Offensive Security AWAE course and OSWE exam experience. [image: AWAE Icon] ## AWAE The Advanced Web Attacks and Exploitation (AWAE) course by Offensive Security focuses primarily on white-box penetration testing. It is more akin to code reviews that software developers frequently go through than the black-box reconnaissance that the OSCP was like. The syllabus for the AWAE course sums up what is learned. However, I really felt like they should have dived into vulnerabilities using popular web frameworks such as Django, Rails, Angular, or Express. ## Studying for the OSWE I signed up for 90 days of lab time. In hindsight, this was overkill. But given that the OSCP took me just shy of 5 months to get, I didn't want to take any chances. My course material and lab started in the beginning of August. I studied around 5 hours a day and completed the majority of the PDF and videos by the 20th day. By the time I attempted my exam, I had finished all but one of the extra-miles and completed all of the exercises and lab machines. ## OSWE Exam Booking I signed up for the OSWE realizing that I wanted to get it done before my classes resumed in September. So I quickly booked my exam to start at 5pm on a Monday, which gives me until Wednesday at 4:45pm to hack the two web applications. Surprisingly, there were no hiccups in booking the exam and there were many slots available. ## OSWE Exam My exam began with the usual check-in process to make sure the proctors could see my screens and webcam. I was emailed the exam connection at 5pm sharp. ### First machine The first machine took me until midnight to figure out the path to full remote code execution. It took me until the next day to get everything coded up in one exploit. This machine in total took me around 7 hours (minus sleeping at night). ### Second machine The second machine was what really tripped me up. I went through the source code many many times, reading every single line over 2–3 times, yet still couldn't find anything to exploit. While I was lying in bed at 3am with my mind racing through everything I had seen in the source code, something peculiar jumped out at me — I quickly realized it was the missing piece of the puzzle. So I jump out of bed, try the idea I came up with, and it worked! After waking up, I quickly write the proof-of-concept script and fully finish the machine by 12pm. This machine took the longest at a full 24 hours. ## Conclusion Was this certification worth the money? Probably — if I had gone with the 30 day package instead of the 90 day one. Since I already had a lot of development experience doing code reviews and creating web apps, it took me much less time to digest and understand the material. ## My (Opinionated) Advice ### I: Build a methodology Have a methodology and stick to it. Here is mine: 1. Make sure to record all traffic through Burp 2. Make sure you know where the log files are (if any) 3. Check all public web pages 4. Check all authenticated web pages — note authentication endpoints (login, password reset), admin areas, file upload, forms, restricted areas 5. Prioritise unauthenticated functionalities, then authenticated ones like password reset and session management 6. Check for SQL Injection on publicly accessible endpoints 7. Check for programming-language specific issues (e.g. `readObject` in Java, `eval` in JavaScript) ### II: Take breaks Take breaks often. I cannot stress how often I came up with ideas during my break time versus staring at the screen. ### III: It's not over until it's over When I couldn't find any way in after a whole day of looking, I was demoralized. But by the 26th hour, I found something I had accidentally overlooked. Don't give up. ### IV: Do everything in the PDFs Do all the exercises and extra miles. Seriously. ### V: Treat the exam as a learning experience You don't fail by failing the exam. You only fail when you give up. --- Thank you for reading! I hope to learn much more in the cybersecurity space and hope to record this journey in my blog! --- # Graduation! - **URL**: https://thaomar.com/blog/2021-06-03-graduation/ - **Date**: 2021-06-03 - **Tags**: life, university, milestone - **Summary**: A memorable 5 years of my undergraduate degree at UBC. [image: UBC afternoon] If I had to do it all over again, I would. That is the first thing that came to mind when I looked back on my university experience. I definitely had my ups and downs, and having to sacrifice grades in some classes for other priorities weren't ideal, but overall I really enjoyed my experiences at university. Now, I just want to take the time here to thank my entire family and all my friends who I met along the way! It was with everyone's help that I could learn so much in this short time. Lastly, a few words I'd like to keep with me past my undergraduate career: - **Keep on learning** — I'd like to always be learning, to always be a student, and to always be open to new ideas. - **Work with others** — I'd like to meet many more people, share more memories, and to learn from the experiences of others. - **Manage time, don't waste it** — I realized that there's always never enough time. The important point is to do what matters most, and to set aside time to do them. There truly never is enough time. That's all! Thanks UBC! Thanks UBC PHAS! Thanks UBC Computer Science! And thanks UBC Co-op for getting me that foot in the software industry! Till next time :) --- # Closing Out 2020 - **URL**: https://thaomar.com/blog/2020-12-30-closing-out-2020/ - **Date**: 2020-12-30 - **Tags**: life, reflection, annual-review - **Summary**: My thoughts on 2020 — pandemic, markets, travel, and what's next. [image: 2020 Image] 2020 came, and 2020 goes. We have seen many events occur: the US presidential election, stock markets reaching an all-time high, international relations more strained than ever, and of course, the pandemic of COVID-19. This will be a simple recap of my year. ## Online University As my last year at University comes to a close, I really wish I could have had the chance to take those 9pm buses back home again. To experience my fellow students crammed into a small Translink bus in the cold dark winter. And to experience studying with my friends at the basement library in Koerner one last time. COVID threw all those out the window, and what's left is what many students dub as "zoom university". All the courses I took were online; although the professors were very accommodating, the quality of teaching just isn't the same as in-person classes. Making new friends was basically non-existent, as the online lecture format made it near impossible to talk to my colleagues outside of class. However, there were some advantages. Firstly, I could sleep in until lectures started. Secondly, lectures were almost always recorded so that I could re-watch them. Lastly, I found myself participating more than I would from in-person classes. One takeaway I really hope UBC will finally implement is lecture recordings. Before COVID, none of the classes I ever took at UBC were recorded. This was my biggest gripe when many other universities have already had a recording system implemented ages ago. ## Financial Review The markets have done nothing but go up. The market not being an indicator of the economy has never been so prevalent until now. That being said, the markets going up were great for me. Following the advice of "buy low, sell high", I bought during the time when everyone was selling in March and have since made a decent amount. To anyone reading, I would suggest following Warren Buffett's quote: > Be fearful when others are greedy and be greedy only when others are fearful. This piece of advice undoubtedly helped him, and can also help us achieve something too. ## Travel For this year, instead of going abroad like my family usually do, we ended up doing a road trip to Jasper and Banff. The view was great, the drive was nice and simple, and most of all, it was quiet. Not too many tourists and not too crowded either. Hotel prices were cheaper than usual due to COVID which made it even more enticing to go. While travel this year has been different from the norm, we still didn't let the pandemic ruin our yearly tradition! ## Closing Thoughts All in all, 2020 has been a very generous year for me. Everyone I know has been safe and healthy, and I have kept in touch with many that I have previously lost contact with. To everyone in this world, stay safe, stay healthy, and stay strong. We will get through this together. Here's to a better 2021! 🥂 --- # Passed OSCP! - **URL**: https://thaomar.com/blog/2020-08-30-passed-oscp/ - **Date**: 2020-08-30 - **Tags**: cybersecurity, oscp, certification - **Summary**: Finally passed OSCP on my second attempt. Here's how it went. [image: OSCP certificate] ## OSCP Attempt #2 For my second attempt, I scheduled it at 9:00pm at night. The reason I chose to start at night was because I knew I needed breaks in the middle and a good night's rest would help me reset my mental model. ## 9:00 pm Exam starts. I use Autorecon on the 4 other machines while working on the buffer overflow. ## 9:50 pm Buffer overflow finished. Some scans for machines were still going. I decide to take on one of the 20 pointers next. ## 11:30 pm 20 pointer finished. I realized that the other 20 pointer was the same machine I had seen in my previous attempt and I already had low privileges on it before. So I decide to save it for last. ## 12:30 am Found interesting hints with the 25 pointer but nowhere concrete. I decide to call it a night and go to sleep. ## 9:00 am Wake up and came back. Decide I want to get the free low-user points for the 20 pointer machine I had seen from my first attempt. Finished the low-user shell on the 20 pointer and moved on to the 10 pointer machine. ## 11:00 am Found a way into the 10 pointer. Tried it out and it seems promising. ## 12:00 pm 10 pointer done. At this point I have 25 (BOF) + 10 + 20 + 10 = **65 points**. I also had done the labs and exercises for bonus points so I could pass with 70 points. However, I didn't want to take any chances, so I kept on going at the 25 pointer. ## 3:00 pm Found more interesting things for the 25 pointer. Still no shell. ## 6:00 pm I decide to start writing my exam report. I retraced all my steps to make sure I had all the screenshots I needed. ## 8:45 pm Exam finishes and I start writing my report. ## Report writing I took another 12 hours to write the report and submitted at 1pm the following day. ## Result My results came in 2 days after I submitted my report. **I finally passed!** That's it for my journey through the OSCP. It was definitely a fun ride and I learned a lot about pen-testing! --- # VSCode Markdown PDF Export in WSL1 - **URL**: https://thaomar.com/blog/2020-07-29-vscode-markdown-pdf-wsl/ - **Date**: 2020-07-29 - **Tags**: tools, wsl, vscode, guide - **Summary**: How to get the VSCode Markdown PDF extension working inside WSL1 on Ubuntu. ## Introduction Today I was really struggling to convert my pentesting writeups to PDF. For a little context, my notes are kept in a VSCode workspace fully written in Markdown. Each machine has their own Markdown file and images are simply imported by path. The main reason I chose to do this was because I was already familiar with Markdown and I liked having easy files to commit to GitHub. ## Context I tried to export all of my Markdown files into a single PDF with [pandoc](https://pandoc.org/) but it didn't help as all of my code blocks ended up overflowing. After digging through Stack Overflow answers, it seemed like there weren't really any good answers to mitigate this. I also disliked the formatting that pandoc output by default, so I decided to stick with the VSCode PDF generator. ## Problem [image: code block overflow] The problem came when I tried to export a PDF in WSL1. My WSL is running Ubuntu 20.04 and using the Markdown PDF generator, it always gave me errors either with shared libraries or Chrome not being available. It however *did* work fine in Windows VSCode — just not WSL VSCode. ## Solution [image: VSCode Markdown PDF] The solution is to install all of the missing libraries and required dependencies. The following commands are what worked for me; however, your mileage may vary. ```sh sudo apt-get update npm install puppeteer -g sudo apt-get install chromium-browser # Fix for WSL1 issue: https://github.com/microsoft/WSL/issues/4898 wget https://launchpad.net/~rafaeldtinoco/+archive/ubuntu/lp1871129/+files/libc6_2.31-0ubuntu8+lp1871129~1_amd64.deb sudo dpkg --install libc6_2.31-0ubuntu8+lp1871129~1_amd64.deb sudo apt-mark hold libc6 sudo apt --fix-broken install sudo apt full-upgrade # Install Chrome wget -q -O - https://dl.google.com/linux/linux_signing_key.pub | sudo apt-key add - wget https://dl.google.com/linux/direct/google-chrome-beta_current_amd64.deb sudo dpkg -i google-chrome-beta_current_amd64.deb sudo apt -f install sudo dpkg -i google-chrome-beta_current_amd64.deb # Install required libraries sudo apt-get install gconf-service libasound2 libatk1.0-0 libc6 \ libcairo2 libcups2 libdbus-1-3 libexpat1 libfontconfig1 libgcc1 \ libgconf-2-4 libgdk-pixbuf2.0-0 libglib2.0-0 libgtk-3-0 libnspr4 \ libpango-1.0-0 libpangocairo-1.0-0 libstdc++6 libx11-6 libx11-xcb1 \ libxcb1 libxcomposite1 libxcursor1 libxdamage1 libxext6 libxfixes3 \ libxi6 libxrandr2 libxrender1 libxss1 libxtst6 ca-certificates \ fonts-liberation libappindicator1 libnss3 lsb-release xdg-utils wget \ x11vnc x11-xkb-utils xfonts-100dpi xfonts-75dpi xfonts-scalable \ xfonts-cyrillic x11-apps xvfb ``` --- # OSCP — Attempt 1 - **URL**: https://thaomar.com/blog/2020-07-19-oscp-attempt-1/ - **Date**: 2020-07-19 - **Tags**: cybersecurity, oscp, certification - **Summary**: I really wish I could say I passed. Lessons learned from my first OSCP exam attempt. [image: OSCP image] Here are my thoughts and experiences after taking the OSCP exam for the first time. ## Preparation Going into the exam, I only did around 20 machines — just enough to get the 5 bonus points for finishing the course exercises and lab report. Aside from the lab machines, I also used Hack The Box (doing TJnull's list) and going through Virtual Hacking Lab machines. ## Exam booking I booked my exam for 8:00 am on a Saturday through the OSCP console. I suggest anyone reading to book your exam at least a month ahead because weekends will most likely be fully booked, leaving only weekdays open. I learned this the hard way and had to constantly check daily for a closer slot to when my labs ended. ## Exam start Proctoring starts 15 minutes before the exam. The proctoring steps involve logging in, setting up a Chrome extension, doing an ID check, and turning the webcam 360 degrees to let the proctor assess my surroundings. Once this was complete, I just had to wait until 8:00am sharp to get an email about the exam. ## 8:00 – 10:00 The first machine I did was the BOF. It was straightforward except I forgot a few bad characters which eventually took me an extra hour to finish. ## 10:00 – 10:30 The second machine was the 10 pointer. I found the exploit and finished this within 10 minutes. ## 10:30 – 16:00 This was mostly spent trying to crack one of the 20 point machines, which I could never get a shell on but had read access as a user account. ## 16:00 – 18:00 Got a reverse shell on the other 20 point machine. So far only 45 points. Trying to figure out privilege escalation. ## 18:00 – 22:00 Can't figure out privilege escalation. Feeling lost. Trying the 25 pointer machine got me nowhere either. ## 22:00 – 02:00 Found something interesting on the 25 pointer but still can't get an initial foothold. I call it a night and go to sleep. ## 06:00 – 08:00 I wake up to try and push one last time. I got nothing in. I called it a day and messaged my proctor to end my exam 10 minutes early. ## Finish I only ended up with 45 points. Not even close enough to pass. Honestly, a bit through the exam on one of the 20 point machines, I seriously felt that it was an impossible machine. I enumerated all the ports and left no stones unturned yet still couldn't get a shell. I went into the exam confidently yet left confused. ## Lessons learned - Enumerate more - Learn more about privilege escalation - Learn more about networking - Take more breaks ## Future For the next exam, I will try to book it at night. This way once I finish the buffer overflow machine and the 10 pointer, I can sleep and feel refreshed to tackle the rest of the machines. --- # Volatile Markets - **URL**: https://thaomar.com/blog/2020-03-17-volatile-markets/ - **Date**: 2020-03-17 - **Tags**: finance, investing - **Summary**: When gravity pulls the markets back down — thoughts on the COVID bear market. ## Pretext We should all fear the bear. Not the teddy bear that we all used to have as a child, but the one that eats away at our savings, our income, and our returns. Now for those who don't know what a bear market is, a bear market is simply defined as: *a market in which prices are falling, encouraging selling.* This has actually been happening for the past few weeks. With no end in sight, many people are selling amid this worldwide pandemic. Just on Sunday, the **Federal Reserve** lowered the interest rates to **0%**. This means that companies can borrow money essentially for *free*. This did nothing to calm the markets and instead sent it on an even steeper trajectory downwards on Monday. ## My thoughts My thoughts in these markets are simple. As more people panic sell, solid companies that are usually overpriced will now become cheap. I can therefore use this as an *opportunity* and swoop in to buy great companies at a discount. Just like how the markets rebounded after the great financial crisis, the dot-com bubble, or even the great recession, I believe that the markets will rebound again. It is very likely that we will see companies start going under. Especially with the recent slowdown in spending; companies will be forced to lay off workers and cut costs. Even the companies that will profit the most from this crisis such as online shops may see a revenue drop simply because people aren't spending as much. However, this will all be temporary. --- # School Closed - **URL**: https://thaomar.com/blog/2020-03-14-schools-closed/ - **Date**: 2020-03-14 - **Tags**: life, covid, university - **Summary**: UBC is closed for the rest of the term due to COVID-19. [image: UBC image] As the term began, something loomed over our heads. We all knew that there were reports of a supervirus that was coming our way. We didn't know how bad it would be. China had shut down the city of Wuhan and isolated many other cities in the Hubei province. Other countries watched while others argued that this is a violation to human rights. In hindsight, this might have been the best rulebook that other countries should have followed sooner. In around January, something peculiar happened. UBC closed on a school day for the first time in my four years there due to snow! That was unprecedented and caused a slight set-back in some of my courses. Fast forward to February, when the WHO started raising the alarms of a potential pandemic. Despite the warnings to contain the epidemic, many countries still simply chose to ignore the obvious signals. Schools in Canada were still open and the markets were in a huge upswing. Then all of a sudden, the music stopped. Italy shut down their borders. An unprecedented move that seems like only China could pull off. One of the first major signs that the virus was spreading all over the world. In an attempt to boost spending amid this COVID-19 slump, the feds and Bank of Canada decided to lower interest rates. This didn't help much. A few days after Italy announced their shut down, the markets crashed. More countries announced borders were closing while the Ontario government shut down universities. Public schools had their spring break extended by 2 weeks, effectively becoming a month long "spring break", while regular office workers were told to work from home if possible. Universities across Canada shut down as UBC and SFU were the last 2 remaining. Official statements stated that UBC could only shut down under the directives from the provincial government. Only a handful of students in class sizes of hundreds remained. My computer science class where it was usually hard to find seats became so empty I could sit wherever I liked. Then, at roughly 5pm, the announcement came. **UBC shut down.** This caused many anxiety and stress, while giving others relief that they don't have to risk themselves by going to school. While I am relieved that UBC closed, I am also frustrated that my midterm exams are now online instead. It is now only March, with 2 full months of school left. While UBC is closed for the rest of the term, nobody knows how final exams will be held. However, the classes going online may be a good thing for UBC. UBC has always been lacking in their distance education department. Most universities have lectures recorded in case students miss their classes. However, most courses at UBC don't offer this. Transitioning to online course content will also mean that most lectures will be recorded. Only time will tell how this pandemic turns out. ---