<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Carson Shaffer on Medium]]></title>
        <description><![CDATA[Stories by Carson Shaffer on Medium]]></description>
        <link>https://medium.com/@CarsonShaffer?source=rss-aaa9aec8f7d2------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*SahrPDhoxyUxAXeKqfvG7g.jpeg</url>
            <title>Stories by Carson Shaffer on Medium</title>
            <link>https://medium.com/@CarsonShaffer?source=rss-aaa9aec8f7d2------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 22 Nov 2026 08:53:41 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@CarsonShaffer/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[How I Study for GIAC Exams]]></title>
            <link>https://medium.com/@CarsonShaffer/how-i-study-for-giac-exams-fb97b6e2ec8d?source=rss-aaa9aec8f7d2------2</link>
            <guid isPermaLink="false">https://medium.com/p/fb97b6e2ec8d</guid>
            <category><![CDATA[guide]]></category>
            <category><![CDATA[san]]></category>
            <category><![CDATA[giac]]></category>
            <category><![CDATA[exam]]></category>
            <category><![CDATA[study]]></category>
            <dc:creator><![CDATA[Carson Shaffer]]></dc:creator>
            <pubDate>Sat, 31 Jan 2026 16:43:49 GMT</pubDate>
            <atom:updated>2026-06-29T19:40:37.222Z</atom:updated>
            <content:encoded><![CDATA[<h4>Effective Study Techniques for GIAC Exams</h4><blockquote>Note: This is general guidance on how I study, not a discussion of specific SANS course material or GIAC exam content. Please don’t ask me for specifics about exams or courses.</blockquote><p>I’ve taken 3 GIAC exams so far (GCIH, GSEC, GFACT) and have scored 100% on all of them.</p><p>Update: I am now at 100% on GDSA as well, and scored a 96% on GSTRT.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/943/1*iQKYCLUb8knHaFA65vP28g.png" /></figure><p>I posted about this on LinkedIn and received many messages asking me to discuss my study strategy. Prior to starting my first SANS course, SEC275, I decided to learn how to learn, which led me to the topic of effective studying techniques. This post will be a description of what I do to study.</p><p>The first and biggest thing to discuss is that this is what works for me. If you copy what I do one-for-one you will probably not have the same results. You should tailor your study system so it works best for you.</p><p>Second, I will not go deep into the why behind specific parts of my strategy. This post would be too long and boring if I did. If you are interested in the science behind effective learning, a fantastic book is <em>Make It Stick: The Science of Successful Learning</em> by Henry L. Roediger III, Mark A. McDaniel, and Peter C. Brown. It breaks down the research and will allow you to better implement a strategy that works for you.</p><h3>The Forgetting Curve</h3><p>This is the most important concept to be aware of when studying. The forgetting curve is our main enemy when it comes to learning.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*JKPjBp3IgiI6jMJp.png" /><figcaption>The <a href="https://en.wikipedia.org/wiki/Forgetting_curve#/media/File:Forgetting_curve_decline.svg">forgetting curve</a> (<a href="https://en.wikipedia.org/wiki/Forgetting_curve">https://en.wikipedia.org/wiki/Forgetting_curve</a>)</figcaption></figure><p>While the rate of memory decay varies among people and the topic being learned, we typically forget new information very quickly. The primary goal when studying is to delay and flatten this curve as much as possible through review.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*6qXVlwAfAxIr_MaZ.png" /><figcaption><a href="https://en.wikipedia.org/wiki/Forgetting_curve#/media/File:ForgettingCurve.svg">Forgetting Curve with Spaced Repetition</a></figcaption></figure><h3>Sources of Information</h3><p>I only focus on material that will be relevant to the exam. This means I use the official SANS course material and nothing else. Supplementary material and labs may help, but so far I have not felt the need to use any. In each course, I use the following from the official SANS course:</p><ul><li>Books</li><li>Quizzes</li><li>Labs and any additional hands-on material</li><li>Provided index, cheat sheets</li></ul><p>I do not watch the course videos as they do not engage my brain as much as the books, which makes the material harder to recall. I also have only done courses on-demand. The in-person offerings seem like they would be too much information in too short of time, resulting in poor learning due to cognitive overload.</p><p>For the books, I use colored tabs and a felt pen to mark the book number at the top and each individual section within. This makes navigating through the book pretty fast during the exam when needed.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Z7k7j4c7XsJxqm6hU6LcLw.png" /><figcaption>Tabbing the sections of the book</figcaption></figure><p>I begin the course as soon as I have access. This ensures I have enough time to go through the material and reinforce what is taught.</p><h3>Index</h3><p>I do not make an index and rely solely on the index provided with the course. Before starting my SANS courses, I read through a lot of the advice given to students on the GIAC subreddit and watched videos where people shared their techniques. The general advice given is to make an index with every potentially important word throughout the book, then use the index during the exam to find the information.</p><p>I think this is an incredibly poor way to prepare and will result in poor long-term understanding and recall of the information. The focus of many students seems to be on optimizing where to find the information in the book quickly instead of just learning the information to begin with.</p><p>For GFACT, I made an index, but wound up barely using it on the actual exam. After that, I just used the included index, which has worked out fine for the handful of times I have had to look at it during an exam.</p><p>I do think an index can be helpful, but as a complement instead of the main engine for learning and passing the exam. For making an index, most people point to Lesley Carhart’s (the GOAT) <a href="https://tisiphone.net/2015/08/18/giac-testing/"><em>Better GIAC Testing with Pancakes</em></a><em> </em>post.</p><p>I compile the provided index and any additional material like cheat sheets into one document. I then have it printed and bound through FedEx.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vOkYChH2d8ksMrKDj5aVSw.jpeg" /></figure><h3>Anki</h3><blockquote>Anki is spaced repetition software. If you do not already know what Anki is, they have a fantastic explanation available here: <a href="https://docs.ankiweb.net/background.html">https://docs.ankiweb.net/background.html</a>.</blockquote><p>Spaced repetition and retrieval practice are the key to my study strategy. Anki covers both of those areas. I complete the review everyday for all of my decks, typically during my lunch break, right after waking up, or before bed.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*S9gqDHhMjfISj9j35rT0pg.png" /><figcaption>Total review for GCIH</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/903/1*orXVrmO-b6yb1xOkG8GTyw.png" /><figcaption>Total cards for GCIH</figcaption></figure><p>Anki ensures the material I read 2 weeks ago is as fresh as the material I read today. This is extremely powerful in combating the forgetting curve.</p><p>My Anki new card approach is fairly aggressive. I add in a max of 50 cards each day, which adds up pretty quickly in the daily review.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/905/1*y788K7VoGmLjzTuKabZqCw.png" /><figcaption>Anki Daily Limit and New Card settings</figcaption></figure><h3>Reading and Creating Anki Cards</h3><p>For each book in the course, I try to make Anki cards for every piece of information. I think of it like wringing out a rag, the goal is to squeeze as much information out of the books and into Anki as possible. I don’t get everything, but I’ll know the answer to most exam questions immediately, providing plenty of time to find the answers to questions I don’t know or I’m not 100% sure of.</p><p>One of the most important things I do while creating Anki cards is to explain the concept in my own words. If I can explain the concept, then I know I understand it. If I’m unable to, then I am either not understanding what I’ve read or I’m missing a foundational or background piece of information that I need to know before I can understand the material. Copying directly from the book would be a poor way to study because I would then be memorizing someone else’s understanding of the material instead of probing and developing my own understanding.</p><p>However, not everything needs to be explained in my own words. Information that is just straight memorization like names, acronyms, and definitions don’t need a thorough breakdown.</p><p>I asked ChatGPT to generate a paragraph about C that could appear in a college textbook. Let’s assume I am taking a course on C and this paragraph shows up, here are the cards I would make.</p><blockquote>The C programming language was created in 1972 by Dennis Ritchie at Bell Laboratories during the development of the Unix operating system. C is considered a systems programming language because it allows direct access to memory through pointers. In C, arrays and pointers are closely related: when an array is used in most expressions, its name is converted to a pointer to the array’s first element, so array indexing is defined in terms of pointer arithmetic.</blockquote><pre>Card 1<br>Front: In what year was the C programming language created?<br>Back: 1972<br><br>Card 2<br>Front: Who created the C programming language?<br>Back: Dennis Ritchie<br><br>Card 3<br>Front: At which organization was C developed?<br>Back: Bell Laboratories<br><br>Card 4<br>Front: What operating system was C originally developed for?<br>Back: Unix<br><br>Card 5<br>Front: What makes a programming language like C a systems programming language?<br>Back: Systems programming languages allow direct access to memory.<br><br>Card 6<br>Front: What does C use to directly access memory?<br>Back: Pointers<br><br>Card 7<br>Front: In C, how are arrays and pointers related?<br>Back: An array&#39;s name is converted into a pointer that starts at the array&#39;s first element.<br><br>Card 8<br>Front: How are array indexes defined?<br>Back: Pointer arithmetic</pre><p>In this case, cards 1 through 4 are what I call “exam trivia”. These cards are not important to my long-term knowledge, but are needed simply because it may be on the exam. After finishing the exam, I will remove these from my Anki set so they don’t take up space. This is information I am fine with forgetting after the exam.</p><p>Cards 5 and 6 are things that I understand from reading the text based on my current background knowledge of the topic. I will keep these cards after the exam and continue to review them forever.</p><p>Cards 7 and 8 are topics that I do not fully understand and would need the ideas (like pointer arithmetic) to be defined in another portion of the text or I’d have to seek out supplementary information. If the C course covered pointer arithmetic in another section, then I’d have cards related to that which would ensure I understand the concept.</p><p>I aim to create at least 50 cards per day. The earlier I begin reviewing cards in Anki, the longer I have time to reinforce and practice the ideas I’ve made cards for. I make Anki cards for everything, including commands, procedures, and concepts from the labs. I don’t tag cards or use any other card types like cloze deletion. These would add a lot of time to card creation for me, and I don’t think the return is worth it.</p><p>I try to never return to a page after reading. Re-reading content creates the illusion of competence, where familiarity with a text is mistaken for understanding of it. I trust that I’ve extracted everything necessary during the first reading and do not need to re-read it.</p><h3>Distraction-Free Environment</h3><p>Having a distraction-free environment is essential when I study. I achieve this by having a separate area and desk for studying. I keep any potential distractions in another room. The only things on the desk are my laptop, books, planner, desk lamp, timer, and water. Everything else is out of sight and out of mind.</p><p>I do not listen to anything while studying, the desk faces a blank wall, and I usually keep my door closed as well. This effectively eliminates all potential distractions. If I’m not feeling in the groove to begin studying, I’ll also turn the internet off on my laptop so I’m not tempted to doomscroll and procrastinate.</p><h3>Avoiding Cognitive Overload</h3><p>Cognitive overload occurs when too much information is attempted to be learned in too short of a period of time. We are only able to hold a small amount of information in our working memory at once, and if this becomes too saturated, we won’t be able to juggle all of the information, and we’ll forget it faster.</p><p>I use a timer to ensure I do not study for longer than 50 minutes at a time. After 50 minutes I take a short break to let my mind process through the last session and reset for the next. During each break, I typically just do a chore I need to do or respond to messages.</p><p>I also do not try to study too much during a day. Too much information in a day begins to become ineffective. Having a massive backlog of Anki cards is also bad because it means I’ll be further down the curve of forgetting before I see the card for the first time. Once I hit a backlog of about 150 cards, I take a day off of studying and just do Anki review for the day.</p><h3>Integrating Labs</h3><p>Labs are the first test of being able to apply what has been taught in the course. I always try to initially complete the lab without help, then work through the lab book if I cannot figure it out. Like with the regular textbooks, anything included in the lab is made into Anki cards, following the same formula that I use when making cards from the textbooks. If I find an alternative way to do something, I include that as well.</p><p>After finishing a lab, I take a mental note of what I struggled with or could have done better. This typically ends up being things that I need to make Anki cards on or ensure I take into account in future labs.</p><h3>Quizzes and Practice Tests</h3><p>The course quizzes and practice tests are key areas of feedback to determine where I stand with the material. I take the quizzes directly after completing the associated book. For questions I miss, I make sure I know why I missed it. This reveals misunderstandings I have with the content, allowing me to correct them.</p><p>For practice tests, there are a few different ways I’ve approached them, and I’m still trying to figure out which is most effective for me. Primarily, I’ve alternated between simulating the exam and not using any resources at all. With simulating the exam, I try to treat it like the real thing, ensuring I fully know an answer before submitting and being extra careful. I’m really bad at doing this because I end up never taking it as seriously as I take the actual exam. I submit answers I’m not 100% sure of.</p><p>When I do practice exams without any resources, I try to see what score I would get without any help. This has been a very strong way to highlight exactly what I’m slow at or need to gain a better understanding of.</p><p>For both practice tests, I choose to enable the setting that immediately provides feedback for wrong answers. This makes sure I can figure out where my understanding is weak.</p><h3>Exam Strategy</h3><p>I take all exams in-person at a Pearson VUE testing center. This way I don’t have to worry about power or internet issues, or anything else that could be distracting during the test.</p><p>My exam strategy is fairly simple. If I know an answer, I submit it and move on. If I don’t know or am not sure if it’s correct, I skip it and return later. I try not to pull my books out at all until the end to make sure I have more than enough time for the harder questions. I’ve found that I know so much of the information due to my preparation that I am able to answer a majority of the questions immediately. This saves a ton of time that I then spend digging on the previously skipped hard questions.</p><h3>Post-Exam</h3><p>After the exam I archive the course Anki deck, I then move the cards over into a large combined deck with the cards from every previous course. I review this deck every day to ensure I retain the knowledge covered in the courses I’ve taken. While doing combined deck review, I delete any cards that pop up and are exam trivia or things I don’t care to remember long term.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/898/1*b6xKWVa7bXl2o0mACdaM8Q.png" /><figcaption>Card counts for my combined deck</figcaption></figure><p>I also take time to think through ways I can tweak how I studied to be more effective or things I’d like to experiment with next time.</p><h3>Why This Strategy Works</h3><p>The reason this strategy works is because it effectively fights the forgetting curve. I think the primary benefit of this strategy is that it allows me to answer most of the exam questions instantly. This ends up saving so much time that I can flip through multiple books to find the information for the difficult or nuanced questions I skipped.</p><p>So far, this study strategy has worked very well for me. At some point I will not get 100% (tragic), but I do think this strategy can pretty much guarantee a very high score for every class. I’m really looking forward to testing it against GDSA and GCIA, which I think will be a true test of how well the strategy works.</p><h3>Summary</h3><p>Here is a condensed version of this post.</p><h4>Basic rules:</h4><ol><li>Begin studying the course material as soon as possible.</li><li>Do not study for more than 50 minutes without a break.</li><li>Do Anki review everyday.</li><li>Study in a distraction-free environment.</li></ol><h4>Studying:</h4><ol><li>Create Anki cards for each piece of information based on your understanding of the material.</li><li>Avoid studying too much in a day or creating a large backlog of Anki cards.</li><li>Attempt labs without help.</li><li>Use quizzes and practice tests to identify weak areas.</li><li>Use an index as a complement (optional).</li><li>Move course Anki cards into a combined deck after completing the exam.</li></ol><h3>Questions</h3><p>If you have any questions, feel free to comment them here, email me (carson@carsonshaffer.me), or DM me on LinkedIn (<a href="https://www.linkedin.com/in/c-shaffer/">https://www.linkedin.com/in/c-shaffer/</a>). I’ll try to get back to you as soon as possible.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fb97b6e2ec8d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[TryHackMe | Industrial Intrusion— OSINT Writeup]]></title>
            <link>https://medium.com/@CarsonShaffer/tryhackme-industrial-intrusion-osint-writeup-1bf47d8f9b40?source=rss-aaa9aec8f7d2------2</link>
            <guid isPermaLink="false">https://medium.com/p/1bf47d8f9b40</guid>
            <category><![CDATA[industrial-intrusion]]></category>
            <category><![CDATA[tryhackme-writeup]]></category>
            <category><![CDATA[tryhackme]]></category>
            <category><![CDATA[tryhackme-walkthrough]]></category>
            <category><![CDATA[osint]]></category>
            <dc:creator><![CDATA[Carson Shaffer]]></dc:creator>
            <pubDate>Sun, 29 Jun 2025 23:01:56 GMT</pubDate>
            <atom:updated>2025-07-01T11:42:41.588Z</atom:updated>
            <content:encoded><![CDATA[<h3>TryHackMe | Industrial Intrusion - OSINT Writeup</h3><p>TryHackMe’s Industrial Intrusion is a capture the flag (CTF) event oriented towards students and people newer to CTF challenges. The competition ran from June 27 through June 29. As of writing, the challenges are available <a href="https://tryhackme.com/room/industrial-intrusion">here</a>. This write-up will cover the open-source intelligence (OSINT) challenges from the event.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/0*adiozsUwEk1L87h8" /></figure><h3>OSINT 1</h3><h4>“Hexline, we need your help investigating the phishing attack from 3 months ago. We believe the threat actor managed to hijack our domain virelia-water.it.com and used it to host some of their infrastructure at the time. Use your OSINT skills to find information about the infrastructure they used during their campaign.”</h4><p>We can start by navigating to the domain we’ve been provided. Based on the description, it seems the threat actor may have used a directory or subdomain to conduct their attack.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wGVExJirw_SNVPIExuHuCw.png" /><figcaption>Virelia Water Control website</figcaption></figure><p>The website is bare bones and does not contain much interesting information. Looking through the source code does not reveal anything that can help us. Since the phishing attack occurred 3 months ago, a resource such as the Wayback Machine may provide us an archived version of the page.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/218/1*ZyKF5wtCamVnVf0ICSJ47w.png" /><figcaption>Only results for June</figcaption></figure><p>Unfortunately, our only entry on the Wayback Machine is during the event, meaning no information related to the phishing page will be found. I believe brute force searching for a subdomain or directory was out of scope, so let’s continue with passive enumeration. I searched for the domain on crt.sh, which had useful results:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5jsnmdn5tGqGvKQGXQfXrA.png" /><figcaption>Results from crt.sh</figcaption></figure><p>The long subdomain that looks like a random mix of letters and numbers is very interesting. It looks like Hex, and if we take the subdomain and plug it into CyberChef, we get the first flag.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*L295IVn-xTjga1dQoEFtZg.png" /><figcaption>Finding flag 1</figcaption></figure><h3>OSINT 2</h3><h4>“Great work on uncovering that suspicious subdomain, Hexline. However, your work here isn’t done yet, we believe there is more.”</h4><p>There appears to be more information we need regarding the domain. In our results from crt.sh, there was one other subdomain listed: stage0.virelia-water.it.com.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wsgvQxZhzFFbu_FWvGwAuA.png" /><figcaption>What the subdomain looks like</figcaption></figure><p>Nothing here directly appears to be interesting for our investigation. I looked in some other places before coming back to this website, which is when I found something interesting:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rnQkTfoZ7ashDY4TZdMVLQ.png" /><figcaption>Source code script</figcaption></figure><p>At the end of the source code is a script pulling from a init.js file on GitHub. Looking at the file provides a subdomain that we have not previously seen.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GJJ1z52EywNIbx_2OFi6sg.png" /><figcaption>New subdomain found</figcaption></figure><p>We can also look through the profile for the GitHub user, but this does not reveal any information relevant to our investigation.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0cbgYjNxJO81jZYN7YlU7g.png" /><figcaption>GitHub profile</figcaption></figure><p>We are unable to access this subdomain. However, we can still query it for information. I used the site <a href="https://dnschecker.org/all-dns-records-of-domain.php">dnschecker.org</a>, which allowed me to search for all DNS records at once. The dig tool would also be useful to query for information. From that, we can find a TXT record on for the subdomain, which looks like a Base64 string.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/698/1*dsOXBiFONZVSMYMNrSguWw.png" /><figcaption>TXT record for the subdomain</figcaption></figure><p>Plugging this string into CyberChef reveals the second flag.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*W6gCfTE7j74gFGb3xBkwwg.png" /><figcaption>Finding flag 2</figcaption></figure><h3>OSINT 3</h3><h4>After the initial breach, a single OT-Alert appeared in Virelia’s monthly digest — an otherwise unremarkable maintenance notice, mysteriously signed with PGP. Corporate auditors quietly removed the report days later, fearing it might be malicious. Your mission is to uncover more information about this mysterious signed PGP maintenance message.</h4><p>We need to find the report with the PGP signing. We can see the entry for the report on the original virelia-water.it.com website in the archives. When trying to access the report, it has been removed.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gMLzFnTj6VX1uNnPbTMOTA.png" /><figcaption>Removed report</figcaption></figure><p>Our first step is to find an archived version of this page. We knew it was active for a few days, but it does not show up on the Wayback Machine or archive.today.</p><p>The Water Control site is hosted on GitHub. I confirmed this while doing initial searches for the domain (the IP is GitHub), and triggering a 404 also shows the default GitHub Pages 404 information.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DdCCbeOZDoaK0a0-1fqKTA.png" /><figcaption>404 Error</figcaption></figure><p>This means that we can find the repository that the site uses by searching for some of the site code. I used the following from the source code and performed a basic search on GitHub.</p><p>&lt;p&gt;Welcome to the Virelia Water Control Facility corporate portal. Use the navigation above to view OT alerts, compliance policies, or contact support.&lt;/p&gt;</p><p>This returned two results, let’s check out the repository owned by the virelia-water account.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*74hoWEhF_g08F2xPCFGetw.png" /><figcaption>Code search results</figcaption></figure><p>We can see the mail-archives folder with the update note for the report that was removed.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JTGkH7UAV-djK9zQy2p-RQ.png" /><figcaption>Repository</figcaption></figure><p>Whenever a file is changed on GitHub, users are able to view what the previous file looked like. In this case, removing or changing the report we’re searching for does not mean it is truly deleted, we just have to look in the commit history.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7AaSrgB5OIO3nQj8Z4r9dw.png" /><figcaption>Looking at the report</figcaption></figure><p>When we look at the history, we can see the PGP-signed report entry.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VhwSNY5KsmlZgVDHNAf0bg.png" /><figcaption>Finding the original report</figcaption></figure><p>All we have to do is click into the report and we can see everything.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FZxbcoTEPzv1z_IzKUXwQA.png" /><figcaption>Looking at the PGP signature</figcaption></figure><p>Now we can move onto finding out more about who signed the file. There are multiple ways to go about it. I’ll start with what I believe is the intended way, then show the easy way.</p><p>We’ll begin the intended way by copying the PGP signature from the -----BEGIN PGP SIGNATURE----- to the -----END PGP SIGNATURE-----. Next, we’ll open up a shell and save the signature as a .asc file. Then we’ll use the following command to retrieve the fingerprint from the signature.</p><pre>gpg --list-packets [FILE NAME].asc</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/910/1*8u1HNrpjusY6anbneDCJHw.png" /><figcaption>Grabbing the fingerprint</figcaption></figure><p>We want the entire fpr v4 for this, which is simply the unique identifier for the key. We’ll query a keyserver to see if they have information on the owner. We’ll use the following command:</p><p>gpg --keyserver hkps://keyserver.ubuntu.com --recv-keys 88DEDE7B730513BD5EDD6D9FA4F0FEB084A311E5</p><p>This provides us with the final flag.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*svvFy3x-XgSM39Jpa3VvPg.png" /><figcaption>Finding flag 3</figcaption></figure><p>While that way was not too complicated, the easy way is faster. To find the flag easily, we must return to the report we found.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FZxbcoTEPzv1z_IzKUXwQA.png" /><figcaption>Report</figcaption></figure><p>We can see the email address alerts@virelia-water.it.com listed in the “From” section. If we go to <a href="https://keyserver.ubuntu.com/">keyserver.ubuntu.com</a> we can simply search for the email address and find the flag.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*27HK_JjtIqfuB9hBTXMhUA.png" /></figure><p>That’s it for the OSINT challenges! Overall, I think these challenges were pretty good. I like that TryHackMe is running more CTF events, and I hope they do more in the future!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1bf47d8f9b40" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[TryHackMe | Hackfinity Battle - Forensics Writeup]]></title>
            <link>https://medium.com/@CarsonShaffer/tryhackme-hackfinity-battle-forensics-writeup-6584c41c244f?source=rss-aaa9aec8f7d2------2</link>
            <guid isPermaLink="false">https://medium.com/p/6584c41c244f</guid>
            <category><![CDATA[tryhackme]]></category>
            <category><![CDATA[tryhackme-writeup]]></category>
            <category><![CDATA[tryhackme-sequel-dump]]></category>
            <category><![CDATA[tryhackme-walkthrough]]></category>
            <category><![CDATA[tryhackme-hackfinity]]></category>
            <dc:creator><![CDATA[Carson Shaffer]]></dc:creator>
            <pubDate>Fri, 28 Mar 2025 20:39:16 GMT</pubDate>
            <atom:updated>2025-07-02T18:16:26.552Z</atom:updated>
            <content:encoded><![CDATA[<p>TryHackMe’s Hackfinity Battle is a capture the flag (CTF) event oriented towards students and people newer to CTF challenges. The competition ran from March 17 to March 20. As of this writing, the challenges are available <a href="https://tryhackme.com/room/HackfinityBattleEncore">here</a> through March 30. This write-up will cover the forensics challenges from the event.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/0*UqeD2BQaRuK-Wz8l" /></figure><h3>Stolen Mount</h3><h4>An intruder has infiltrated our network and targeted the NFS server where the backup files are stored. A classified secret was accessed and stolen. The only trace left behind is a packet capture (PCAP) file recorded during the incident. Your mission, should you accept it, is to discover the contents of the stolen data.</h4><p>Starting the attached virtual machine, we can see the challenge.pcapng file. Let’s open it and see what’s inside.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ywxHVN5JxGsAfKZBKKHogA.png" /><figcaption>Inspecting the challenge.pcapng file</figcaption></figure><p>Let’s start by following the stream for this capture. We can view the TCP stream for this file by right-clicking on a packet, hovering over Follow, and clicking TCP Stream.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QVEBmgOav0qKmFLLX0oHVA.png" /><figcaption>Following the stream</figcaption></figure><p>Looking through the stream, a lot of the data seems pretty random and unhelpful. However, if we look closely, we can see something that points us in the right direction.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8hlGMr1QJC2C4WTP4JhKVQ.png" /><figcaption>Interesting data in the stream</figcaption></figure><p>First off, we can see an MD5 hash that seems to be labeled “Archive Password”. We can also see two file name, hidden_stash.zip and secrets.png. This sounds like what we’re searching for to recover. Let’s see if we can use a service like <a href="https://crackstation.net/">CrackStation</a> to uncover what the MD5 hashed password is.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Z8UGm-DZFTBAg2FzIO_gnA.png" /><figcaption>MD5 hashed password</figcaption></figure><p>The password for the archive is “avengers”. We’ll save that for later and move on to the next part. The file we want (secrets.png) seems to be in a zip file, so we should focus on extracting the zip file from the packets in our capture. Files are designated by their <a href="https://en.wikipedia.org/wiki/List_of_file_signatures">magic bytes,</a> which are added at the beginning and ends of files. If we want to extract the zip file, we need to pull everything from the start of its magic bytes to the end.</p><p>For our file, we are looking for the starting magic bytes 50 4B 03 04 and ending magic bytes 50 4B 05 06. We can switch our stream view to raw and use the find feature to see the beginning and end.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*aKNtKsEipRn59-bJa26OMw.png" /><figcaption>Finding the magic bytes</figcaption></figure><p>This is enough information to recover the file, but it’s not 100% complete. While our ending magic bytes are correct, the remaining string of blue text in the screenshot is needed to correctly display the preview of the file. So, we can extract either the information from the beginning magic bytes to the end, or from the beginning magic bytes to the end of the blue text in our screenshot. For the challenge, it doesn’t matter what we do, but I’ll show how the two differ.</p><p>To recover our file, we’ll copy the text from the beginning of our magic bytes to the end. Then, we’ll paste it into a tool like <a href="https://hexed.it/">HexEd.it</a>. When pasting, we’re provided a few options, the default is sufficient.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/358/1*z_TglSjz416DKL23rvmc_A.png" /><figcaption>Inserting our data</figcaption></figure><p>Our output should look like the following.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1014/1*qYdLh35FGFuv0wD8rZK0xg.png" /><figcaption>Our file in HexEd.it</figcaption></figure><p>Now, we can simply click Export, name our zip file (I chose hidden_stash.zip), and save it to our computer.</p><p>Here is where we’ll notice the only difference in how we chose our data above. If we only copy to the end of the magic bytes, we’ll see an error when we try to preview the content of the zip file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iUMXVIMJT7RB57VDh-DjBw.png" /><figcaption>An error when previewing the zip</figcaption></figure><p>If we instead went to the end of the blue text, the file preview would work.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9S3Ja0K9G13udXBZf4sS0Q.png" /><figcaption>Previewing the file</figcaption></figure><p>This will not change our results, we can still choose to extract the content of the file, which requires a password (the one we found earlier).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/460/1*tuLvaY5aApXZDfqpjXML2g.png" /><figcaption>Extracting the content</figcaption></figure><p>This extracts a file called hidden_stash.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/778/1*n1YAGDFFYKdORMQ6L7lPHw.png" /><figcaption>Extracted folder</figcaption></figure><p>A single file exists inside, secrets.png, which is a QR code.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/522/1*rLGKaSswO77Vx_zHPKiN_g.png" /><figcaption>QR code image</figcaption></figure><p>With our recovered image, we can upload it to a QR code reader to find our flag.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/929/1*zz6GLBmsXW08AOhCFVegfg.png" /><figcaption>Finding our flag</figcaption></figure><p>We can then submit that and move on to the next challenge.</p><h3>Infinity Shell</h3><h4>Cipher’s legion of bots has exploited a known vulnerability in our web application, leaving behind a dangerous web shell implant. Investigate the breach and trace the attacker’s footsteps!</h4><p>We know that our web application was exploited, so let’s start by checking out our web app directory. We can find the web app directory in /var/www/html, which is a common place to store web application files.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/734/1*32IJlq1YMirydfJsyPEXYg.png" /><figcaption>Navigating to /var/www/html</figcaption></figure><p>If we open the index.html file, we’ll see that it is the default Apache2 page. This aligns with the directory structure since /var/www/html is the default for Apache.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ToOtHBCHpEZs24ocG5_Rdg.png" /><figcaption>Opening the index.html file</figcaption></figure><p>There is also the CMSsite-master directory, which includes many files.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/919/1*N-Btvb6EGWY8gf3i0k7tEg.png" /><figcaption>Listing the CMSsite-master directory</figcaption></figure><p>We know our attacker used the web application to upload a web shell, which means the attacker was probably able to upload a file that was not properly validated. From my view, the most likely candidate to check would be the img directory.</p><p>Listing the contents of the directory shows us a suspicious file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/982/1*8BGtgWG9FbrxbFM1-0PCEg.png" /><figcaption>Listing the img directory</figcaption></figure><p>Images do not end with .php, but many web shells do. Let’s cat the file to see what it does.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/717/1*cqXvt6zRT2LXKSTK87zxZw.png" /><figcaption>Reading the web shell</figcaption></figure><p>This file takes the query, decodes it from Base64, and executes it. The attacker would be sending web requests that must include the following:</p><p>/images.php?query=[Base64 command]</p><p>Now that we know what we’re looking for, we can head over to our logs to figure out what commands the attacker ran on our machine. Since we know we’re using Apache2, we’ll go to /var/log/apache2.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/996/1*Jy2c50Oznps3mED_a_06mA.png" /><figcaption>Listing our Apache2 logs</figcaption></figure><p>If we cat the other_vhosts_acces.log.1 file, we’ll see the requests sent to the web app.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*r9XPISaBnkPtER-AS2E4ow.png" /><figcaption>Reading the logs</figcaption></figure><p>We know the query to look for, so let’s use grep to narrow down the logs to any that have our web shell.</p><p>cat other_vhosts_access.log.1 | grep &quot;images.php&quot;</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uxRy9uA4OvRTkbOiuDaolA.png" /><figcaption>Finding the malicious commands</figcaption></figure><p>We can see a few Base64 strings, which are the commands the attacker is running on our machine. We can copy each Base64 string and paste it into a tool like <a href="https://cyberchef.io/">CyberChef</a> to find out what the attacker did.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*K7_piqNozl4NlAzyy-K9nQ.png" /><figcaption>Finding out the commands</figcaption></figure><p>One of the commands run is the flag. We can submit it and move on to the next challenge.</p><h3>Sneaky Patch</h3><h4>A high-value system has been compromised. Security analysts have detected suspicious activity within the kernel, but the attacker’s presence remains hidden. Traditional detection tools have failed, and the intruder has established deep persistence. Investigate a live system suspected of running a kernel-level backdoor.</h4><p>Based on the description, we know our kernel has suspicious activity occurring. To begin investigating, we’ll switch to root and run the dmesg command to see the kernel logs.</p><p>In the last few lines, we see something suspicious</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WczHNe6you_NfxEdIap1-A.png" /><figcaption>Suspicious kernel logs</figcaption></figure><p>We can see that a module that failed verification called “spatch” (sneaky patch?) was loaded. Then, we can see our backdoor run the id command. Let’s find out more information on this spatch module by running the following command:</p><p>modinfo spatch</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/787/1*gbOqkamfGbs9NfRDtRvvYw.png" /><figcaption>Finding information on the suspicious module</figcaption></figure><p>This is definitely our backdoor, and we now have the full path of the file. Let’s see if there are any interesting strings by running:</p><p>strings /lib/modules/6.8.0–1016-aws/kernel/drivers/misc/spatch.ko</p><p>If we scroll down just a bit, we see something important.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/942/1*oyG5KRXrxJJ1oNhrjkKDsA.png" /><figcaption>Finding the secret</figcaption></figure><p>Copying and pasting the secret into <a href="https://cyberchef.io/">CyberChef</a> and decoding the hex reveals the flag.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fPYK4VbjKkYkftVE8ZQH_Q.png" /><figcaption>Decoding the flag</figcaption></figure><h3>Hide and Seek</h3><h4>A note was discovered on the compromised system, taunting us. It suggests multiple persistence mechanisms have been implanted, ensuring that Cipher can return whenever he pleases. Here’s the note:</h4><blockquote><em>Dear Specter,</em><br><em>I must say, it’s been a thrill dancing through your systems. You lock the doors; I pick the locks. You set up alarms; I waltz right past them. But today, my dear adversary, I’ve left you a little game.</em></blockquote><blockquote><em>I’ve sprinkled a few persistence implants across your system, like digital Easter eggs, and I’m giving you a sporting chance to find them. Each one has a clue because where’s the fun in a silent hack?</em></blockquote><blockquote><em>Time is on my side, always running like clockwork.</em></blockquote><blockquote><em>A secret handshake gets me in every time.</em></blockquote><blockquote><em>Whenever you set the stage, I make my entrance.</em></blockquote><blockquote><em>I run with the big dogs, booting up alongside the system.</em></blockquote><blockquote><em>I love welcome messages.</em></blockquote><blockquote><em>Find them all, and you might earn a little respect. Miss one, and well… let’s say I’ll be back before you even realize I never left. Happy hunting, Specter. May the best ghost win.</em></blockquote><blockquote><strong><em>- Cipher</em></strong></blockquote><p>Based on the note, we know there are 5 persistence mechanisms that have been used. This is my understanding of the clues:</p><ul><li><em>Time is on my side, always running like clockwork.</em></li></ul><p>This seems like a cronjob running on an account. This would automatically run a command at a set time interval.</p><ul><li><em>A secret handshake gets me in every time.</em></li></ul><p>A secret handshake sounds like an SSH key. We’ll need to check the authorized keys file on all of our accounts.</p><ul><li><em>Whenever you set the stage, I make my entrance.</em></li></ul><p>Setting the stage may refer to scripts that are run when a user logs in.</p><ul><li><em>I run with the big dogs, booting up alongside the system.</em></li></ul><p>This would be a service that is set to run when the system is started.</p><ul><li><em>I love welcome messages.</em></li></ul><p>A welcome message would probably be associated with the message of the day (MOTD), which is sent when a user logs in.</p><p>We’ll begin our investigation with the first clue, and look in our crontab. Since we’ll be looking into multiple users and services, we’ll become root. As root, we’ll run crontab -l, which will list our cronjobs. Scrolling down a bit, we can see a suspicious command.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/897/1*5lCwbK2FvhR6HCvB35U1YQ.png" /><figcaption>Finding the suspicious cronjob</figcaption></figure><p>Let’s copy the Base64 and paste it into CyberChef.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VNMU4OpNzNZlCdN4H3LKHg.png" /><figcaption>Decoding the command</figcaption></figure><p>The command downloads a shell script from the attacker’s website and pipes it into bash. Let’s copy the numbers in the subdomain and try decoding that.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9ldHDg5VzkrW-uuM7Z9FKA.png" /><figcaption>First part of the flag</figcaption></figure><p>Great! We’ve gotten the first part of the flag. Now we can move to the second clue and look for our secret handshake. We’ll start by navigating to the /home directory and seeing our users.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/895/1*EUOwnc_NTkgwcvDGK1VG_A.png" /><figcaption>Looking at our users in /home</figcaption></figure><p>Then, we can go one-by-one and see if they have a .ssh folder, and if they do, what is inside. The zeroday user has an interesting entry.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/897/1*gMPJk9BcrDAGcWVoxLk5kQ.png" /><figcaption>Reading the authorized keys file</figcaption></figure><p>Like last time, we can plug the hexadecimal into CyberChef and find the part of the flag.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/580/1*FVjM4lsi2y2xPp3xyus-Xw.png" /><figcaption>Finding the second part of the flag</figcaption></figure><p>Moving on to the third clue, we need to inspect things related to “setting the stage”. This may refer to the .bashrc file, which would run whenever a user logs in. Typically, this file is used for configurations, but an attacker using this as a persistence method would regain access to our system every single time the user logs in.</p><p>Like finding the SSH key, we’ll go user by user and read the .bashrc file. Once we get to the void user, we find our suspicious entry.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1016/1*CFyTjIU_VEObIQmrVWCHKA.png" /><figcaption>Finding the suspicious .bashrc entry</figcaption></figure><p>We can take the hexadecimal from the subdomain, plug it into CyberChef, and find the output is Base64.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1011/1*ZcnbkYGOgu6-dwGo5l6F7g.png" /><figcaption>Decoding the hex</figcaption></figure><p>We can add Decode Base64 to our recipe to uncover the next part of the flag.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1011/1*7ziURyH-e8SDIiZ7x9V7WQ.png" /><figcaption>Decoding the third part of the flag</figcaption></figure><p>Let’s move on to clue number 4, and find what is booting up alongside the system. This sounds like it is a service that is set to run automatically. We can run the following command to list every service that starts on boot.</p><p>systemctl list-unit-file --type=service | grep enabled</p><p>I’ll break down the command:</p><p>systemctl: CLI tool to interact with systemd, which is the Linux system manager.</p><p>list-unit-files: Command that will list the unit files, which are things like services or sockets.</p><p>--type=service: Narrows our search down to only services</p><p>| grep enabled: will pipe the output to grep, which will then only output the services that are enabled. When a service is enabled, it means it will run when the system boots.</p><p>The output of this command shows something suspicious.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1010/1*6VzsdXTj48oKrmC03axrJg.png" /><figcaption>Suspicious service</figcaption></figure><p>With the service identified, we can run the status command to find more information, which shows us the full file path.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1007/1*WAy12Fml0XRYxr-A-6DzCQ.png" /><figcaption>Finding the full file path</figcaption></figure><p>With this piece of information, we can cat the file to read what’s inside.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1010/1*E-fIlj4WDBjfvmtMLZK5VQ.png" /><figcaption>Reading the suspicious service</figcaption></figure><p>Like the previous flags, we can copy and paste the subdomain into CyberChef to find the next piece of the flag.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/832/1*XgO7zI80bGL67ovKuNifHg.png" /><figcaption>Finding the next piece of the flag</figcaption></figure><p>The next clue hinted at welcome messages, which is almost certainly the message of the day. I’ve never looked into MOTD persistence, so I found this <a href="https://hadess.io/the-art-of-linux-persistence/">helpful article by Hadess</a>. The article talked about updating the MOTD header.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/818/1*cayzOnDLr_Qh8vGQsR8ymg.png" /><figcaption>Hadess article</figcaption></figure><p>Let’s read this file on our system and see if our attacker used the same method.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/998/1*duxF67enRZ-yicaUF2x0kQ.png" /><figcaption>Finding our backdoor</figcaption></figure><p>The attacker used the file to insert a python command which is our backdoor. Let’s take the hexadecimal from the subdomain and see what the end of our flag is.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/880/1*pynDBbt9U-otzri16Mqxlw.png" /><figcaption>Finding the final piece of the flag</figcaption></figure><p>We our final part, we can piece together the full flag. I took the related hex characters from each part, but it would probably be easier to just copy and paste the pieces together.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*c6hDKgq14mIHdsnUGAk1jg.png" /><figcaption>Making the full flag</figcaption></figure><h3>Sequel Dump</h3><h4>A wave of suspicious web requests has been detected, hammering our database-driven application. Analysts suspect an automated SQL injection attack has been launched using sqlmap, leading to potential data exfiltration. Investigate the provided packet capture (PCAP) file to uncover the attacker’s actions and determine what was stolen!</h4><p>Before we begin inspecting this, the VM provided by TryHackMe will probably not be sufficient for our needs. The packet capture is large, so loading everything and navigating takes a lot of time. I recommend transferring the file to our machine so we can easily work with the file.</p><p>To start transferring the packet capture file, we’ll need to connect to the TryHackMe VPN on our machine. If you need help connecting to the VPN, TryHackMe has a <a href="https://tryhackme.com/room/openvpn">room that goes into detail</a>.</p><p>Once connected, we’ll start a python web server on our Desktop directory on our TryHackMe VM. The following command will open this on port 8080.</p><p>python3 -m http.server 8080</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*D719HVW8oenEDtKgoTBiAA.png" /><figcaption>Starting our web server</figcaption></figure><p>Then, on the machine we’re connected to the VPN on, we’ll open a browser and navigate to the IP address of our VM.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/490/1*tX7EuOSxx5HINinJQo42Cw.png" /><figcaption>Navigating to the server</figcaption></figure><p>Next, we can simply click the challenge.pcapng file, which will download it to our machine.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/958/1*XAFddsY4sYQu5g4zQ9Ie5A.png" /><figcaption>Downloading the challenge file.</figcaption></figure><p>Now that we have the file in a better environment, we can begin our investigation. The first thing noticed is that the file is massive, containing tens of thousands of HTTP packets. Similar to the first challenge, let’s jump into the stream to see what is going on.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/956/1*dvvWjx8fN7AsgQ6i13I97Q.png" /><figcaption>Inspecting the HTTP stream</figcaption></figure><p>We know that some sort of SQL injection was used based on the challenge description. If we continue searching through the stream, it becomes obvious that there are only two unique responses.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/958/1*aOFkADPFcELqjQrCRxXabg.png" /><figcaption>Second type of response</figcaption></figure><p>The first response has a Content-Length of 156 and returns a search result that talks about cryptography. The second has a Content-Length of 41 and simply states that no results were found. Based on these responses, we can be confident that blind SQLi was used, which relies on observing differences in database responses without seeing the database output.</p><p>If you don’t have a full understanding of blind SQLi, I recommend reading this <a href="https://owasp.org/www-community/attacks/Blind_SQL_Injection">article by OWASP.</a> Let’s take a closer look at the requests sent by SQLmap:</p><p>GET /search_app/search.php?query=1%20AND%20ORD%28MID%28%28SELECT%20IFNULL%28CAST%28%60description%60%20AS%20NCHAR%29%2C0x20%29%20FROM%20profile_db.%60profiles%60%20ORDER%20BY%20id%20LIMIT%200%2C1%29%2C54%2C1%29%29%3E99 HTTP/1.1</p><p>Here is the URL decoded request:</p><p>GET /search_app/search.php?query=1 AND ORD(MID((SELECT IFNULL(CAST(`description` AS NCHAR),0x20) FROM profile_db.`profiles` ORDER BY id LIMIT 0,1),54,1))&gt;99 HTTP/1.1</p><p>Each request is fairly similar, and by following the stream we’ll notice that many of the SQLmap requests only change the 0,1),54,1))&gt;99 part of the request. SQLmap iterates through each character in the database (the location of each character for each row is from 0,1),54,1), and compares it with the decimal value of an ASCII character (99). From the request above, SQLmap is seeing if the character has a greater ASCII value than 99 (the letter c).</p><p>SQLmap does this search by using a binary search tree, so it does not iterate each request sequentially. We’ll see requests for &gt;64, &gt;96, etc. until the correct character is narrowed down, based on the successful requests.</p><p>Due to the number of packets, a script is the best way to find the correct value of the characters.</p><p>Our script must do the following:</p><ol><li>Correlate the request and response packets: We need to find which request (which contains the ASCII value for the character) receives a positive response (the result about cryptography, Content-Length 156).</li><li>Track the decimal value for the character in the request packets: Each character position will have multiple requests, each testing different decimal ASCII values. By observing which requests receive a positive response, we can progressively narrow down the possible ASCII value for that particular character. Successful responses indicate the ASCII value is either greater than a tested value, effectively narrowing the possible range of that character’s decimal value.</li><li>Identify the exact character from narrowed-down decimal values: With the character position and decimal values, we can determine the correct ASCII value for the position.</li><li>Reconstruct and output the exfiltrated information: Take the correct ASCII values and reconstruct the database table, rows, and columns.</li></ol><p>I recommend using Python with the Scapy library to do this. I relied pretty heavily on ChatGPT to iterate and write the code. It struggled heavily with some parts, but I had success when doing the following:</p><ol><li>Building the script piece by piece: I started by generating a script that could identify the requests and responses, then correlate them together. Then I moved on to identifying the kind of response, based on the content.</li><li>Feeding packets and output back into ChatGPT: I used tshark to read the PCAP and pasted some results into ChatGPT so it had more information to generate based on. When running the script, I would paste the output into ChatGPT so it could see each building block of progress.</li><li>Rewording and restarting: I noticed that ChatGPT sometimes got into a “doom spiral” where one bad script output would continue to persist, even when I asked for different approaches and provided other materials. I had to restart the chat a few times and give it the last working script to get it back on track.</li></ol><p>I’ve made the script available on my GitHub <a href="https://github.com/CarsonShaffer/THM-Sequel-Dump">here</a>, but I recommend attempting to make the script yourself. It’s not perfect, but it got the job done. We can then run the script, which finds the output.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/952/1*mCe40SHzFSn8a1kZDPISTA.png" /><figcaption>Running the script</figcaption></figure><p>The last row contains our flag in the description for the user.</p><p>And that’s it for the forensics challenges.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rAFYTEbbW0QLKITXjVZsiw.png" /><figcaption>Completed forensics challenges</figcaption></figure><p>Overall, I thought the forensics challenges in the event were fantastic. They were very high quality and enjoyable. I think Hide and Seek probably should have been considered a medium-difficulty challenge since it seemed a bit more difficult then the first three. I hope that TryHackMe decides to run another event like this in the future because this one was a lot of fun!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6584c41c244f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Hack The Box | Cyber Apocalypse CTF 2025 - OSINT Writeup]]></title>
            <link>https://medium.com/@CarsonShaffer/hack-the-box-cyber-apocalypse-ctf-2025-osint-writeup-c5ab878b700c?source=rss-aaa9aec8f7d2------2</link>
            <guid isPermaLink="false">https://medium.com/p/c5ab878b700c</guid>
            <category><![CDATA[hillside-haven]]></category>
            <category><![CDATA[hackthebox]]></category>
            <category><![CDATA[cyber-apocalypse]]></category>
            <category><![CDATA[hackthebox-writeup]]></category>
            <category><![CDATA[hackthebox-osint]]></category>
            <dc:creator><![CDATA[Carson Shaffer]]></dc:creator>
            <pubDate>Thu, 27 Mar 2025 03:51:18 GMT</pubDate>
            <atom:updated>2025-03-27T03:51:18.905Z</atom:updated>
            <content:encoded><![CDATA[<p>The Hack The Box Cyber Apocalypse CTF 2025 ran from March 21 to March 26. At the time of writing, the challenges are still available <a href="https://ctf.hackthebox.com/event/details/cyber-apocalypse-ctf-2025-tales-from-eldoria-after-party-2333">here</a>. The original event details can be found <a href="https://ctf.hackthebox.com/event/details/cyber-apocalypse-ctf-2025-tales-from-eldoria-2107">here</a>. This write-up will cover all seven of the OSINT challenges from the event.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*9kwoyDSz7qwgVDgY.jpg" /><figcaption>Event image</figcaption></figure><h3>The Stone That Whispers</h3><p>Here is the full challenge description:</p><blockquote>In the twilight archives of Eldoria, Nyla studies an image of a mysterious monument. Her enchanted crystals glow as she traces ancient maps with rune-covered fingers. The stone atop the hill of kings calls to her, its secrets hidden in scattered records across realms. As her magical threads of knowledge connect, the true name emerges in glowing script: “The Stone of Destiny.” Another mystery solved by the realm’s most skilled information seeker, who knows that every artifact leaves traces for those who can read the signs.</blockquote><blockquote><strong>HTB{Name_Object}<br>Example: HTB{Pia_Pail} No special characters</strong></blockquote><p>Included is the following photo:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Yea2BirDLm9xEwMPkvffCQ.png" /><figcaption>Challenge photo</figcaption></figure><p>Based on the description, we know that the monument has something to do with “The Stone of Destiny”, this may be a title or plaque nearby. Let’s search the image using Google Lens.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0C4-SqpLFHvntXLtNp8lXg.png" /><figcaption>Google Lens results</figcaption></figure><p>This looks like our monument, which we now know is on the Hill of Tara. We can further refine our search results by adding “Stone of Destiny” to our query.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OSJl827WGObiXIpUHVkmMA.png" /><figcaption>Refined search results</figcaption></figure><p>The provided AI Overview gives the answer, but there are also some links we can use to confirm this. Let’s check out the Wikipedia page to make sure our answer is correct.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ULrKZCt7Cnvj6VCLmLxBXw.png" /><figcaption>Wikipedia entry</figcaption></figure><p>This is definitely the correct result. We can now format our result into the flag and move on to the next challenge.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/846/1*MEHI3CWPK4koEUlMnXoqpQ.png" /><figcaption>Successfully completing the challenge</figcaption></figure><h3>Echoes in Stone</h3><p>Here is the full challenge description:</p><blockquote>In the twilight archives of Eldoria, Nyla studies an image of an ancient Celtic cross. Her enchanted crystals illuminate the intricate carvings as she searches through forgotten tomes. The cross stands at a crossroads of realms and time, its weathered surface telling tales older than Eldoria itself. As her magical threads of knowledge connect across centuries, the true name of the monument emerges in glowing script before her eyes. Another mystery solved by the realm’s most skilled information seeker, who knows that even stone can speak to those who know how to listen.</blockquote><blockquote><strong>HTB{Name_High_Cross}<br>Example: HTB{Kells_High_Cross} No special characters and avoid using the letter ‘s</strong></blockquote><p>Included is the following photo:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/888/1*KHD-mKZLVI9-YqDsbQgrag.png" /><figcaption>Challenge photo</figcaption></figure><p>We need to take this photo of the cross and use it to find it’s name. We’ll start with a simple search through Google Lens to see if we can find this cross.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KBRAi4oMA7kV188se5vMVA.png" /><figcaption>Google Lens results</figcaption></figure><p>Google Lens appears to have been immediately successful in finding the cross. We can scroll down to try to find the name of the specific cross we were provided.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Z8mWfcXXp0RFkOKA3EDDwQ.png" /><figcaption>Visual matches for the image</figcaption></figure><p>It looks like we may have found the correct name, but let’s verify this by navigating to the result from Wikipedia.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bzoVz9ulWBtwYN4TBAMIXA.png" /><figcaption>Wikipedia entry</figcaption></figure><p>Based on the image, we can be certain that this is the correct cross. Let’s format the answer correctly and submit it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/846/1*MEHI3CWPK4koEUlMnXoqpQ.png" /><figcaption>Successfully completing the challenge</figcaption></figure><h3>The Mechanical Bird’s Nest</h3><p>Here is the full challenge description:</p><blockquote>In the highest tower of Eldoria’s archives, Nyla manipulates a crystal scrying glass, focusing on a forbidden fortress in the desert kingdoms. The Queen’s agents have discovered a strange mechanical bird within the fortress walls — an unusual flying machine whose exact position could reveal strategic secrets. Nyla’s fingers trace precise measurement runes across the crystal’s surface as the aerial image sharpens. Her magical lattice grid overlays the vision, calculating exact distances and positions. The blue runes along her sleeves pulse rhythmically as coordinates appear in glowing script. Another hidden truth uncovered by the realm’s premier information seeker, who knows that even the most distant secrets cannot hide from one who sees with magical precision.</blockquote><blockquote><strong>The Mechanical Bird’s Nest: HTB{XX.XXX_-XXX.XXX}<br>Example: HTB{48.858_-222.294} Latitude and longitude format with a dash separating the coordinates</strong></blockquote><p>Included is the following photo:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*daecLhryV1ia0qgv3OLVvA.png" /><figcaption>Challenge photo</figcaption></figure><p>We can see a helicopter on what appears to be a runway in a desert environment. Similar to the previous challenges, let’s plug this into Google Lens and see what comes up.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZnfoC7sj_NP3F8uhINigXQ.png" /><figcaption>Google Lens results</figcaption></figure><p>The top results all pertain to Area 51, and the center one appears to be our runway. It turns out to be an Italian blog providing information on Area 51. Scrolling through the blog shows the photo from the search results.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fN3Y16nXBUExb6RIOLUUIw.png" /><figcaption>Italian blog photo</figcaption></figure><p>We now know that our helicopter photo is from Area 51. We can search for Area 51 and pull it up on Google Maps for a satellite view.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ypv3QAaeUlA3Q3xc3pGfFQ.png" /><figcaption>Satellite view of Area 51</figcaption></figure><p>Zooming in near the top of the base, we find the helicopter we’re looking for. Clicking on the helicopter will show us the coordinates in the bottom pop-up.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BaFxswzJxQfwmiMYS878cQ.png" /><figcaption>Helicopter coordinates</figcaption></figure><p>With our coordinates in hand, we can put them into the correct format and submit the flag.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/846/1*MEHI3CWPK4koEUlMnXoqpQ.png" /><figcaption>Successfully completing the challenge</figcaption></figure><h3>The Hillside Haven</h3><p>Here is the full challenge description:</p><blockquote>Nyla stands before her largest crystal, hands weaving intricate patterns as she conjures an aerial view of the Western Hills district. A noble family’s ancestral home must be located precisely — its entrance marked with a numerical rune that could unlock valuable diplomatic secrets. The crystalline vision floats above her palms, revealing winding roads and nestled dwellings along the hillsides. Her enchanted sight zooms closer as she traces the hidden pathways between estates. The magical markers on her map pulse brighter as she narrows her search, until finally, the numerical sigil above one particular doorway glows with confirmation. Another secret revealed by Eldoria’s master information seeker, who knows that even among a thousand similar dwellings, each bears a unique magical signature for those with eyes to see.</blockquote><blockquote><strong>HTB{Number_StreetnameRoad} <br>Example: HTB{13_OakwoodRoad} No special characters</strong></blockquote><p>Included is the following photo:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*B2Je0U-8trU8_d3GfLhiHA.png" /><figcaption>Challenge photo</figcaption></figure><p>Based on the description we know we’re somewhere in the west, specifically a hilly area. Let’s look into the details of the photo. Looking at the numbers on the garage door, we can see “356”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*44N4UD661e1wNFyJRxrDYw.png" /><figcaption>Numbers on the garage door</figcaption></figure><p>The license plate is blurred, but this doesn’t mean it’s useless. We can find a blurred license plate cheat sheet on the <a href="https://www.reddit.com/r/geoguessr/comments/lhz9gj/all_50_us_states_blurred_license_plates_fixed/">GeoGuessr subreddit</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/615/1*6ouFCykCHgbUs4pLcksYLw.png" /><figcaption>Blurred license plate cheat sheet</figcaption></figure><p>The license plate on the car looks the most similar to California, which also aligns with the clue that the house is somewhere in the west.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WSWtQmpPKwc-M4NPF0HFmQ.png" /><figcaption>Blurred car license plate</figcaption></figure><p>So far, we know the home address is 356 [Something] [Something], CA [ZIP]. The Google Lens results also line up with our conclusions so far.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*F4gw4zY6N9TRd0nZOIeEAg.png" /><figcaption>Google Lens results</figcaption></figure><p>This is where, in my opinion, we have to make a bit of an unfair leap. We could narrow a search location down to a specific area, then brute force Google Maps until we find possible addresses, or we could make a conclusion without explicit verification. <a href="https://github.com/hackthebox/cyber-apocalypse-2025/tree/main/OSINT/The%20Hillside%20Haven">According to the challenge creator,</a> we are supposed to know that the address is 356 [Something] Road because the example flag uses Road (HTB{Number_StreetnameRoad}). I think this is a bit of an unfair assumption, but to find the correct address, let’s assume we know that Road is correct.</p><p>With the above assumption, we now know that we are looking for “356 [Something] Road, CA [ZIP]”. This is enough information to find the correct address through Google dorking, without scouring Google Maps. We’ll use the following search query:</p><p>“356” “Road|Rd” “California|CA” site:redfin.com</p><p>This will narrow down our search results to all houses on Redfin with 356, Road or Rd, and California or CA in them.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lRGlKaIoo61udvUgqiRjSQ.png" /><figcaption>Google Search results</figcaption></figure><p>Clicking into each result provides a Google Street View of the address on Redfin. After going through 6 pages of results, we find the address.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*y3PustHvt8yY9V7KQKSmng.png" /><figcaption>Redfin page for the house</figcaption></figure><p>We can convert this into the flag format, submit it, and move on to the next challenge.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/846/1*MEHI3CWPK4koEUlMnXoqpQ.png" /><figcaption>Successfully completing the challenge</figcaption></figure><h3>The Ancient Citadel</h3><p>Here is the full challenge description:</p><blockquote>Deep in her sanctum beneath Eldoria’s streets, Nyla arranges seven crystalline orbs in a perfect circle. Each contains a different vision of stone battlements and weathered walls — possible matches for the mysterious fortress the Queen seeks in the southern kingdoms of Chile. The image in her central crystal pulses with ancient power, showing a majestic citadel hidden among the distant Chilean mountains. Her fingers dance across each comparison crystal, her enchanted sight noting subtle architectural differences between the visions. The runes along her sleeves glow more intensely with each elimination until only one crystal remains illuminated. As she focuses her magical threads on this final vision, precise location runes appear in glowing script around the orb. Nyla smiles in satisfaction as the fortress reveals not just its position, but its true name and history. A more challenging mystery solved by Eldoria’s premier information seeker, who knows that even the most distant fortifications cannot hide their secrets from one who compares the patterns of stone and shadow.</blockquote><blockquote><strong>HTB{street_number_exactzipcode_city_with_underscores_region}<br>Example: HTB{Libertad_102_2520000_Viña_del_Mar_Valparaíso} Use underscores between words and include special characters where appropriate</strong></blockquote><p>Included is the following photo:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ecM-UaUYS8t51XdIiSS26Q.png" /><figcaption>Challenge photo</figcaption></figure><p>The description tells us the location is somewhere in Chile. Like the other challenges, let’s plug this photo into Google Lens and see if we can narrow down where in Chile this is.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*o8g-WeIo3lu3cVej6e_N-Q.png" /><figcaption>Google Lens results</figcaption></figure><p>Besides the result for New York City, all of the top results are for Brunet Castle. Let’s see where this castle is and if it is our location.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*slGxP9VT55_yKIKa0Q_G1A.png" /><figcaption>Google Search results</figcaption></figure><p>The castle is in Chile, so this is almost certainly the correct place. Opening the first photo shown reveals that it is the gate that we can see.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*asGH6MkarqgkKQqq" /><figcaption>Photo uploaded by Google user</figcaption></figure><p>With the location confirmed, we can pull the address from the search results, format it correctly, and submit it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/621/1*DA8lQJM5fdh1Nw7FktGOsw.png" /><figcaption>Address of the castle</figcaption></figure><p>The formatting for this one is a bit strange, so make sure it’s correct before submitting.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/846/1*MEHI3CWPK4koEUlMnXoqpQ.png" /><figcaption>Successfully completing the challenge</figcaption></figure><h3>The Shadowed Sigil</h3><p>Here is the full challenge description:</p><blockquote>In the central chamber of Eldoria’s Arcane Archives, Nyla studies a glowing sigil captured by the royal wardens. The ethereal marking — “139.5.177.205” — pulsates with malicious energy, having appeared in multiple magical breaches across the realm. Her fingers trace the sigil’s unique pattern as her network of crystals begins to search through records of known dark covens and their magical signatures. The runes along her sleeves flash with recognition as connections form between seemingly unrelated incidents. Each magical attack bears the same underlying pattern, the same arcane origin. Her enchanted sight follows the magical threads backward through time and space until the name of a notorious cabal of shadow mages materializes in glowing script. Another dangerous secret revealed by Eldoria’s master information seeker, who knows that even the most elusive malefactors leave traces of their magic for those skilled enough to recognize their unique signature.</blockquote><blockquote><strong>HTB{APTNumber} <br>Example: HTB{APT01} No special characters</strong></blockquote><p>Based on the description, 139.5.177.205 is an IoC related to an APT group. It seems to be an IP address associated with this group. Let’s search for this on Google to see if anything related to an APT group appears.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*c9XpXBiddTlJ7mSX5MWORw.png" /><figcaption>Google Search results</figcaption></figure><p>That was pretty easy, let’s open the PDF to make sure this result is accurate.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/826/1*QQAXHxvIy3ZoyzDKluSBwQ.png" /><figcaption>Finding the IP address in the PDF</figcaption></figure><p>This is definitely the correct APT group. We can format the flag and submit it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/846/1*MEHI3CWPK4koEUlMnXoqpQ.png" /><figcaption>Successfully completing the challenge</figcaption></figure><h3>The Poisoned Scroll</h3><blockquote>In her crystal-lit sanctum, Nyla examines reports of a series of magical attacks against the ruling council of Germinia, Eldoria’s eastern ally. The attacks all bear the signature of the Shadow Ravens, a notorious cabal of dark mages known for their espionage across the realms. Her fingers trace connections between affected scrolls and contaminated artifacts, seeking the specific enchantment weapon deployed against the Germinian leaders. The runes along her sleeves pulse rhythmically as she sifts through intercepted messages and magical residue analyses from the attack sites. Her network of information crystals glows brighter as patterns emerge in the magical attacks — each victim touched by the same corrupting spell, though disguised under different manifestations. Finally, the name of the specific dark enchantment materializes in glowing script above her central crystal. Another dangerous threat identified by Eldoria’s master information seeker, who knows that even the most sophisticated magical weapons leave distinctive traces for those who know how to read the patterns of corruption.</blockquote><blockquote><strong>Poisoned Scroll: HTB{MalwareName}</strong></blockquote><p>Based on the description, Germinia sounds like Germany. Let’s try searching for an APT group that targeted the German government.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*P4mPM3gonEkLZ3KyLyhE-g.png" /><figcaption>Google Search results</figcaption></figure><p>The first result looks promising, as it names a specific malware. The <a href="https://cloud.google.com/blog/topics/threat-intelligence/apt29-wineloader-german-political-parties">Google Cloud article</a> describes an APT group targeting political parties in Germany with phishing emails that were used to install a backdoor.</p><p>The description in the article aligns with the challenge description. Let’s format it into the flag and submit it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/846/1*MEHI3CWPK4koEUlMnXoqpQ.png" /><figcaption>Successfully completing the challenge</figcaption></figure><p>And that’s it - We’ve solved all of the OSINT challenges! Overall, I would have enjoyed some more variety to the challenges. Nearly every challenge were geolocation, which became stale. Additionally, all but one of the challenges could reasonably be completed with one or two Google searches, which I think made them too easy. I would have liked to see more advanced correlation, maybe between social media accounts, websites, or archives. I hope HTB continues to have an OSINT section in their future CTFs, as I think they have the potential to be very good.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c5ab878b700c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[TryHackMe | Hackfinity Battle - OSINT Writeup]]></title>
            <link>https://medium.com/@CarsonShaffer/tryhackme-hackfinity-battle-osint-writeup-91989fbb33b2?source=rss-aaa9aec8f7d2------2</link>
            <guid isPermaLink="false">https://medium.com/p/91989fbb33b2</guid>
            <category><![CDATA[tryhackme-hackfinity]]></category>
            <category><![CDATA[tryhackme-writeup]]></category>
            <category><![CDATA[tryhackme-ctf]]></category>
            <category><![CDATA[tryhackme]]></category>
            <category><![CDATA[osint]]></category>
            <dc:creator><![CDATA[Carson Shaffer]]></dc:creator>
            <pubDate>Fri, 21 Mar 2025 00:11:37 GMT</pubDate>
            <atom:updated>2025-03-22T02:14:17.112Z</atom:updated>
            <content:encoded><![CDATA[<p>TryHackMe’s Hackfinity Battle is a capture the flag (CTF) event oriented towards students and people newer to CTF challenges. The competition ran from March 17 to March 20. The challenges were disabled after the competition and are currently unavailable as of this writing. This write-up will cover the open-source intelligence (OSINT) challenges from the event.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/0*uu4Vh3dZKXReZ-Zt" /></figure><h3>Catch Me if You Can</h3><h4>Our intel tells us that the individual caught on the CCTV footage that day was one of Cipher’s accomplices. They were planning to meet up at one of Cipher’s safe houses. We have this image of Cipher’s accomplice, Phicer, leaving a restaurant. <br>Can you and Specter find the name of the burger restaurant?</h4><p>In addition to the question, we’re also provided a photo of the location.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/885/1*vITK_g6_H3h6JWxAQQPhow.png" /><figcaption>Provided photo</figcaption></figure><p>This photo is distinct and there are immediately some noticeable aspects. On the left side of the photo, a street named “Beco do Batman” is visible along with unique graffiti.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Gii1QxWo_MzwwqstmNQ35g.png" /><figcaption>Zoom in of the street name</figcaption></figure><p>A quick Google search shows that Beco do Batman is a famous alley and tourist destination in São Paulo, Brazil.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OzAKpIksw_YvUW2Uhu9qFQ.png" /><figcaption>Graffiti in the photo</figcaption></figure><p>Another Google search for “beco do batman burger restaurant” presents a few different options. The sidebar option seems promising.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ffc_MOAR_kNZ_6PMMpT5VA.png" /><figcaption>Google Search results</figcaption></figure><p>If we search for the address from the restaurant listing, we can hop into Google Street View and see the graffiti nearby.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hmiU9LyhbqywDcBI1GZ50g.png" /><figcaption>Graffiti on the restaurant in Google Street View</figcaption></figure><p>With the restaurant name confirmed, we can format it for the flag and submit the answer.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*M3k6up16JedEdQyw6n4jLA.png" /><figcaption>Correct flag for challenge 1</figcaption></figure><h3>Catch Me if You Can 2</h3><p>This challenge builds off of the last one with our subject moving locations.</p><h4>After leaving the restaurant, Phicer was seen enjoying the incredible street art Beco do Batman offers. However, he spent a while looking at this one. We believe they used some form of encoding to communicate a location with each other.</h4><p>We are provided another photo of a mural.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eOX1WLrr16FDPhpOXC_KoQ.png" /><figcaption>Provided photo</figcaption></figure><p>This challenge is listed as both OSINT and steganography. In most CTFs, steganography refers to encoding data inside of the image’s data, but in this case the message is encoded in the actual mural. There’s writing all over the mural, but one piece stands out that isn’t easily readable. On Pelé’s shorts there appears to be strange symbols.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*k0kMaT4zf0yfDIAhIgU2fg.png" /><figcaption>Symbols on Pelé’s shorts</figcaption></figure><p>I searched up another image of the mural on Google and found <a href="https://www.flickr.com/photos/eliasroviello/41561975520">this photo from Flickr</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*JVjIGKr801XDZBkr.jpg" /><figcaption>Photo from Flickr</figcaption></figure><p>Notice the shorts? No symbols are visible.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wYisxyzJl6UFKXaTc2lDiQ.png" /><figcaption>No symbols on shorts</figcaption></figure><p>I couldn’t remember the cipher used in these symbols off the top of my head, but a Google search describing them quickly produced the correct name.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rg9xSK1LoK3opQuq-GGWEg.png" /><figcaption>Google Search results when describing cipher</figcaption></figure><p>This appeared to be a pigpen cipher. With our cipher identified, we can use an online decoding tool to figure out what the message is. I used <a href="https://www.dcode.fr/pigpen-cipher">dcode.fr’s tool</a>, which worked pretty well.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*z3snOkfWMsQY42S2kjg_NA.png" /><figcaption>Decoding the cipher</figcaption></figure><p>Like the first challenge, we’ll take the location’s name and convert it into the format we’re asked for.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CP4yArR3dbB_8D9vkjmk8w.png" /><figcaption>Correct flag for challenge 2</figcaption></figure><h3>Catch Me if You Can 3</h3><h4>Unfortunately, we were unable to recover any more CCTV footage. Just as we were losing hope, Void clutched again and managed to crack the encryption on a message we recovered, sent from Cipher to Phicer in 2022:</h4><p>Meet me at the Mr.Wok safe house</p><h4>Can you find the full address of their safe house?</h4><p>This challenge is fairly simple and requires us to use knowledge we already have. We know our subject is in São Paulo, Brazil, so we can make a quick Google search to see if there is anything related to Mr. Wok.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KO3wamjdkf6aF3J9A3VKvA.png" /><figcaption>Google Search results</figcaption></figure><p>Immediately, we can see results for a restaurant in São Paulo with the name Mr. Wok. Clicking the Tripadvisor link provides us with the address.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZgbYdYTWK0GDovUxN9x4Hg.png" /><figcaption>Tripadvisor entry for the restaurant</figcaption></figure><p>With this found, we just need to format it into the desired flag and submit it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*m99QsjT6LGq82fvPKmCFtw.png" /><figcaption>Correct flag for challenge 3</figcaption></figure><p>And that’s it for the OSINT challenges. My favorite was the second challenge because of the twist from traditional steganography challenges. Most steganography challenges hide data in the contents of the image file, so finding the flag is as simple as running it through an automated tool like <a href="https://www.aperisolve.com/">Aperi’Solve</a>. In this case, the steganography was data was hiding on the physical mural, so I had to analyze the image closely to find the cipher.</p><p>Overall, I think these challenges were great. I’m a big fan of OSINT so I do wish there were more challenges that increased in difficulty. I hope TryHackMe decides to run this event or something similar in the future!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=91989fbb33b2" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[TryHackMe Security Analyst Level 1 (SAL1) Certification Review]]></title>
            <link>https://medium.com/@CarsonShaffer/tryhackme-security-analyst-level-1-sal1-certification-review-23f8eb6e2923?source=rss-aaa9aec8f7d2------2</link>
            <guid isPermaLink="false">https://medium.com/p/23f8eb6e2923</guid>
            <category><![CDATA[tryhackme-certification]]></category>
            <category><![CDATA[tryhackme]]></category>
            <category><![CDATA[sal1-review]]></category>
            <category><![CDATA[tryhackme-cert]]></category>
            <category><![CDATA[tryhackme-sal1]]></category>
            <dc:creator><![CDATA[Carson Shaffer]]></dc:creator>
            <pubDate>Wed, 12 Mar 2025 03:45:28 GMT</pubDate>
            <atom:updated>2026-07-02T15:41:18.417Z</atom:updated>
            <content:encoded><![CDATA[<p>TryHackMe recently released their first certification called Security Analyst Level 1 (SAL1). I took and passed it on March 11. I think it does a lot of things right, but I also think there are multiple deficiencies that should be addressed before I can recommend others to take it.</p><blockquote>Note: I received a free exam voucher during a promotional period where Blue Team Level 1 (BTL1) and CompTIA Cybersecurity Analyst+ (CySA+) holders could get an exam voucher during March 2025 at no cost. Since I hold the CySA+ certification, I did not pay to take this exam.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_9TutWov5XBfMRcaJh5NjA.png" /><figcaption>Certification received after passing the exam</figcaption></figure><h3>Background of the Certification</h3><p>The <a href="https://tryhackme.com/certification/security-analyst-level-1/details">SAL1 certification</a> is targeted towards aspiring and beginner SOC analysts. The exam costs $349 for a voucher and 3 months of TryHackMe premium, or $297 if you already have a premium subscription. After passing, the certification is valid for three years. There is no required course, but the following TryHackMe learning paths and rooms are recommended:</p><ul><li><a href="https://tryhackme.com/path/outline/presecurity">Pre Security</a></li><li><a href="https://tryhackme.com/path/outline/cybersecurity101">Cyber Security 101</a></li><li><a href="https://tryhackme.com/path/outline/soclevel1">SOC Level 1</a></li><li><a href="https://tryhackme.com/room/investigatingwithsplunk">Investigating with Splunk</a></li><li><a href="https://tryhackme.com/room/benign">Benign</a></li><li><a href="https://tryhackme.com/room/registry4n6">Secret Recipe</a></li></ul><p>Completing a <a href="https://tryhackme.com/soc-sim/">SOC simulator </a>scenario is also recommended. The only scenarios I had access to were Introduction to Phishing and Phishing Unfolding. All others were locked behind the business subscription, which I do not have.</p><p>The exam is broken up into three parts with differing point values: an 80-question multiple-choice quiz (200 points) and two SOC simulator scenarios (400 points each). The multiple-choice quiz must be completed within an hour, and each SOC simulator scenario allots two hours to submit all true positive alerts. Once all true positives have a determination made, the simulation closes, regardless of any false positives left. There is a pool of SOC simulations available that the exam randomly pulls from, meaning your experience will be different from others. Upon starting the exam, you have 24 hours to complete each part. A minimum of 750 points is required to pass. One free retake is provided if you fail the first attempt.</p><p>Overall, I think the exam is set up well, it requires theoretical and practical knowledge, which is what TryHackMe typically focuses on with their learning platform. I think the recommended learning goes a bit deeper than the content covered on the exam. You could get away with doing less, but everything covered in the learning is useful to know when taking the exam. The exam is similarly priced to the certifications it’s competing with. The BTL1 is ~$500, CompTIA CySA+ is $404, and HackTheBox’s Certified Defensive Security Analyst (CDSA) is $210 with a required training path that would add about $100.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jDLNYuWA6Dr7idAjmNZ8Bg.png" /><figcaption>TryHackMe’s description of the exam process</figcaption></figure><h3>My Exam Experience</h3><p>I’ve been using TryHackMe to learn cybersecurity since 2022, so I had already completed a lot of the recommended learning. In preparation for the exam, I finished the Cyber Security 101 learning path, which was nearly all review. I also did the Introduction to Phishing SOC simulator scenario to become familiar with the exam platform.</p><p>Checking in for the exam requires taking a selfie and uploading pictures of a photo ID to an identity verification company called Onfido. I had a lot of trouble accessing the Onfido platform. I had to access it with my phone, but my browser kept saying that the page failed to load properly. These issues are probably on me, since my phone settings are more extreme security- and privacy-wise than others. I think requiring a photo ID is fair, although it will definitely turn off some. I’m not 100% on board with sending my ID to a random company, but I decided the potential issues were small enough that it’s probably okay.</p><p>After checking in and verifying your identity, you are given the option to start the exam. This begins the first section and the timer. Each section must be taken sequentially, so I had to do the multiple-choice questions first before the SOC simulator. I think the questions are fair for a beginner in cybersecurity. I would put the average question on the same difficulty level as Security+, though some seemed significantly more difficult.</p><p>One criticism I have for the multiple-choice questions is that they seemed to have gone through very little quality assurance. This resulted in some questions having terrible grammar mistakes that made it difficult to understand.</p><p>The content I’ve seen from TryHackMe has always come across as high quality, so seeing these kinds of glaring mistakes was disappointing. TryHackMe has been heavily advertising the certification and how much <a href="https://tryhackme.com/resources/blog/creating-sal">time they spent building it</a>, but the exam doesn’t come with the expected polish that their other content has.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*m6Wv8U6-OB3Jwgly" /><figcaption>Graphic posted to TryHackMe’s <a href="https://www.linkedin.com/posts/tryhackme_curious-about-how-we-built-our-sal1-professional-activity-7303806806751899648-RwDR">LinkedIn page</a>.</figcaption></figure><p>The SOC simulations were an interesting addition to the exam process, but they quickly got old. Each simulation provides an alert queue, analyst VM, Splunk instance, and documentation. There is a lot of potential here, but it feels unfinished.</p><p>The alert queue was alright at best. Alerts trickled in slowly during each 2-hour simulation window, and I found myself constantly stepping away from my computer to do other tasks while waiting for alerts to appear. It took about 1 hour and fifteen minutes per simulation for all alerts to come in. The exam is supposed to emulate working in a SOC, and sometimes alerts come in slow. However, this is an exam at the end of the day, and I could feel the time being wasted.</p><p>For each alert, you are supposed to investigate the event and make a determination. Determinations can be a true or false positive. For true positives, you must also decide whether to escalate the alert, and all alerts expect a written case report. Multiple alerts can be closed out at the same time, but the determination, escalation decision, and case report will all end up being the same.</p><p>I quickly noticed that the variety of alerts was very poor. Out of a total of 35 alerts in the SOC simulations, maybe 12 were unique. The rest of the alerts were repeats, meaning I spent a lot of time copying and pasting my prior determinations. I think this is a poor way to design the examination as it only tests your knowledge on those 12 unique alerts. If you make an incorrect determination the first time you see an alert, you’re probably going to make the same incorrect determination the second time around.</p><p>The analyst VM is poorly implemented and barely comes into play during the exam. The only thing used in the VM is a custom application called TryDetectThis, which is used as an IP/URL reputation service. All I did was type the IP in, and it tells you if it is known to be malicious or not. The analyst VM was not used in any other aspect during my two simulations.</p><p>The Splunk instance allows you to see events generating during the simulation. I used this in a few situations to verify the alerts that came in, but no advanced queries were necessary. I would have liked to see some more required interaction with Splunk, but this could just be due to the simulations I was provided.</p><p>I think the documentation for each simulation was done well. It defined what a true and false positive looked like (with examples) and had unique rules in each simulation. The documentation also provided machine hostnames and IP addresses, which aided in verifying alerts and writing the case reports.</p><h3>Exam Grading</h3><p>The multiple choice section (200 points total) of the exam is graded in five categories:</p><ul><li>Fundamental Knowledge</li><li>Common Malicious Behavior</li><li>SOC Workflows and Activities</li><li>Security Tools of the Trade</li><li>Cybersecurity Frameworks</li></ul><p>This is graded on whether you got the question correct or not, I do not believe that partial points are available. The SOC simulation portions (400 points each) are graded on multiple aspects of your performance in each simulation:</p><ul><li>Incident Classification (150 points): Did you make correct determinations for true and false positive alerts?</li><li>Escalation (150 points): Did you correctly escalate true positive cases?</li><li>Case Report (100 points): Did your case reports cover all necessary information?</li></ul><p>The case report section is graded by AI and felt untuned. On my first simulation, I scored a 54/100, while on the second, I scored an 80/100. I felt that my case reports were very similar between the two simulations, and a 26-point swing feels unlikely to be accurate.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uOcZi72zCvjexxzR277Z5Q.png" /><figcaption>Results for the first SOC simulation</figcaption></figure><p>The AI provides a list of things done well and things that can be improved, but they lacked the specific detail I would have liked. I think integrating AI grading into the case report section is innovative on TryHackMe’s part, and I’m sure it will get better with time.</p><h3>Would I Recommend the SAL1 Certification?</h3><p>There is no shortage of beginner cybersecurity certifications, and I think the SAL1 is a solid foundation for testing an aspiring SOC analysts skills, but I would not recommend it until it is more developed. My two main reasons for not recommending the certification are:</p><ol><li>It is not known in the industry. Seeing the SAL1 on a resume does not currently mean anything, and employers are not looking for it.</li><li>Both the multiple choice quiz and SOC simulations feel unfinished.</li></ol><p>If you have the free voucher, you might as well take the exam to see what it’s like, but I would not recommend dropping ~$300 on this certification. For beginners looking for a certification, I would recommend an industry-recognized certification like the CompTIA Security+. I don’t think Security+ is the best, but you won’t need to explain to employers what it is.</p><h3>How to Approach the SAL1 Exam</h3><p>If you do decide to pursue the exam, here is how I recommend approaching it:</p><ol><li>Spread out each section of the exam. You have 24 hours to complete the three sections, so use that to your advantage. Give yourself a bit of a break between sections to stay fresh.</li><li>Skip any false positive alerts. You are only graded on your responses to the true positive alerts, and the SOC simulation will end as soon as you submit all true positives. This means that interacting with any false positive alerts is a waste of time. Start with reporting the alerts you know for a fact are true positives. If the exam does not end, submit the alerts you are less sure about until the exam ends.</li><li>Wait for alerts to pile up. Many alerts are duplicates or related, which means you can close out many alerts at once with a single determination, escalation decision, and case report. On my second simulation, I waited for nearly all the alerts to come in before responding to any of them, which saved a lot of time.</li></ol><h3>Final Thoughts</h3><p>The SAL1 exam is unique compared to other beginner-level cybersecurity certifications that are offered. It adds a lot to what should be expected and has a solid foundation for what could be a fantastic certification in the future. With the good comes multiple areas that need to be improved. The multiple-choice questions need to go through a quality assurance process to correct obvious grammar mistakes. In addition, the SOC simulator portions need to be fleshed out to make use of the analyst VM and SIEM.</p><p>I cannot recommend paying for the exam in its current state due to the issues mentioned above. I believe beginners should stay away until the exam becomes widely known and recognized in the industry.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=23f8eb6e2923" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[TryHackMe | Wireshark: Traffic Analysis Writeup]]></title>
            <link>https://medium.com/@CarsonShaffer/tryhackme-wireshark-traffic-analysis-writeup-dd17d31c677e?source=rss-aaa9aec8f7d2------2</link>
            <guid isPermaLink="false">https://medium.com/p/dd17d31c677e</guid>
            <category><![CDATA[tryhackme-walkthrough]]></category>
            <category><![CDATA[tryhackme]]></category>
            <category><![CDATA[tryhackme-writeup]]></category>
            <category><![CDATA[wireshark]]></category>
            <category><![CDATA[tryhackme-wireshark]]></category>
            <dc:creator><![CDATA[Carson Shaffer]]></dc:creator>
            <pubDate>Mon, 02 Sep 2024 23:36:33 GMT</pubDate>
            <atom:updated>2024-09-02T23:36:33.632Z</atom:updated>
            <content:encoded><![CDATA[<p><a href="https://tryhackme.com/r/room/wiresharktrafficanalysis">TryHackMe’s Wireshark: Traffic Analysis</a> room is a medium-level challenge that requires using Wireshark to analyze cyberattacks, identify hosts, examine cleartext and encrypted traffic, hunt for cleartext credentials, and generate firewall rules. This article will walk through all the steps required to complete the room correctly.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ie80BL_ViEJKsyXfr4vp2A.png" /></figure><h3>Task 1: Introduction</h3><h4>1. Read the task above.</h4><p>This task gives a basic rundown of the room. It recommends completing the following two rooms:</p><ul><li><a href="https://tryhackme.com/room/wiresharkthebasics"><strong>Wireshark: The Basics</strong></a></li><li><a href="https://tryhackme.com/room/wiresharkpacketoperations"><strong>Wireshark: Packet Operations</strong></a></li></ul><p>I agree that these should be completed beforehand. This room expands on the topics taught in them and will be difficult to complete without prior knowledge in Wireshark. If you need assistance or a refresher on these rooms, I have previously completed explanations for them here:</p><ul><li><strong>T</strong><a href="https://medium.com/@CarsonS/tryhackme-wireshark-the-basics-writeup-2e364d86661c"><strong>ryHackMe | Wireshark: The Basics Writeup</strong></a></li><li><a href="https://medium.com/@CarsonS/tryhackme-wireshark-packet-operations-writeup-30b130ee1f06"><strong>TryHackMe | Wireshark: Packet Operations Writeup</strong></a></li></ul><p>With that out of the way, let’s start the target machine and begin completing the second task of the challenge!</p><h3>Task 2: Nmap Scans</h3><h4>1. What is the total number of the “TCP Connect” scans?</h4><p>The lesson provides a string which will show all TCP Connect scans from the PCAP. The following display filter will show these packets:</p><pre>tcp.flags.syn==1 and tcp.flags.ack==0 and tcp.window_size &gt; 1024</pre><p>After running this filter, we’ll be able to see the number of displayed packets in the bottom right corner.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ylqBswhkdWpHmzr285pGlg.png" /><figcaption>Finding the number of displayed packets</figcaption></figure><h4>2. Which scan type is used to scan the TCP port 80?</h4><p>We’ll start by using the display filter to see all TCP port 80 traffic:</p><pre>tcp.port == 80</pre><p>Doing this allows us to take a closer look at the interaction between the source and destination.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FP7ffiYs4v5cdN4Q-eOWuw.png" /><figcaption>Only displaying TCP port 80 traffic</figcaption></figure><p>Based on the first four packets, we know the following pattern occurred:</p><blockquote>SYN →</blockquote><blockquote>← SYN, ACK</blockquote><blockquote>ACK →</blockquote><blockquote>RST, ACK →</blockquote><p>This shows the entire three-way handshake and is described in the lesson as corresponding to a specific result from a scan when the port is open.</p><h4>3. How many “UDP close port” messages are there?</h4><p>The following string is provided in the lesson and will filter for closed UDP ports:</p><pre>icmp.type==3 and icmp.code==3</pre><p>Similar to Question 1, we can simply look in the bottom right to find the number of packets displayed.</p><h4>4. Which UDP port in the 55–70 port range is open?</h4><p>Let’s make a filter to see all UDP traffic in the 55 — 70 port range:</p><pre>udp.port in {50..70}</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xrDqg4c4jz8fXOeNlVvQrg.png" /><figcaption>Displaying UDP traffic for ports 55–70</figcaption></figure><p>Based on the filter, we can see that the traffic on ports 67 and 69 received a response that says the destination is unreachable. The port that received the traffic without sending a response is open.</p><h3>Task 3: ARP Poisoning &amp; Man In The Middle!</h3><h4>1. What is the number of ARP requests crafted by the attacker?</h4><p>We’ll start by identifying who the attacker is in the PCAP. We’re provided the following display filter which will identify duplicate ARP addresses:</p><pre>arp.duplicate-address-detected or arp.duplicate-address-frame</pre><p>In the results, we can see that a specific MAC address appears for two different IP addresses.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iIs4dAFs62MXIiN4bZtgyQ.png" /><figcaption>Two IP addresses for one MAC address</figcaption></figure><p>The MAC address 00:0c:29:e2:18:b4 is supposedly both IP address 192.168.1.1 and 192.168.1.12. This appears to be our attacker MAC address that is claiming to be the gateway. With this, we can now filter to see the ARP requests made by this MAC address:</p><pre>arp.opcode == 1 and eth.src == 00:0c:29:e2:18:b4</pre><p>We can then see the number of packets displayed in the bottom right.</p><h4>2. What is the number of HTTP packets received by the attacker?</h4><p>Now that we know who the attacker is, we can simply filter for HTTP traffic that is received by the offending MAC address.</p><pre>http and eth.dst == 00:0c:29:e2:18:b4</pre><p>Like the last question, we can look at the bottom right to see the number of displayed packets to get our answer.</p><h4>3. What is the number of sniffed username&amp;password entries?</h4><p>We need to see HTTP traffic that was sent to the attacker. We’ll filter for POST requests to the attacker with the following:</p><pre>eth.dst == 00:0c:29:e2:18:b4 and http.request.method == &quot;POST&quot;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UwXBQAtbKvGYyJW9A90NEQ.png" /><figcaption>Results for HTTP POST traffic sent to the attacker</figcaption></figure><p>Searching through the packet frame, we can see what a username and password submission looks like.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/850/1*zmm4LdyyEHqPXiWYONxsOQ.png" /><figcaption>Inspecting the packet</figcaption></figure><p>We now know that the variable names are “uname” and “pass”. Let’s further narrow down our search by only displaying packets with “uname” in the frame.</p><pre>eth.dst == 00:0c:29:e2:18:b4 and http.request.method == &quot;POST&quot; and frame contains &quot;uname&quot;</pre><p>This leaves us with a handful of remaining packets. Looking through them again, they all contain a username and password pair. However, two packets contain duplicate information, so our answer will be one less than the number of packets displayed.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9rDHmkxApRSEoXUugeYBig.png" /><figcaption>Displayed packets, arrows pointing to duplicate entries</figcaption></figure><h4>4. What is the password of the “Client986”?</h4><p>This one is simple but worded very annoyingly. I searched for “Client986”, but the uname was actually “client986”. Since Wireshark is case sensitive, no results appeared. We can copy our display filter from the prior question, except input “client986” into the frame filter. We can also remove the <strong>eth.dst </strong>filter.</p><pre>http.request.method == &quot;POST&quot; and frame contains &quot;client986&quot;</pre><p>This leaves us with a single packet, we can look at the packet details to see what the password is.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/928/1*_RzulZoJ_reTwagP-gc9Sw.png" /><figcaption>Finding the password</figcaption></figure><h4>5. What is the comment provided by the “Client354”?</h4><p>This is almost the exact same process as the last question. Simply replace the frame with the new client:</p><pre>http.request.method == &quot;POST&quot; and frame contains &quot;client354&quot;</pre><p>We can look at the packet details again and see the comment.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/930/1*ZoM2gfKfWgImS0FjiP2bgw.png" /><figcaption>Finding the comment</figcaption></figure><h3>Task 4: Identifying Hosts: DHCP, NetBIOS and Kerberos</h3><h4>1. What is the MAC address of the host “Galaxy A30”?</h4><p>For this question, we need to make a filter that searches for a DHCP hostname with the “Galaxy A30” string. We can start with the following:</p><pre>dhcp.option.hostname contains &quot;Galaxy A30&quot;</pre><p>Using this display filter will provide no results. Let’s make our search a bit broader and only look for hostnames that contain “A30”:</p><pre>dhcp.option.hostname contains &quot;A30&quot;</pre><p>This will show a single packet that contains the MAC address. Looking at the packet details will show that the full hostname for the device is “Anthony-s-Galaxy-A30s” which explains why our original search did not work.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/598/1*-XwVWVyxffCHa-xiqp18ZQ.png" /><figcaption>Finding the MAC address for the hostname</figcaption></figure><h4>2. How many NetBIOS registration requests does the “LIVALJM” workstation have?</h4><p>Let’s start by filtering for packets that have an <strong>nbns.name </strong>with our target workstation name in them:</p><pre>nbns.name contains &quot;LIVALJM&quot;</pre><p>We’ll see that we have 40 packets pertaining to this workstation. We can also see that there are two request types: Registration and Name Query.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rI_ToDet-D2Cqwuwjm9fHQ.png" /><figcaption>Inspecting the packets</figcaption></figure><p>The packet details show that the Registration requests have an opcode that is set to “Registration”. Let’s add that to our display filter:</p><pre>nbns.name contains &quot;LIVALJM&quot; and nbns.flags.opcode == Registration</pre><p>After running this filter, we are left with the correct number of packets displayed.</p><h4>3. Which host requested the IP address “172.16.13.85”?</h4><p>Wireshark has a filter to explicitly search for the requested IP address. Let’s use that to find packet containing the request:</p><pre>dhcp.option.requested_ip_address == 172.16.13.85</pre><p>This leaves us with a single packet. We can then look at the packet details to find the hostname of the device.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/647/1*ISVicZ5u6B7Xb6IaRPfOpA.png" /><figcaption>Finding the hostname</figcaption></figure><h4>4. What is the IP address of the user “u5”? (Enter the address in defanged format.)</h4><p>We need to filter for the user, which is stored under the <strong>CNameString</strong> value. The following display filter will only show packets relating to this user:</p><pre>kerberos.CNameString == &quot;u5&quot;</pre><p>This leaves us with multiple packets pertaining to this user, and two different IP addresses are included. We need to find which is the client and which is the server.</p><p>We can see that there are two types of message types for the packets: <strong>krb-as-req</strong> and <strong>krb-as-rep</strong>. We only want to pay attention to the <strong>krb-as-req</strong> packets since they are the packets that the client (user) is sending to the server.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/819/1*zrlcN7pV7zXdWxPiwk4AjA.png" /><figcaption>Inspecting the packets</figcaption></figure><p>Since we know the user IP address, we can simply plug it into <a href="https://cyberchef.io/">CyberChef</a> with the Defang IP Address recipe to get our answer.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/1*5iBFWBhDWQW_LypXRpx7jQ.png" /><figcaption>Defanging the IP address</figcaption></figure><h4>5. What is the hostname of the available host in the Kerberos packets?</h4><p>To filter for hostnames, we simply need to look for all packets that have a <strong>CNameString</strong> value with a “$” in it:</p><pre>kerberos.CNameString contains &quot;$&quot;</pre><p>We’ll then only see a single packet which has the correct hostname.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/643/1*IU8U664ECrawrATI2D5UUw.png" /><figcaption>Finding the correct hostname</figcaption></figure><h3>Task 5: Tunneling Traffic: DNS and ICMP</h3><h4>1. Investigate the anomalous packets. Which protocol is used in ICMP tunnelling?</h4><p>For this question, we can simply filter for ICMP traffic and then manually look through the packets to find anything suspicious:</p><pre>icmp</pre><p>After looking through, we can see a packet that does not look right.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HGxLiPWm0QuiPpC9kqchEg.png" /><figcaption>Manually inspecting the packets</figcaption></figure><p>There is probably a better way to do this, such as using a frame filter to look for matches. However, I don’t know enough about how the tunneled traffic would look to make a filter that I believe would correctly identify the protocol. The filter would need to look something like:</p><pre>icmp and frame matches &quot;ssh|http|dns|ftp|scp&quot;</pre><p>We would get lucky running this and could see the correct protocol but I don’t think this could be transferable to the real world. I’d need to modify this by looking into each pattern instead of just listing the name.</p><h4>2. Investigate the anomalous packets. What is the suspicious main domain address that receives anomalous DNS queries? (Enter the address in defanged format.)</h4><p>This question also seems to require a more manual process to find the domain. We can filter the packets to only show DNS queries and then begin looking through them:</p><pre>dns</pre><p>This would leave us with over 30,000 displayed packets, which would be nearly impossible to look through manually. We know we’re looking for a domain address, so let’s narrow it down to some of the most common TLDs:</p><pre>dns and dns.qry.name matches &quot;com|xyz|top|org|net|edu|gov|mil|int|info|biz|us&quot;</pre><p>This still leaves us with over 10,000 packets. However, some of the traffic immediately stands out as strange.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Z1SZK5mvkNK8HuA_pzdt-g.png" /><figcaption>Strange packets</figcaption></figure><p>Domains like <strong>ntp.ubuntu.com</strong> or <strong>v10.events.data.microsoft.com</strong> do not seem weird, but then we see some very long subdomains that we can’t even see the full name of. Looking deeper into these packets, we can see a very suspicious domain name.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xgBHRHJBh8U73ZFKczzDiw.png" /><figcaption>Suspicious domain name</figcaption></figure><p>Next, we can take that domain and plug it into <a href="https://cyberchef.io/">CyberChef</a> to defang it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/603/1*V6imV4ISuvsw6q81SWnCfw.png" /><figcaption>Defanging the URL</figcaption></figure><h3>Task 6: Cleartext Protocol Analysis: FTP</h3><h4>1. How many incorrect login attempts are there?</h4><p>We need to filter by the response code to see incorrect login attempts for the FTP service. The following will search for all 530 (Login incorrect) response codes:</p><pre>ftp.response.code == 530</pre><p>The bottom right will then tell us the number of displayed packets.</p><h4>2. What is the size of the file accessed by the “ftp” account?</h4><p>Let’s begin by finding the login session for the “ftp” user. To do this, we must filter for the “USER” request command with the argument of “ftp”:</p><pre>(ftp.request.command == &quot;USER&quot;) and (ftp.request.arg == &quot;ftp&quot;)</pre><p>Once filtered, we can see a single packet containing for the user. We can then right-click to follow the TCP stream of the session.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/954/1*cF9CTou4d6o_u5iaNE-Zdg.png" /><figcaption>Following the user session</figcaption></figure><p>This stream will show us the entire session and all actions performed by the user. Scrolling through, we can see the user list all files and then list the size of a specific file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/641/1*X-imEFL5P2VJpWaquyR6pQ.png" /><figcaption>Listing the size of the file</figcaption></figure><h4>3. The adversary uploaded a document to the FTP server. What is the filename?</h4><p>I am fairly confident that this question has the wrong answer associated with it. The user runs the <strong>STOR</strong> command on a file called “README”, which means they uploaded it to the server. However, the correct answer is actually the file the user ran <strong>RETR</strong> on, which is also the file that we found the size of in the last question.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/740/1*CtKlE9XUeWXSjI75Jb7lIQ.png" /><figcaption>The user downloading and uploading files</figcaption></figure><h4>4. The adversary tried to assign special flags to change the executing permissions of the uploaded file. What is the command used by the adversary?</h4><p>This question is also referring to the downloaded file, not the one that was uploaded. We can see near the end of the stream that the user runs a command to change the permissions of a file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/656/1*TbR9coB_Wys9O3FBiPq8-g.png" /><figcaption>Attempting to change the permissions on the previously downloaded file</figcaption></figure><h3>Task 7: Cleartext Protocol Analysis: HTTP</h3><h4>1. Investigate the user agents. What is the number of anomalous “user-agent” types?</h4><p>Let’s add a column to our display to show the user agents for each packet. We’ll start by right-clicking the column row and then navigating to Column Preferences.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YzfdZfjUyNLkNxFnodErLw.png" /><figcaption>Navigating the menu</figcaption></figure><p>Once in the Preferences menu, we can click the small plus (+) button on the bottom left, change the new column’s name to “User Agent”, set it as a Custom type, and use “http.user_agent” as the Field. We can then click OK to view our new column.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/822/1*ubOI6t_S-foBAuOkVDL6Cg.png" /><figcaption>Creating our new column</figcaption></figure><p>We can sort our packets using this new column to see them grouped up. Then we’ll sort through them manually and make note of the ones that sound suspicious. Sifting through, we can see a user agent associated with Log4J, a Windows version that does not exist, a misspelled browser company, and some common tools associated with hacking.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zLbZbbBIBzhHB7OjU4Nwzw.png" /><figcaption>Manually finding the suspicious user agents</figcaption></figure><p>Remember, we are not counting the number of packets, just the number of suspicious user agent types.</p><h4>2. What is the packet number with a subtle spelling difference in the user agent field?</h4><p>When completing question 1, we’ll have noticed the misspelled browser company, all we need is to submit the packet number.</p><h4>3. Locate the “Log4j” attack starting phase. What is the packet number?</h4><p>The lesson provides the display filter to use for this question. We can also simply sort by HTTP POST requests and see the user agent associated.</p><pre>http.request.method == &quot;POST&quot;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xTpuzhQvyf4eUVPFs3QFng.png" /><figcaption>Finding the start of the attack</figcaption></figure><h4>4. Locate the “Log4j” attack starting phase and decode the base64 command. What is the IP address contacted by the adversary? (Enter the address in defanged format and exclude “{}”.)</h4><p>Let’s copy the user agent from the previous question, and use the following in our terminal to decode the base64 portion:</p><pre>echo -n &quot;&lt;Base64 portion of user agent&gt;&quot; | base64 -d</pre><p>Running this will show us the command included in the user agent.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UHbXxvYIH8n8JyLoY-7obA.png" /><figcaption>Decoding the command</figcaption></figure><p>Then, we can copy the IP address and plug it into <a href="https://cyberchef.io/">CyberChef</a> to defang it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/519/1*8Wk_kzAnFpFTba8mBrD97A.png" /><figcaption>Defanging the IP address</figcaption></figure><h3>Task 8:Encrypted Protocol Analysis: Decrypting HTTPS</h3><h4>1. What is the frame number of the “Client Hello” message sent to “accounts.google.com”?</h4><p>Let’s filter for Client Hello messages with the specified server name:</p><pre>tls.handshake.type == 1 and tls.handshake.extensions_server_name == accounts.google.com</pre><p>We’re left with a single packet which is the correct packet number.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/880/1*gzKbgw2tsHUEIxVaakwtHw.png" /><figcaption>Finding the correct message</figcaption></figure><h4>2. Decrypt the traffic with the “KeysLogFile.txt” file. What is the number of HTTP2 packets?</h4><p>We can navigate to <strong>Edit → Preferences → Protocols → TLS</strong> and add the provided KeysLogFile.txt to the <strong>(Pre)-Master-Secret-Log filename</strong> option.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/824/1*pOtsyF3gkSEiUDec9dM3BQ.png" /><figcaption>Selecting KeysLogFile.txt</figcaption></figure><p>When we click OK, we’ll notice that previously encrypted traffic is now decrypted. We can then use the display filter to search for http2 packets:</p><pre>http2</pre><p>Then, we can look in the bottom right to see the number of displayed packets.</p><h4>3. Go to Frame 322. What is the authority header of the HTTP2 packet? (Enter the address in defanged format.)</h4><p>Let’s use the display filter to only show packet 322:</p><pre>frame.number == 322</pre><p>This leaves us a single packet. Then we can look through the packet information to see the authority header.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/826/1*Vh7H7BhHIPViMKcu4uMrGw.png" /><figcaption>Finding the authority header</figcaption></figure><h4>4. Investigate the decrypted packets and find the flag! What is the flag?</h4><p>Now that the traffic is decrypted, we’ll be able to see any files that were included in the PCAP. Let’s navigate to <strong>File → Export Objects → HTTP</strong>. We’ll see two available files to export, let’s grab both of them.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/749/1*tqMB5NgJZA4aRIl4dYC4vg.png" /><figcaption>Exporting two files</figcaption></figure><p>The text file has an ASCII art image along with the flag.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1007/1*MLozsxZcoeO4onW0sb3-ww.png" /><figcaption>Finding the flag</figcaption></figure><h3>Task 9: Bonus: Hunt Cleartext Credentials!</h3><h4>1. What is the packet number of the credentials using “HTTP Basic Auth”?</h4><p>We can navigate to <strong>Tools → Credentials</strong> to see a list of credentials that Wireshark detected. Only one entry shows that the protocol is “HTTP basic auth”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/634/1*yhImTHhKPVg_br72GePgTg.png" /><figcaption>Looking at detected credentials</figcaption></figure><h4>2. What is the packet number where “empty password” was submitted?</h4><p>We can apply a display filter that looks for all packets that contain a password:</p><pre>ftp.request.command contains &quot;PASS&quot;</pre><p>With this, the empty password becomes pretty obvious.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/994/1*TNUakx4G2KqTY_loaRsTxg.png" /><figcaption>Finding the empty password</figcaption></figure><h3>Task 10: Bonus: Actionable Results!</h3><h4>1. Select packet number 99. Create a rule for “IPFirewall (ipfw)”. What is the rule for “denying source IPv4 address”?</h4><p>Let’s filter for frame number 99:</p><pre>frame.number == 99</pre><p>With this single packet selected, let’s navigate to <strong>Tools → Firewall ACL Rules</strong>.<strong> </strong>We can then change the rule generator to IPFirewall (ipfw) and look for the rule that denies the source IPv4 address.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/652/1*AJ4aWBUtpUyrJPaUluvh4A.png" /><figcaption>Generating the firewall rule</figcaption></figure><h4>2. Select packet number 231. Create “IPFirewall” rules. What is the rule for “allowing destination MAC address”?</h4><p>Like the last question, let’s single out the frame number:</p><pre>frame.number == 231</pre><p>Then, we can use the <strong>Firewall ACL Rules</strong> tool to generate the rule. Again, we’ll need to change the rule type to IPFirewall (ipfw). We’ll also need to uncheck the “Deny” box to make allow rules instead of deny rules.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/652/1*OMAR1vUQpBwt1kb0ScMJhg.png" /><figcaption>Generating the firewall rule</figcaption></figure><h3>Task 11: Conclusion</h3><p>All we need to do is submit the empty answer.</p><p>We’ve completed the room! We used Wireshark to analyze cyberattacks, identify hosts, examine cleartext and encrypted traffic, hunt for cleartext credentials, and generate firewall rules. If you’re struggling with the room or have questions, please leave a comment or message me on <a href="https://www.linkedin.com/in/c-shaffer/">LinkedIn</a> and I will try my best to assist!</p><h4>Lessons Learned</h4><ul><li>Wireshark has built-in tools to generate firewall rules and identify cleartext credentials.</li><li>Even though Wireshark is a very powerful tool, manual analysis is needed in many cases to identify anomalies. Having a deep understanding of how protocols operate is essential in using Wireshark effectively.</li></ul><h4>Things I Struggled With:</h4><p>I spent a lot of time on the ICMP tunneling exercise. I kept trying to find a way to make a rule that would search through the traffic and find signs of a protocol being used. I ended up with a filter that somewhat works, but I’d need to spend far more time studying how protocols work in detail to make anything worthwhile. I decided to just go with manual analysis which worked out fairly well. For decrypting HTTPS and finding the flag, it took me a while before exporting objects. I kept applying different filters and searching for different strings in the frame information but couldn’t find anything. Eventually, I saw the file data and decided to export the objects. In the future, I think I’d start with that and move on to packet analysis if nothing substantial is in the exported objects.</p><h4>Conclusion:</h4><p>This is a fantastic room for diving deeper into Wireshark. I feel like I learned a lot and was tested heavily on what was included. I disliked that some of the questions were inaccurate, such as the Galaxy device hostname or the file that was uploaded to the server. Overall, I’d highly recommend this room.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=dd17d31c677e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[TryHackMe | Zeek Exercises Writeup]]></title>
            <link>https://medium.com/@CarsonShaffer/tryhackme-zeek-exercises-writeup-c19d986e4207?source=rss-aaa9aec8f7d2------2</link>
            <guid isPermaLink="false">https://medium.com/p/c19d986e4207</guid>
            <category><![CDATA[zeek-exercises]]></category>
            <category><![CDATA[tryhackme]]></category>
            <category><![CDATA[zeek]]></category>
            <category><![CDATA[tryhackme-writeup]]></category>
            <category><![CDATA[tryhackme-walkthrough]]></category>
            <dc:creator><![CDATA[Carson Shaffer]]></dc:creator>
            <pubDate>Sat, 24 Aug 2024 23:02:35 GMT</pubDate>
            <atom:updated>2024-08-26T14:27:35.395Z</atom:updated>
            <content:encoded><![CDATA[<p><a href="https://tryhackme.com/r/room/zeekbroexercises">TryHackMe’s Zeek Exercises </a>room is a medium-level room that requires using Zeek and other command-line tools to investigate network traffic. This article will walk through all the steps required to successfully complete this challenge.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JbhRU0MCDYhYNXcWjm8_tQ.png" /></figure><h3>Task 1: Introduction</h3><h4>1. Read the task above.</h4><p>This task simply discusses what the challenge will include. It recommends completing the <a href="https://tryhackme.com/room/zeekbro">Zeek</a> room first to gain an understanding of using the tool. This recommendation is definitely justified - it will be very difficult to complete this room without prior experience using Zeek.</p><p>We can start the machine, submit the blank question, and move on to the next task.</p><h3>Task 2: Anomalous DNS</h3><p>We’ll start by accessing the virtual machine in our browser and opening up a terminal. Then, we need to navigate to the directory that hosts the challenge files.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/736/1*LSxtjVtn99ojXm0MHM6kqA.png" /><figcaption>Navigating to the correct directory and listing files</figcaption></figure><h4>1. Investigate the <strong>dns-tunneling.pcap</strong> file. Investigate the <strong>dns.log</strong> file. What is the number of DNS records linked to the IPv6 address?</h4><p>We’ll start by running Zeek on the dns-tunneling.pcap file. This will create the necessary log files to complete this task. The following command will use Zeek to analyze the PCAP file:</p><pre>zeek -Cr dns-tunneling.pcap</pre><p>After running the command, we can list the files in the directory and see that multiple log files were generated.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/736/1*6DsvII2jb9fCxXT3Qiuivg.png" /><figcaption>Analyzing the PCAP with Zeek</figcaption></figure><p>We can now take a closer look at what is included in the dns.log file. The following command will display the first 10 lines of the file:</p><pre>cat dns.log | head</pre><p>The results look pretty messy and can be hard to read because of how many columns are included. I stretched the terminal window as wide as I could to fit as much as possible on each line. For the purposes of this walk through, however, I will avoid showing screenshots of the results because it would be very difficult to read. Instead, I will describe what should be seen.</p><p>In this <strong>#fields </strong>section of the output, we’ll see multiple column names, including uid, id.orig_h, query, and many others. We need to find which of these columns relate directly to IPv6 addresses. This requires a bit of networking knowledge surrounding DNS records - <a href="https://www.cloudflare.com/learning/dns/dns-records/">This article by Cloudflare</a> is a great introduction or refresher to DNS records if you need it.</p><p>One of the column names in <strong>#fields</strong> is <strong>qtype_name</strong>, which is the query type for each DNS request. This will tell us what kind of record request is made. For IPv6 addresses, this request will be <strong>AAAA</strong>. Therefore, we can use zeek-cut to isolate the <strong>qtype_name</strong> column from the rest of the data. The following command will output all of the <strong>qtype_name</strong> results:</p><pre>cat dns.log | zeek-cut qtype_name</pre><p>After running the command, our output will only show what kind of record request was made.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uroGvKBWJ5zy7XgZJwEaSw.png" /><figcaption>Using zeek-cut to display qtype_name information</figcaption></figure><p>We now need to only look at records that relate to IPv6, <strong>AAAA</strong>. For this, we can add a grep command to only output <strong>AAAA:</strong></p><pre>cat dns.log | zeek-cut qtype_name | grep &quot;AAAA&quot;</pre><p>Our output will now only show lines with IPv6 records.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*S8wB5yYAWtXrezmJc23YWg.png" /><figcaption>Looking only at IPv6 records</figcaption></figure><p>We now need to count each line to get our final answer. To do this, we’ll use the <strong>wc</strong> command to give a final output of the number of lines for our previous output:</p><pre>cat dns.log | zeek-cut qtype_name | grep &quot;AAAA&quot; | wc -l</pre><p>This command will give us the answer to the question.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hehL2JCAxOAgYPZNPjTbNQ.png" /><figcaption>Outputting the final answer</figcaption></figure><h4>2. Investigate the <strong>conn.log</strong> file. What is the longest connection duration?</h4><p>We can now start looking at the conn.log file. Using cat will again show a large number of fields to choose from. In this case, we want to isolate the <strong>duration</strong> column. For this, we’ll use zeek-cut again:</p><pre>cat conn.log | zeek-cut duration</pre><p>This will output a large number of duration times for each connection.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZfidwEOPI1CXaQCLrWjUMg.png" /><figcaption>Isolating the duration column</figcaption></figure><p>Next, we’ll need to sort the output, this can be done using the sort command:</p><pre>cat conn.log | zeek-cut duration | sort -n</pre><p>When we look at the output, we’ll see it has been sorted in ascending order.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wLxgBZZzZGWExtADp8g1sA.png" /><figcaption>Sorting the output in ascending order</figcaption></figure><p>We now know that the longest connection duration will be the final line in our output. To output just this number, we’ll add tail to show only the last line:</p><pre>cat conn.log | zeek-cut duration | sort -n | tail -n 1</pre><p>This command outputs our answer.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0LgVdEC_dCLzKIRommvufw.png" /><figcaption>Outputting our answer</figcaption></figure><h4>3. Investigate the <strong>dns.log</strong> file. Filter all unique DNS queries. What is the number of unique domain queries?</h4><p>This question is a bit tricky and can be completed in a multitude of ways. When using cat to investigate the log, we can notice that the <strong>query</strong> field contains the domain along with any subdomains for each record. We can use zeek-cut to only display this output:</p><pre>cat dns.log | zeek-cut query</pre><p>This will output a bunch of lines showing the requested domains and subdomains.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*L2DmOXkxMKbWIlORJK7_iQ.png" /><figcaption>Output when looking at just the queries</figcaption></figure><p>Originally, I thought it would be simple to just cut the second and third fields when separating by a period. This ended up not working, but I think it is interesting to see why. The following would be the command to try this:</p><pre>cat dns.log | zeek-cut query | cut -d. -f2-3</pre><p>The results for this look promising.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5Ivt5TLhkhNu8vrq6MzZWQ.png" /><figcaption>Results when cutting the domain</figcaption></figure><p>However, it isn’t until we sort by unique results that we see the issue.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Dlc40jBhSbz6tfZPj8lXFA.png" /><figcaption>Results when sorting by unique lines</figcaption></figure><p>This issue is that the subdomains for each query are not consistent. We can see this if we use grep to investigate the results of the output.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hyu8sypsglUFfUOhw6xing.png" /><figcaption>Looking for a specific value</figcaption></figure><p>By cutting we don’t effectively isolate the domain. To fix this, we’ll need to get a little more advanced. I used awk to solve this issue. awk allows us to split the input on each line into separate fields, which we can then use to combine for the domain. Here’s the command I used:</p><pre>cat dns.log | zeek-cut query | awk -F. &#39;{print $(NF-1)&quot;.&quot;$NF}&#39;</pre><p>Let’s look at this command in detail:</p><blockquote>awk — This is a text processing tool that allows us to perform actions based on each line of input.</blockquote><blockquote>-F. — This sets how we want to separate each line of input. The period (.) tells awk to separate each line of input whenever it sees a period.</blockquote><blockquote>‘{print $(NF-1)”.”$NF}’ — This is the command we want awk to execute. NF is a built-in variable to represent the number of fields in the line. In this case, we are printing the second to last field (NF-1), adding a period, then printing the very last field ($NF).</blockquote><p>Let’s see how this would work in practice. Let’s use the following as what we would use for input:</p><pre>a.b.c.d.example.com<br>domain.tld<br>subdomain1.test.org</pre><p>awk would first split each of these inputs into fields whenever it encounters a period.</p><pre>&quot;a&quot;,&quot;b&quot;,&quot;c&quot;,&quot;d&quot;,&quot;example&quot;,&quot;com&quot;<br>&quot;domain&quot;,&quot;tld&quot;<br>&quot;subdomain1&quot;,&quot;test&quot;,&quot;org&quot;</pre><p>Next, we’ll figure out what NF-1 and NF are. NF refers to the very last field, while NF-1 would refer to the field directly before that. This will isolate the domains.</p><pre>&quot;a&quot;,&quot;b&quot;,&quot;c&quot;,&quot;d&quot;,&quot;example&quot;,&quot;com&quot; -&gt; &quot;example&quot;,&quot;com&quot;<br>&quot;domain&quot;,&quot;tld&quot; -&gt; &quot;domain&quot;,&quot;tld&quot;<br>&quot;subdomain1&quot;,&quot;test&quot;,&quot;org&quot; -&gt; &quot;test&quot;,&quot;org&quot;</pre><p>The print command we gave (‘{print $(NF-1)”.”$NF}’) will print the NF-1 field, then a period, and finally the last field. The output will then appear as follows:</p><pre>example.com<br>domain.tld<br>test.org</pre><p>This command should work with any amount of input before the domain, assuming it has a period that can be used to split into fields. Now, we can run the command and sort by unique to see the output:</p><pre>cat dns.log | zeek-cut query | awk -F. &#39;{print $(NF-1)&quot;.&quot;$NF}&#39; | sort -u</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oQbGVWmyOJj9w7ZxBwnBpg.png" /><figcaption>Output of our new command</figcaption></figure><p>Then, like in previous questions, we can use wc to output the number of unique queries.</p><pre>cat dns.log | zeek-cut query | awk -F. &#39;{print $(NF-1)&quot;.&quot;$NF}&#39; | sort -u | wc -l</pre><p>This gives us the answer to the question.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XBqi5LVeOl5Bccg-52ow8Q.png" /><figcaption>Outputting the correct number of lines</figcaption></figure><h4>4. There are a massive amount of DNS queries sent to the same domain. This is abnormal. Let’s find out which hosts are involved in this activity. Investigate the <strong>conn.log</strong> file. What is the IP address of the source host?</h4><p>For this question, we can look at which IP addresses are receiving a lot of traffic, and which IP addresses are sending that traffic. We’ll use zeek-cut to inspect the <strong>id.orig_h</strong> and <strong>id.resp_h</strong> to see the source and destination IP addresses.</p><pre>cat conn.log | zeek-cut id.orig_h id.resp_h</pre><p>This command shows a lot of traffic, let’s sort it and look at a count of duplicate lines. To do this, we’ll use the sort and uniq commands:</p><pre>cat conn.log | zeek-cut id.orig_h id.resp_h | sort | uniq -c</pre><p>This shows that one IP address is sending a ton of traffic out.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0LEKQqPdVKnaxWSQYVt9ZA.png" /><figcaption>Finding the amount of traffic sent by IP address</figcaption></figure><p>The source IP sending out the traffic is our answer.</p><h3>Task 3: Phishing</h3><p>In this task we’re investigating a potential phishing attempt. We’ll need to move to the phishing directory in our exercise files. The directory contains the PCAP file along with two Zeek rule files.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/827/1*sH9gzgxHdsgjGG5cLk0VPw.png" /><figcaption>Listing the files in the phishing directory</figcaption></figure><p>Let’s use Zeek to analyze the PCAP file with the two rules:</p><pre>zeek -Cr phishing.pcap hash-demo.zeek file-extract-demo.zeek</pre><p>This leaves us with many log files and an extracted files directory to investigate. We’ll use these for the questions in this task.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/756/1*b5Kl8XPtOYWOz3J4vPwKQg.png" /><figcaption>Listing the contents of the phishing directory after analyzing the PCAP</figcaption></figure><h4>1. Investigate the logs. What is the suspicious source address? Enter your answer in <strong>defanged format</strong>.</h4><p>Similar to the last question, we can use zeek-cut to isolate the source IP address in the conn.log file. Then, we can sort it by unique IP addresses:</p><pre>cat conn.log | zeek-cut id.orig_h | sort -u</pre><p>We’ll find that only one IP address is included in the results, which is our suspicious IP address.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Lw4kwZIxw6m5tq3W8NM1WQ.png" /><figcaption>Finding the suspicious IP address</figcaption></figure><p>We can then copy this IP address and paste it into <a href="https://cyberchef.io/">CyberChef</a> with the <strong>Defang IP Addresses</strong> recipe to get the answer to the question.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/615/1*s0TAeGSXuHJ8zvfWPV-dZw.png" /><figcaption>Defanging the suspicious IP address</figcaption></figure><h4>2. Investigate the <strong>http.log</strong> file. Which domain address were the malicious files downloaded from? Enter your answer in <strong>defanged format</strong>.</h4><p>This question wants us to use zeek-cut to isolate the <strong>host</strong> and <strong>uri</strong> fields in the log. From there, we can see what appears to be suspicious.</p><pre>cat http.log | zeek-cut host uri</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9_ZDZqMMIMp0a94L2Ci6HQ.png" /><figcaption>Finding the domain name</figcaption></figure><p>We can do a quick Google search for each of the domains and learn that msftncsi.com is a legitimate Microsoft domain, meaning the remaining one is malicious. We’ll use CyberChef with the <strong>Defang URL </strong>recipe to answer the question.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/564/1*kdIBkUVBTCya8cdVNMbq_A.png" /><figcaption>Defanging the malicious URL</figcaption></figure><h4>3. Investigate the malicious document in VirusTotal. What kind of file is associated with the malicious document?</h4><p>We can search the MD5 hash of the document in VirusTotal to learn more about it. To do this, we need to investigate the <strong>files.log</strong> file we created earlier with the <strong>hash-demo.zeek</strong> rule we used. We can then use zeek-cut to show us the MIME type and MD5 hash. The fields for these are <strong>mime_type</strong> and <strong>md5</strong>.</p><pre>cat files.log | zeek-cut mime_type md5</pre><p>This tells us what the file is and the hash.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hZ9LC9NZwggtOqOMk2C41Q.png" /><figcaption>File type and hashes for found files</figcaption></figure><p>We’re trying to investigate the document, so let’s search the MD5 hash for the <strong>application/msword</strong> MIME type on VirusTotal.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iizMT3n7Uvsmo1O3AEST8g.png" /><figcaption>VirusTotal results for the file</figcaption></figure><p>Then, we can check out the <strong>Relations</strong> tab to see the <strong>Bundled Files</strong> related to the malicious document.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/946/1*eSlO6nbPfn_kjYLK27Q6yQ.png" /><figcaption>Finding the file type of the associated files</figcaption></figure><h4>4. Investigate the extracted malicious <strong>.exe</strong> file. What is the given file name in Virustotal?</h4><p>Let’s take the MD5 hash of the .exe file and plug it in to VirusTotal. The resulting page will tell us the given file name.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oY9GuCBjk1EUydGmyv_6Cw.png" /><figcaption>VirusTotal results for the MD5 hash</figcaption></figure><h4>5. Investigate the malicious <strong>.exe</strong> file in VirusTotal. What is the contacted domain name? Enter your answer in <strong>defanged format</strong>.</h4><p>In VirusTotal, we can navigate to the <strong>Behavior</strong> tab and scroll down to the <strong>Network Communication </strong>section to view the DNS Resolutions made by the file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/491/1*RGNaqiTD5yBwvoa8MGdPzA.png" /><figcaption>DNS resolutions made by the malicious executable</figcaption></figure><p>Similar to previous questions, we can paste that into CyberChef and defang the URL to get the answer.</p><h4>6. Investigate the http.log file. What is the request name of the downloaded malicious .exe file?</h4><p>We found the name of this when finding the domain address where the malicious files were downloaded from.</p><h3>Task 4: Log4J</h3><p>Like Task 3, let’s run zeek against the PCAP with the provided script.</p><pre>zeek -Cr log4shell.pcapng detection-log4j.zeek</pre><p>This leaves us with a lot of files to look through.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/735/1*8myW8lkMANrQ-s46sGAHNg.png" /><figcaption>Files created after using Zeek with the rule</figcaption></figure><h4>1. Investigate the <strong>log4shell.pcapng file </strong>with<strong> detection-log4j.zeek</strong> script. Investigate the <strong>signature.log</strong> file. What is the number of signature hits?</h4><p>This question is fairly simple. We can simply use cat to see the contents of the file, which reveals a small number of signature hits. We can also use zeek-cut on the <strong>uid </strong>and pipe that into wc to get a number:</p><pre>cat signatures.log | zeek-cut uid | wc -l</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/886/1*aXBOFqdGhp8aB0DkEKIj5g.png" /><figcaption>Finding the number of signature hits</figcaption></figure><h4>2. Investigate the <strong>http.log </strong>file. Which tool is used for scanning?</h4><p>Looking at the fields of the log file, we can see the option to look at the <strong>user_agent</strong>. If we use zeek-cut to isolate this field, we can see a very common scanning tool listed.</p><pre>cat http.log | zeek-cut user_agent</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/801/1*HrK40lZA9a4EQvl0gnD-1Q.png" /><figcaption>Finding the scanning tool</figcaption></figure><h4>3. Investigate the <strong>http.log</strong> file. What is the extension of the exploit file?</h4><p>Similar to Task 3, we need to look at the <strong>uri</strong> field to see what file was downloaded. Once we use zeek-cut to take a look at this, the answer is pretty clear.</p><pre>cat http.log | zeek-cut uri</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/742/1*1RCcAy2Y3jRnNapUYabB8g.png" /><figcaption>Finding the extension of the exploit file</figcaption></figure><h4>4. Investigate the <strong>log4j.log</strong> file. Decode the base64 commands. What is the name of the created file?</h4><p>Using cat on the log and piping it into head will show the first 10 lines. We can immediately see some Base64 commands in the <strong>uri</strong> field of the log. We’ll then use zeek-cut to isolate this field. We can then use head to see the URI a bit better.</p><pre>cat log4j.log | zeek-cut uri | head</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/838/1*Cf7IE5CRVJPgQ7oAnh-p5w.png" /><figcaption>Finding the Base64 encoded URIs</figcaption></figure><p>Based on this output, we can see that the Base64 commands have “Base64” in the requested URI. To isolate just the lines with Base64 commands, we can use grep:</p><pre>cat log4j.log | zeek-cut uri | grep &quot;Base64&quot;</pre><p>We can see that only three lines have Base64 commands in them.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/913/1*7y558_VEc9M-g7yb-VcxgQ.png" /><figcaption>Only looking at the Base64 commands</figcaption></figure><p>We could simply copy and paste the command into CyberChef to see the decoded command, but let’s do it in our terminal. We’ll use awk to only grab the Base64 encoded portion of the output.</p><pre>cat log4j.log | zeek-cut uri | grep &quot;Base64&quot; | awk -F/ &#39;{print $NF}&#39;</pre><p>This will only show us the Base64 encoded portion of each line.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uAbGFe4PglaJmqROnHUyTw.png" /><figcaption>Only showing the Base64 portion</figcaption></figure><p>Finally, we can pipe this output into the base64 command to decode the line and see the commands being used.</p><pre>cat log4j.log | zeek-cut uri | grep &quot;Base64&quot; | awk -F/ &#39;{print $NF}&#39; | base64 -d</pre><p>We can now see the exact commands being executed and the name of the created file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YeMp7iFdaXApBv9Qsmqm-w.png" /><figcaption>Finding the file name</figcaption></figure><h3>Task 5: Conclusion</h3><h4>1. Read the task above.</h4><p>All we need to do is submit the empty answer.</p><p>We’ve completed the room! We used Zeek and other command-line tools to investigate network traffic. If you’re struggling with the room or have questions, please leave a comment or message me on <a href="https://www.linkedin.com/in/c-shaffer/">LinkedIn</a> and I will try my best to assist!</p><h4>Lessons Learned:</h4><ul><li>Combining Zeek with command-line tools, scripts, and threat intelligence services can be a powerful combination when investigating network traffic</li><li>Always try to work smarter. There were a lot of instances where I could have counted lines or sorted things differently, but using different tools allowed me to create commands that could be used in more instances than this challenge.</li></ul><h4>Things I struggled with:</h4><p>Scripting is still a weak point of mine. Any time I need to use bash scripting, it takes me far longer to get the correct output than it should. It is something I need to spend time learning - I just haven’t yet. I dislike a lot of aspects of coding, but I need to learn it to improve my skills.</p><h4>Conclusion:</h4><p>I liked this room a lot. I felt that it adequately tested the skills that were taught from the Zeek room. The only task I did not like was Task 4. It felt a bit too easy and similar to prior questions. I wish it would have been harder to really push me. Overall, I’d recommend this room to anyone trying to improve in using Zeek or test their skills.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c19d986e4207" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[TryHackMe | Snort Challenge — Live Attacks | Writeup]]></title>
            <link>https://medium.com/@CarsonShaffer/tryhackme-snort-challenge-live-attacks-writeup-bff8875d3d33?source=rss-aaa9aec8f7d2------2</link>
            <guid isPermaLink="false">https://medium.com/p/bff8875d3d33</guid>
            <category><![CDATA[snort]]></category>
            <category><![CDATA[tryhackme]]></category>
            <category><![CDATA[tryhackme-writeup]]></category>
            <category><![CDATA[tryhackme-snort]]></category>
            <category><![CDATA[tryhackme-walkthrough]]></category>
            <dc:creator><![CDATA[Carson Shaffer]]></dc:creator>
            <pubDate>Mon, 19 Aug 2024 04:27:26 GMT</pubDate>
            <atom:updated>2024-08-19T04:27:26.530Z</atom:updated>
            <content:encoded><![CDATA[<h3>TryHackMe | Snort Challenge — Live Attacks | Writeup</h3><p><a href="https://tryhackme.com/r/room/snortchallenges2">TryHackMe’s Snort Challenge — Live Attacks</a> room is a medium-level room where Snort must be used to examine and defend against two different cyberattacks. This writeup will walk through all the steps required to correctly complete this challenge.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dY-sMDz4c4wbQmWXMhUBUw.png" /></figure><h3>Task 1: Introduction</h3><h4>1. Read the task above.</h4><p>The room recommends completing the <a href="https://tryhackme.com/jr/snort">Snort room</a> before trying this challenge. I also believe that the <a href="https://tryhackme.com/jr/snortchallenges1">Snort Challenge — The Basics room</a> should also be completed beforehand to have more experience with Snort before attempting this room.</p><p>We can start the machine, submit the answer, and move on to the next task.</p><h3>Task 2: Scenario 1 | Brute-Force</h3><h4>1. Stop the attack and get the flag (which will appear on your Desktop)</h4><p>Once we get into the machine, we need to figure out what is being attacked and what the attack source is. To do this, we can open our terminal and use Snort in sniffer mode. The following command will use sniffer mode and display full packet details:</p><pre>sudo snort -X</pre><p>Immediately after starting Snort, we can see a lot of network traffic passing through our terminal. I stopped sniffing after about 5 seconds and had over 500 packets. Scrolling through the packets, we’ll notice a lot of SSH (TCP port 22) connections coming from a single IP address. Based on the task name, we can assume that this IP address is trying to brute force our SSH login.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xzJ_sSOWnQDWNYN8Z4EurQ.png" /><figcaption>Repeated SSH traffic</figcaption></figure><p>In this case, the malicious IP is 10.10.245.36. We want to keep our SSH service up and accessible, so we should make a Snort rule to block the malicious IP address only. I created a local.rules file on my desktop to make building and executing rules a bit easier.</p><p>We should use the <strong>drop</strong> action type, which will block and log the packet. The following command will block packets from the malicious IP address:</p><pre>drop tcp 10.10.245.36 any &lt;&gt; any any (msg:&quot;Malicious IP blocked&quot;;sid:1000001;rev:1;)</pre><p>This rule will block all packets where the malicious IP address is the source or destination on any port. This means that this IP will no longer be able to interact with any of our services, and none of our machines can interact with this IP.</p><p>Next, we need to use Snort in IPS mode. To do this, we must use the -Q option and specify specific modules. The following command will start Snort in IPS mode with the rule we created:</p><pre>sudo snort -c local.rules -Q --daq afpacket -i eth0:eth1 -A full</pre><p>After running this command for some time, a notification appears on the desktop notifying us that we got the flag.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1023/1*hrphWZoNITvGkGaCAs3hlQ.png" /><figcaption>Collecting the flag</figcaption></figure><h4>2. What is the name of the service under attack?</h4><p>The service under attack was found in question 1.</p><h4>3. What is the used protocol/port in the attack?</h4><p>The protocol and port in the attack was found in question 1.</p><h3>Task 3: Scenario 2 | Reverse-Shell</h3><h4>1. Stop the attack and get the flag (which will appear on your Desktop)</h4><p>We can start this new machines and start sniffing the network. We’ll use the same command that we used from Task 2 to see the full details of the packets we sniff.</p><pre>sudo snort -X</pre><p>Again, there is a lot of traffic noticeable in our terminal. Scrolling through, there is a lot of traffic on TCP port 4444, which is very uncommon. Port 4444 is the default port for a popular exploitation tool, and based on the task name we know it’s a reverse shell. It’s safe to assume that this traffic is malicious.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/738/1*XqkSOZH0eZ1un0S8CUnKFw.png" /><figcaption>Network traffic on port 4444</figcaption></figure><p>Instead of just blocking the malicious IP address, let’s block traffic to port 4444 altogether. The following rule will block all traffic going to and from port 4444:</p><pre>drop tcp any 4444 &lt;&gt; any any (msg:port 4444 blocked;sid:1000001;rev:1;)</pre><p>Like Task 2, we need to run Snort in IPS mode to utilize these rules.</p><pre>sudo snort -c local.rules -Q --daq afpacket -i eth0:eth1 -A full</pre><p>After running Snort in IPS mode for a few seconds, we receive a notification that we have stopped the attack. The flag can now be found on our desktop.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4OoxlpM8mqD4ef2ABEVXLA.png" /><figcaption>Getting the second flag</figcaption></figure><h4>2. What is the used protocol/port in the attack?</h4><p>This was found while inspecting the network traffic in question 1.</p><h4>3. Which tool is highly associated with this specific port number?</h4><p>This is mostly a trivia question and can be found with a quick Google search if you are unfamiliar. Searching for the port immediately brought up the correct answer. <a href="https://www.speedguide.net/port.php?port=4444">This website</a> included the correct answer along with more information about the port, which is pretty interesting.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/941/1*R89a4dKwEPS4jflIUED3mw.png" /><figcaption>Website showing the correct answer</figcaption></figure><p>We’ve completed the room! We used Snort to detect, analyze, and prevent two different cyberattacks. If you’re struggling with the room or have questions, please leave a comment or message me on <a href="https://www.linkedin.com/in/c-shaffer/">LinkedIn</a> and I will try my best to assist!</p><h4>Conclusion:</h4><p>I thought the idea of this room is pretty cool, but the challenges were a bit simplistic. It seems that you can simply block all traffic (any any &lt;&gt; any any) for both challenges and still get the flags, which I think is bad. Yes, it would stop the attack, but it would also render all other services useless. Overall, it’s an okay review for Snort, but I think the “<a href="https://tryhackme.com/jr/snortchallenges1">Snort Challenge — The Basics</a>” room is far better at checking your knowledge on Snort than this room.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bff8875d3d33" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[TryHackMe | Snort Challenge — The Basics Writeup]]></title>
            <link>https://medium.com/@CarsonShaffer/tryhackme-snort-challenge-the-basics-writeup-1c86f9eb23ad?source=rss-aaa9aec8f7d2------2</link>
            <guid isPermaLink="false">https://medium.com/p/1c86f9eb23ad</guid>
            <category><![CDATA[tryhackme]]></category>
            <category><![CDATA[tryhackme-walkthrough]]></category>
            <category><![CDATA[walkthrough]]></category>
            <category><![CDATA[writeup]]></category>
            <category><![CDATA[tryhackme-snort]]></category>
            <dc:creator><![CDATA[Carson Shaffer]]></dc:creator>
            <pubDate>Sat, 17 Aug 2024 08:31:44 GMT</pubDate>
            <atom:updated>2024-08-17T08:31:44.195Z</atom:updated>
            <content:encoded><![CDATA[<h3>TryHackMe | Snort Challenge — The Basics Writeup</h3><p><a href="https://tryhackme.com/r/room/snortchallenges1">TryHackMe’s Snort Challenge — The Basics</a> is a medium-level challenge that uses Snort to investigate network traffic and stop malicious activity. This writeup will walk through all the steps required to correctly complete this challenge.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*l3ylQaqnHivitUJyJdYTyQ.png" /></figure><h3>Task 1: Introduction</h3><h4>1. Read the task above.</h4><p>All this task does is have us start the machine and state that it’s recommended to complete the <a href="https://tryhackme.com/room/snort">Snort</a> room first. The Snort room gives a basic introduction to the tool and will be helpful in completing this challenge.</p><h3>Task 2: Writing IDS Rules (HTTP)</h3><h4>1. Write a <strong>single</strong> rule to detect “<strong>all TCP port 80 traffic</strong>” packets in the given pcap file. What is the number of detected packets?</h4><p>We’ll start by opening up a terminal and navigating to the task 2 directory on our desktop. We’re given two files: <strong>local.rules</strong> and <strong>mx-3.pcap</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/739/1*s2VYRx9C1C49dsgNI4lRfw.png" /><figcaption>Navigating to the directory and listing files</figcaption></figure><p>We need to create a single rule that will detect any traffic on TCP port 80. I found that the <a href="https://tryhackme-images.s3.amazonaws.com/user-uploads/6131132af49360005df01ae3/room-content/58234314551a2962ad5617cb22591a2b.png">Snort rules structure</a> provided in the <a href="https://tryhackme.com/r/room/snort">Snort</a> room was very helpful in creating the rules for this challenge.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*IIp1WVNUMF7Wuhh3.png" /><figcaption>Snort rule structure. Retrieved from <a href="https://tryhackme.com/r/room/snort">https://tryhackme.com/r/room/snort</a></figcaption></figure><p>The following rule will detect all traffic on TCP port 80:</p><pre>alert tcp any 80 &lt;&gt; any any (msg:&quot;TCP port 80&quot;;sid:1000001;rev:1;)</pre><p>Here’s a breakdown of the rule:</p><blockquote><strong>alert</strong> - We want the rule to generate an alert and log the packet. We’ll see the number of alerts and logs in the statistics after running the rule.</blockquote><blockquote><strong>tcp</strong> - We only want this rule to apply to TCP ports, as specified by the question.</blockquote><blockquote><strong>any 80</strong> - The rule will apply to all source IP addresses but only for traffic on port 80.</blockquote><blockquote><strong>&lt;&gt;</strong> - The rule is bidirectional, so we do not care if the traffic is source to destination or destination to source.</blockquote><blockquote><strong>any any</strong> - The destination is any IP address and any port.</blockquote><blockquote><strong>msg:”TCP port 80&quot;;</strong> - This is the message that will appear with the alert.</blockquote><blockquote><strong>sid:1000001;</strong> - The Snort rule ID for our created rule.</blockquote><blockquote><strong>rev:1;</strong> - The revision number for the rule.</blockquote><p>With our rule created, we can run the following command to analyze the pcap with our rule. Note that we’ll also want to create a log file for future questions:</p><pre>sudo snort -r mx-3.pcap -c local.rules -A full -l .</pre><p>We can now take a look at the statistics provided in the output to see how many TCP port 80 packets were alerted on. The number is shown under the <strong>Action Stats </strong>section.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/461/1*a1FgH8rbs5q6XDGw_3hoLA.png" /><figcaption>Number of alerts and logs from our Snort rule</figcaption></figure><h4>2. Investigate the log file. What is the destination address of packet 63?</h4><p>Since we created the log file in the last question, we can run the following command to only process up through the 63rd packet.</p><pre>sudo snort -r snort.log.1723693948 -n 63</pre><p>Once we run that, we can scroll up to see the destination IP in the last packet that was processed.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/738/1*XQ4AlF6PZQhlBUzdnkoabA.png" /><figcaption>Results from the 63rd packet</figcaption></figure><h4>3. Investigate the log file. What is the ACK number of packet 64?</h4><p>Similar to the last question, we can run the following command to only process up through the 64th packet.</p><pre>sudo snort -r snort.log.1723693948 -n 64</pre><p>Scrolling up shows us the Ack number for the packet.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/733/1*ZXLu2ZcDiOv1wzrZIaz33Q.png" /><figcaption>Results from the 64th packet</figcaption></figure><h4>4. Investigate the log file. What is the SEQ number of packet 62?</h4><p>Again, the command is very similar to the previous one.</p><pre>sudo snort -r snort.log.1723693948 -n 62</pre><p>Scrolling up shows the Seq number for the packet.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/737/1*uywOnZNuaZg9OmiLg_hWyw.png" /><figcaption>Results from the 62nd packet</figcaption></figure><h4>5. Investigate the log file. What is the TTL of packet 65?</h4><p>The results from the command will be used for this question along with questions 6 and 7.</p><pre>sudo snort -r snort.log.1723693948 -n 65</pre><p>Scrolling up shows the information related to the packet.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/738/1*YAbthEFnnbAKfSLEVQ6buw.png" /><figcaption>Results for the 65th packet</figcaption></figure><h4>6. Investigate the log file. What is the source IP of packet 65?</h4><p>This can be found in the packet screenshot from question 5.</p><h4>7. Investigate the log file. What is the source port of packet 65?</h4><p>This can be found in the packet screenshot from question 5.</p><h3>Task 3: Writing IDS Rules (FTP)</h3><h4>1. Use the given pcap file. Write a <strong>single</strong> rule to detect “<strong>all TCP port 21</strong>” traffic in the given pcap. What is the number of detected packets?</h4><p>This question is very similar to the first question from task 2. Our rule will look nearly identical, just with a different port number. The following rule will detect the correct traffic:</p><pre>alert tcp any 21 &lt;&gt; any any (sid:1000001;)</pre><p>We can then run the following command to find the correct number of packets. Like Task 2, we’ll also use this to create a log file for further investigation later.</p><pre>sudo snort -r ftp-png-gif.pcap -c local.rules -l .</pre><p>Under the <strong>Action Stats</strong> section we can see the number of alerts generated.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/738/1*uftEqG4bTytqIVEa7jS9IQ.png" /><figcaption>The number of alerts generated by our rule.</figcaption></figure><h4>2. Investigate the log file. What is the FTP service name?</h4><p>There are a few ways to complete this question. The least technical is to read the file using Snort and scroll up until you see the name of the service. This is inefficient, but can be completed with the following command:</p><pre>sudo snort -r snort.log.1723772256 -X</pre><p>Near the top, you’ll be able to see the name of the service.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/737/1*8oEsBdh8m_karDChEB2TUg.png" /><figcaption>Finding the name of the FTP service</figcaption></figure><p>A better way to find this is using the <strong>strings</strong> command. This command simply finds anything that appears to be a string in the file and outputs them. This still displays a lot of information, but it is easier to digest. The following command uses strings to find the correct name:</p><pre>sudo strings snort.log.1723772256</pre><p>Near the top of the output, the name of the service is clearly visible.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/772/1*f249SJbQFC53CofxM8Hsiw.png" /><figcaption>Strings output for the log file</figcaption></figure><p>Finally, we can also use the <strong>grep</strong> command to make the output even better. If we assume the FTP service will include the word “FTP” we can grep for it after our strings search. The following command integrates the grep command into our strings search:</p><pre>sudo strings snort.log.1723772256 | grep &quot;FTP&quot;</pre><p>This outputs the following, which shows each instance of the FTP service name.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/769/1*nU100PnjRRY0XRMiDmA9Fw.png" /><figcaption>Output when using strings and grep</figcaption></figure><h4>3. Deactivate/comment on the old rules. Write a rule to detect failed FTP login attempts in the given pcap. What is the number of detected packets?</h4><p>You may have noticed in the previous screenshot a code number next to the service. These codes are included in packets included in the pcap for different actions taken on the service. A quick Google search will find <a href="https://learn.microsoft.com/en-us/troubleshoot/developer/webapps/iis/ftp-service-svchost-inetinfo/ftp-status-codes-iis-7-and-later-versions">an article</a> that lists all of these status codes. These will be very helpful in completing this question and other questions from this task.</p><p>Reading through the article will show us that code 530 indicates that the user is not logged in. Closer to the bottom, the code is explained in more detail.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/578/1*pWZB-hlPsao4h5QCRPkmNw.png" /><figcaption>530 status code description</figcaption></figure><p>Using this code, we can create a rule that will detect packets that contain this code, indicating a failed FTP login event. We can use the <strong>content</strong> rule option to identify packets with the code.</p><pre>alert tcp any 21 &lt;&gt; any any (content:&quot;530&quot;;sid:1000001;)</pre><p>We can then run the following Snort command to use this rule with the pcap:</p><pre>sudo snort -r ftp-png-gif.pcap -c local.rules</pre><p>Like question 1, the number of alerts can be found under the <strong>Action Stats</strong> section.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/773/1*-29tqzABZ1KEZafeaiiDWA.png" /><figcaption>Number of failed login alerts</figcaption></figure><h4>4. Write a rule to detect successful FTP logins in the given pcap. What is the number of detected packets?</h4><p>Just like the last question, we can refer to the list of codes to find the one relating to successful login events. The code is 230.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/568/1*Tqg0XVh1GpWwzUJOOTH_cA.png" /><figcaption>Status code for a successful login event</figcaption></figure><p>We can simply edit our rule to look for status code 230 in the packets.</p><pre>alert tcp any 21 &lt;&gt; any any (content:&quot;230&quot;;sid:1000001;)</pre><p>We can then run the same command with Snort to use our rule.</p><pre>sudo snort -r ftp-png-gif.pcap -c local.rules</pre><p>This gives us the number of alerts under the <strong>Action Stats </strong>section.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/775/1*GTh8d2phA3GP2lySAE6ceg.png" /><figcaption>Number of alerts for successful login events</figcaption></figure><h4>5. Write a rule to detect FTP login attempts with a valid username but no password entered yet. What is the number of detected packets?</h4><p>We’ll find that status code 331 is for “User name okay, need password.” We’ll edit our rule to look for this code. According to the documentation, this code appears regardless of whether the account is valid. However, it is the code required to get the correct answer.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/573/1*Ekc62UvDxtDyWm2-VZXoHg.png" /><figcaption>What status code 331 means</figcaption></figure><p>We’ll use the following rule:</p><pre>alert tcp any 21 &lt;&gt; any any (content:&quot;331&quot;;sid:1000001;)</pre><p>We’ll use the same Snort command to analyze the pcap.</p><pre>sudo snort -r ftp-png-gif.pcap -c local.rules</pre><p>This then gives us the number of alerts under the <strong>Action Stats</strong> section.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/777/1*c7fomAxyZG4vUlEcUTsSGg.png" /><figcaption>Number of alerts for valid usernames but no password</figcaption></figure><h4>6. Write a rule to detect FTP login attempts with the “Administrator” username but no password entered yet. What is the number of detected packets?</h4><p>We can modify our prior rule to also include the word “Administrator”, which would be shown in the packet when attempting to log in as an administrator. We still need to include the 331 status code to ensure it only alerts for unsuccessful login attempts. Our rule will look like the following:</p><pre>alert tcp any 21 &lt;&gt; any any (content:&quot;Administrator&quot;;content:&quot;331&quot;;sid:1000001;)</pre><p>We’ll use the same Snort command to analyze the pcap.</p><pre>sudo snort -r ftp-png-gif.pcap -c local.rules</pre><p>This then gives us the number of alerts under the <strong>Action Stats</strong> section.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/776/1*tx6DNjizXwpJjIcq8wJyXA.png" /><figcaption>Number of alerts for “Administrator” but no password</figcaption></figure><h3>Task 4: Writing IDS Rules (PNG)</h3><h4>1. Write a rule to detect the PNG file in the given pcap. Investigate the logs and identify the software name embedded in the packet.</h4><p>We’ll continue to use the <strong>content </strong>detection rule to identify which packet contains the PNG file. The header of the file should contain “PNG”, and should also contain the software used to create the image. We’ll use the following rule to identify the PNG file:</p><pre>alert tcp any any &lt;&gt; any any  (content:&quot;PNG&quot;;sid:1000001;)</pre><p>We’ll then use the following command to run Snort on the pcap and also create a log file:</p><pre>sudo snort -r ftp-png-gif.pcap -c local.rules -l .</pre><p>With the log file created, we can use the following command to inspect the log file and see the packet details:</p><pre>sudo snort -r snort.log.1723777434 -X</pre><p>Then, we can scroll to the only packet and see the software name.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/773/1*jOYulBa_Uxt-gr0TntNi4Q.png" /><figcaption>The software name for the PNG in the packet</figcaption></figure><h4>2. Write a rule to detect the GIF file in the given pcap. Investigate the logs and identify the image format embedded in the packet.</h4><p>We can modify our rule to search for “GIF” instead of “PNG”. This will alert on any packets that include “GIF” in them. The following is what our new rule will look like:</p><pre>alert tcp any any &lt;&gt; any any  (content:&quot;GIF&quot;;sid:1000001;)</pre><p>We’ll then use the following command to run Snort on the pcap and also create a log file:</p><pre>sudo snort -r ftp-png-gif.pcap -c local.rules -l .</pre><p>With the log file created, we can use the following command to inspect the log file and see the packet details:</p><pre>sudo snort -r snort.log.1723778324 -X</pre><p>Like the last question, we’ll scroll up to the packet details which shows the image format embedded in the packet.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/776/1*tM-2IRdBxkByw44bsgBEMg.png" /><figcaption>Image format embedded in the packet</figcaption></figure><h3>Task 5: Writing IDS Rules (Torrent Metafile)</h3><h4>1. Write a rule to detect the torrent metafile in the given pcap. What is the number of detected packets?</h4><p>Every torrent file that I have seen has had the extension <strong>.torrent</strong>. I confirmed this through a Google search before creating the rule, which seemed to back up my experience.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/875/1*Q9LH9clSx0NM7etjPlQMvA.png" /><figcaption>Extension for torrent files</figcaption></figure><p>We can use this to create a rule that looks for “.torrent” in the content of the packets, which should give us the correct number of packets containing the metafile. The following rule will look for the extension:</p><pre>alert tcp any any &lt;&gt; any any (content:&quot;.torrent&quot;;sid:1000001;)</pre><p>We’ll then use the following command to analyze the pcap using our rule and create a log file:</p><pre>sudo snort -r torrent.pcap -c local.rules -l .</pre><p>This provides the number of alerts under the <strong>Action Stats </strong>page.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/777/1*Ox-Hl2hht4yVTOEu6PFb8Q.png" /><figcaption>Number of torrent metafiles detected in the pcap</figcaption></figure><h4>2. Investigate the log/alarm files. What is the name of the torrent application?</h4><p>Using the <strong>strings</strong> command for the log file seems to be the easiest way to analyze it. The following command will use strings to analyze the log file:</p><pre>sudo strings snort.log.1723779435</pre><p>The output can be used for answering the rest of the questions in this task.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1007/1*fmZsw6ocHLnjW_bupMTOVw.png" /><figcaption>Output from using strings on the log file</figcaption></figure><p>The name of the torrent application can be found by looking into the string after “Accept:”. If it’s not obvious from the string, a quick Google search of the term should show the answer.</p><h4>3. Investigate the log/alarm files. What is the MIME (Multipurpose Internet Mail Extensions) type of the torrent metafile?</h4><p>The MIME type is the string after “Accept:” and can be found from the output in question 2.</p><h4>4. Investigate the log/alarm files. What is the hostname of the torrent metafile?</h4><p>The hostname is shown after “Host:” in the output from question 2.</p><h3>Task 6: Troubleshooting Rule Syntax Errors</h3><p>I will discuss the errors in each rule. After fixing each rule, you can run the following command to determine the number of detected packets:</p><pre> sudo snort -c local-X.rules -r mx-1.pcap</pre><h4>1. Fix the syntax error in <strong>local-1.rules</strong> file and make it work smoothly.</h4><p>There is no space between the last “any” and the beginning of the general rule options.</p><h4>2. Fix the syntax error in <strong>local-2.rules</strong> file and make it work smoothly.</h4><p>An “any” is missing from the source and needs to be added.</p><h4>3. Fix the syntax error in <strong>local-3.rules</strong> file and make it work smoothly.</h4><p>The SID for each rule is the same.</p><h4>4. Fix the syntax error in <strong>local-4.rules</strong> file and make it work smoothly.</h4><ol><li>In the second rule, the msg option ends with a colon (:) but should end with a semicolon (;).</li><li>The SID for each rule is the same.</li></ol><h4>5. Fix the syntax error in <strong>local-5.rules</strong> file and make it work smoothly.</h4><ol><li>The second rule contains an illegal direction (<strong>&lt;-</strong>). It should be changed to <strong>-&gt;</strong>.</li><li>The SID rule option in the second rule has a semicolon (;) before the SID number. It should be a colon (:)</li><li>In the third rule, the msg option ends with a colon (:) but should end with a semicolon (;).</li></ol><h4>6. Fix the logical error in <strong>local-6.rules</strong> file and make it work smoothly to create alerts.</h4><p>The content detection rule is using HEX to try to find packets that contain “GET”. However, the rule is looking for “get”. There are two ways to remedy this, we can include the <strong>nocase</strong> rule option after the content detection rule or we can simply switch the HEX to be in caps (47 45 54).</p><h4>7. Fix the logical error in <strong>local-7.rules</strong> file and make it work smoothly to create alerts.</h4><p>A general rule is missing from the rule options which is used to summarize the event in the log.</p><h3>Task 7: Using External Rules (MS17–010)</h3><h4>1. Use the given pcap file. Use the given rule file (<strong>local.rules</strong>) to investigate the ms1710 exploitation. What is the number of detected packets?</h4><p>MS17–010 is also known as <a href="https://en.wikipedia.org/wiki/EternalBlue">EternalBlue</a>, which was developed by the NSA. The rules list was created to alert when this exploit is being used. Like with the previous questions, we just need to analyze the pcap with the provided rule. The following command will use the rule with Snort:</p><pre>sudo snort -r ms-17-010.pcap -c local.rules</pre><p>Now we can look under the <strong>Action Stats</strong> section to see how many alerts were triggered.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/737/1*xEbJsRCHYZI6irYHhIGaMg.png" /><figcaption>Number of alerts triggered from the rule</figcaption></figure><h4>2. Use <strong>local-1.rules</strong> empty file to write a new rule to detect payloads containing the “<strong>\IPC$</strong>” keyword. What is the number of detected packets?</h4><p>We can utilize the <strong>content</strong> detection rule to alert us to packets containing “\IPC$”. One thing to remember is that backslash (\) is an <a href="https://en.wikipedia.org/wiki/Escape_character">escape character</a> so our rule will be misinterpreted as containing an escape sequence. We can eliminate this misinterpretation by including a second backslash when creating our content rule. If we do not include this second backslash, we’ll receive a fatal error when analyzing the pcap.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/739/1*tJDshcBBlgrIvoeyG2OPvQ.png" /><figcaption>Error when using the incorrect rule</figcaption></figure><p>The rule we’ll use will search the content for the given string.</p><pre>alert tcp any any &lt;&gt; any any (msg:&quot;\\IPC$ detected&quot;;content:&quot;\\IPC$&quot;;sid:1000001;rev:1)</pre><p>You may notice that our <strong>msg</strong> general rule also contains a second backslash. We can run the rule without the second backslash in the msg, however, the backslash will not show up in our alert file. Here is the difference between the two.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/605/1*uVCbc_mHnffSW1uKpP5s-g.png" /><figcaption>Alert with only one backslash in our msg</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/608/1*SeUMr7beajmL7MdW4GIYyA.png" /><figcaption>Alert with both backslashes in our msg</figcaption></figure><p>This is fairly minor, and doesn’t matter much in the long term. However, when creating rules we should be as detailed and accurate as possible.</p><p>With our correct rule created, we can run the following command to analyze the pcap with our rule file. We’ll also want to create a log file to use for the next question.</p><pre>sudo snort -r ms-17-010.pcap -c local-1.rules -l .</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/739/1*apKM2Yhvu7DarXZIuI-rPg.png" /><figcaption>Number of alerts generated with our rule</figcaption></figure><h4>3. Investigate the log/alarm files. What<strong> </strong>is the requested path?</h4><p>We can use <strong>snort</strong> or <strong>strings</strong> to investigate the log file. I found strings to be easier, but I’ll include the command and screenshots for both.</p><p>Command to investigate the log using Snort:</p><pre>sudo snort -r snort.log.1723872066 -X</pre><p>We can then scroll up to one of the packets to see the path that was requested.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/740/1*Pvq_hJ0LK0puup0cHwri6Q.png" /><figcaption>Packet that shows the requested path</figcaption></figure><p>Command to investigate the log using strings:</p><pre>sudo strings snort.log.1723872066</pre><p>This will pull out anything that looks like a string, which includes the path.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/742/1*5SSF1xZrX0c1AM4LE8YjzQ.png" /><figcaption>Strings output showing the requested path</figcaption></figure><h4>4. What is the CVSS v2 score of the MS17–010 vulnerability?</h4><p>This can be found using a simple Google search. I used the <a href="https://nvd.nist.gov/vuln/detail/cve-2017-0144">NIST NVD entry</a> which provides a wealth of information on the vulnerability.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*02JVSaKh7GCAF557ec8Nmg.png" /><figcaption>NIST NVD entry for MS17–010 (CVE-2017–0144)</figcaption></figure><h3>Task 8: Using External Rules (Log4j)</h3><h4>1. Use the given pcap file. Use the given rule file (<strong>local.rules</strong>) to investigate the log4j exploitation. What is the number of detected packets?</h4><p>Like the last task, we just need to run Snort with our rule. We’ll also want to create a log to use for the next questions.</p><pre>sudo snort -r log4j.pcap -c local.rules -l .</pre><p>We can then look at the <strong>Action Stats </strong>section to see the number of generated alerts.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/739/1*GD9T_39b1--IbkAkL8qjkA.png" /><figcaption>Generated alerts for the provided rule</figcaption></figure><h4>2. Investigate the log/alarm files. How many rules were triggered?.</h4><p>If we investigate the generated alert file, we can manually look through each and see which SID is triggered, which will tell us the rule triggered. This would be pretty time consuming and error prone, so let’s make it a bit easier.</p><p>If we simply use <strong>cat </strong>to read the alert, we’ll notice that the shown SID follows a consistent pattern.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/743/1*9QuaeGBOsl8dKtz-5F6Fvw.png" /><figcaption>Alert file in snort</figcaption></figure><p>Here is a breakdown of what this is for [1:21003728:1]:</p><blockquote>Generator ID (GID) : 1 — This is the first 1 that we see and identifies which component of Snort generated the alert.</blockquote><blockquote>Snort ID (SID): 21003728 — This is the unique identifier for the Snort rule.</blockquote><blockquote>Revision Number: 1 — This is the version of the rule.</blockquote><p>We have brackets surrounding the entire string and colons between each section. Let’s use grep to isolate this string. Here is the command I used along with a breakdown of each section. If you don’t have much experience in grep or regular expressions (regex) this may seem a bit complicated, but it’s definitely worth learning. Here is the command:</p><pre>grep -o &#39;\[[0-9]*:[0-9]*:[0-9]*\]&#39; alert</pre><p>And here is a breakdown of each part:</p><blockquote>grep - This is used for searching text using patterns that we can define</blockquote><blockquote>-o - This is an option that tells grep to only output the matching parts of the line. This means we’ll only see the part that matches the pattern we define.</blockquote><blockquote>‘\[[0–9]*:[0–9]*:[0–9]*\]’ - This is our regex that we are using to match text. Let’s break this one down a bit more:</blockquote><blockquote>\[ and \] - These are just the brackets that appear in the string we want to isolate. We need to escape the brackets with backslashes (\) because grep treats brackets specially.</blockquote><blockquote>[0–9]* - This matches zero or more digits. [0–9] will match any digit from 0–9, and the * will further match zero or more of the preceding string. This means that, for the first [0–9]*, the GID could be any combination of numbers 0–9 and the pattern would match. We’ve only seen the number 1 for the GID, but it could be different, so we should account for that.</blockquote><blockquote>: - This is the colon that breaks up the GID, SID, and revision number</blockquote><blockquote>We can look at [0–9]*:[0–9]*:[0–9]* as matching the pattern “zero or more digits, followed by a colon, zero or more digits, followed by a colon, and zero or more digits.” This means that our pattern accounts for any GID number, any SID number, and any revision number.</blockquote><blockquote>alert - This is the name of our file that grep is searching through.</blockquote><p>We can use this command to get the following output:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/737/1*4FnZ_JEN4qpRyuvK4TKZWg.png" /><figcaption>Output for our command</figcaption></figure><p>This is really good, and makes it easy to look through each SID. We can do better, though. We can use the <strong>cut</strong> command to isolate only the SID portion of the string. The following command will use our grep command and cut to only show the SID:</p><pre>grep -o &#39;\[[0-9]*:[0-9]*:[0-9]*\]&#39; alert | cut -d: -f2</pre><p>I’ll break down the addition of our new command:</p><blockquote>| - The pipe will take the output from the grep command and uses it as input for the cut command (takes from the left and feeds it to the right).</blockquote><blockquote>cut - This command extracts sections from input data.</blockquote><blockquote>-d: - This specifies the delimiter used for splitting the input. The delimiter we want to use is a colon, which splits the string into separate sections.</blockquote><blockquote>-f2 - This tells cut to extract and print the second field of input, which has been split by the delimiter. Our input has been split into three sections due to our delimiter. So, if we used -f1, our output would be <strong>[1</strong> and if we used -f3 the output would be <strong>1]</strong>. This means -f2 will isolate just the SID.</blockquote><p>With the addition of cut, our output will just tell us the SID.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/737/1*s537f7WBuOZmaOPizk5oMA.png" /><figcaption>Isolating just the SID using cut</figcaption></figure><p>Finally, we can use another command to only output the unique SID numbers, which will show us the rules triggered. Using the <strong>sort</strong> command can output only the unique SIDs.</p><pre>grep -o &#39;\[[0-9]*:[0-9]*:[0-9]*\]&#39; alert | cut -d: -f2 | sort -u</pre><p>Here’s a quick breakdown:</p><blockquote>| - Again, this will take the output from the right (our SIDs) and use it as input for the left (the sort command).</blockquote><blockquote>sort - This command is used to sort lines of input</blockquote><blockquote>-u - This option is used with sort to only output unique lines. Any duplicates are removed from the sorted list.</blockquote><p>When we run the full command, we get the output of the unique SIDs (rules) that were triggered.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/738/1*5a2z6G7BS_58CHmCw-K8Yw.png" /><figcaption>Finding the number of unique rules triggered</figcaption></figure><p>Now, this has already been fairly complicated just to find the number of rules triggered, but we may want to go a step further. The number of rules triggered for this question is very small and easy to count. However, if dozens or hundreds of rules were triggered in a single alert file, it would be much harder to get the number. We can add one final command to get the exact number of rules triggered. Using the <strong>wc</strong> command will provide us just the number as output.</p><pre>grep -o &#39;\[[0-9]*:[0-9]*:[0-9]*\]&#39; alert | cut -d: -f2 | sort -u | wc -l</pre><p>Breakdown:</p><blockquote>| - Again, this will take the output from the right (our SIDs) and use it as input for the left (the sort command).</blockquote><blockquote>wc - This stands for “word count” and is used to count lines, words, or characters from input data</blockquote><blockquote>-l - This option tells wc to only count and print the number of lines from the input.</blockquote><p>In summary, our entire command searches through the entire alert file and outputs a specific pattern, we then isolate the SID from the string, sort it by unique SIDs, and then output a final number of unique SIDs that were triggered.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/738/1*5s9OiG1Q419wUOdc64RlmQ.png" /><figcaption>Output of our final command</figcaption></figure><h4>3. Investigate the log/alarm files. What are the first six digits of the triggered rule sids?</h4><p>This can be found while looking through the SIDs of the previous question.</p><h4>4. Use <strong>local-1.rules</strong> empty file to write a new rule to detect packet payloads <strong>between 770 and 855 bytes. </strong>What is the number of detected packets?</h4><p>We can use the <strong>dsize</strong> detection rule to filter by packet payload size. The following rule will search all TCP traffic for packets between 770 and 855 bytes:</p><pre>alert tcp any any &lt;&gt; any any (msg:&quot;Packet between 770 and 855&quot;;dsize:770&lt;&gt;855;sid:1000001;rev:1;)</pre><p>We can then use Snort with the rule to analyze the pcap and find the number of packets between this size. We’ll also want to create a log file for the questions after.</p><pre>sudo snort -r log4j.pcap -c local-1.rules -l .</pre><p>Looking under <strong>Action Stats </strong>will tell us the number of alerts for packets between the given size.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/738/1*PR5xW2JLvd0Bc7UxVYoj_Q.png" /><figcaption>Alerts generated for the packet size</figcaption></figure><h4>5. Investigate the log/alarm files. What<strong> </strong>is the name of the used encoding algorithm?</h4><p>We can use Snort to analyze the log file we created in the previous question using the following command:</p><pre>sudo snort -r snort.log.1723880111 -X</pre><p>Scrolling through the packets will show an encoding algorithm.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/740/1*yVr3JjbVhR12W24Src1ajw.png" /><figcaption>Finding the encoding algorithm</figcaption></figure><h4>6. Investigate the log/alarm files. What<strong> </strong>is the IP ID of the corresponding packet?</h4><p>We can see the ID in the packet found in the previous question.</p><h4>7. Investigate the log/alarm files. Decode the encoded command. What is the attacker’s command?</h4><p>We need to isolate the encoded command we saw in the packet. I found the easiest way to grab the encoded command was to use strings on the log file. The following command will output every string in the file:</p><pre>sudo strings snort.log.1723880111</pre><p>This outputs the the entire encoded command.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/741/1*Kw8kGVMloBYjbT9uI3LQng.png" /><figcaption>Using strings to find the command</figcaption></figure><p>We can then copy the command and paste it into <a href="https://cyberchef.io/">CyberChef</a> to find the decoded command. We’ll need to use the correct recipe to with the algorithm found from question 5.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*I34B5r1BghqerlsKbI0piw.png" /><figcaption>Using CyberChef to decode the command</figcaption></figure><h4>8. What is the CVSS v2 score of the Log4j vulnerability?</h4><p>Like the last task, I used a Google search to find the <a href="https://nvd.nist.gov/vuln/detail/CVE-2021-44228">NIST NVD entry</a> for the vulnerability.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1023/1*KPWJ570p7QB7PgLMX1FRlA.png" /><figcaption>CVSS 2.0 score for the vulnerability</figcaption></figure><h3>Task 9: Conclusion</h3><h4>1. Read the task above.</h4><p>We just need to click the button.</p><p>We’ve completed the room! We used Snort and other tools to investigate network traffic and create rules. If you’re struggling with the room or have questions, please leave a comment or message me on <a href="https://www.linkedin.com/in/c-shaffer/">LinkedIn</a> and I will try my best to assist!</p><h4>Lessons Learned:</h4><ul><li>Using other terminal commands with Snort output can make investigating traffic much easier than just using Snort.</li><li>Snort rules are fairly strict with how they must be constructed. Small errors can break a rule and stop Snort from working properly.</li></ul><h4>Things I struggled with:</h4><p>I struggled a bit with remembering how to construct rules and the commands for Snort. I ended up having to review and refer to my notes quite a bit to remember everything. The regex portion of task 8 took me a long time to get right. I don’t have a ton of experience with constructing and using regex, so I struggled more than I should have with fully understanding everything. I kept getting an error when using Snort with the rule to detect packet payloads (ERROR: Can’t initialize DAQ pcap (-1) — unknown file format). I messed around with everything for a long time before just restarting the machine and redoing it. I’m not sure if I did anything different, but the rule and Snort worked the first time after.</p><h4>Conclusion:</h4><p>This room is fantastic. It really pushed me to fully understand the concepts taught in the Snort introduction room. Some of the questions were a bit repetitive, so I think a little more variety with the questions would be good. However, the repetition helped me use the commands without having to check my notes. Overall, this room is perfect for anyone trying to get better at Snort or test their skills.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1c86f9eb23ad" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>