<?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 lyön on Medium]]></title>
        <description><![CDATA[Stories by lyön on Medium]]></description>
        <link>https://medium.com/@ox21.lo?source=rss-dfaf5f3e7d94------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*eV41eIFRGMUJqAZoAvFNYQ@2x.jpeg</url>
            <title>Stories by lyön on Medium</title>
            <link>https://medium.com/@ox21.lo?source=rss-dfaf5f3e7d94------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 28 Nov 2026 18:34:15 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@ox21.lo/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[SM — FlagYard]]></title>
            <link>https://medium.com/@ox21.lo/sm-flagyard-6555884adb09?source=rss-dfaf5f3e7d94------2</link>
            <guid isPermaLink="false">https://medium.com/p/6555884adb09</guid>
            <category><![CDATA[blue-team]]></category>
            <category><![CDATA[ctf]]></category>
            <category><![CDATA[forensics]]></category>
            <category><![CDATA[memory-forensics]]></category>
            <dc:creator><![CDATA[lyön]]></dc:creator>
            <pubDate>Sun, 24 May 2026 17:49:46 GMT</pubDate>
            <atom:updated>2026-05-24T17:49:46.014Z</atom:updated>
            <content:encoded><![CDATA[<p><a href="https://flagyard.com/labs/training-labs/14/challenges/09db7a9d-43ce-4839-8bae-fb7c84a94b55">Forensics </a>— <em>Medium</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/1*E-Jw7H1qPJByUcB8DjKoXg.jpeg" /></figure><h3>Scenario</h3><blockquote><strong>SM Company</strong> has fallen victim to a social engineering attack. Attackers successfully breached their systems using malicious Microsoft Office documents.</blockquote><p>The scenario notes that the attacker utilized an <strong>Office document</strong> to gain initial access. To investigate this breach, we will leverage <strong>Volatility 3</strong> to perform advanced memory forensics.</p><h3>Phase 1: Process Tree Analysis</h3><p>First, we need to inspect the process tree to identify active processes <strong>related to Microsoft Office</strong> and find their unique Process Identifiers (PIDs). We run the windows.pstree plugin:</p><pre>vol -f SM_Challenge.raw windows.pstree</pre><p>Looking through the output, we spot a running instance of Microsoft Word (WINWORD.EXE) with a PID of 5644:</p><pre>5644    4524    WINWORD.EXE     0xcc89ab6bd0c0  31      -       1       True    2024-09-06 17:28:49.000000 UTC  N/A     Disabled</pre><h3>Phase 2: Hunting for Code Injection</h3><p>we need to check if the malicious document injected code into the WINWORD.EXE process memory.</p><p>We can use the windows.malfind plugin, which scans for hidden or injected code by looking for memory regions with PAGE_EXECUTE_READWRITE (RWX) permissions—a common indicator of injection.</p><pre>vol -f SM_Challenge.raw windows.malfind</pre><p>The tool hits a match on our target process (PID 5644). When inspecting the hex dump of the injected memory region, the flag reveals itself right at the beginning of the payload:</p><pre>5644    WINWORD.EXE     0xd540000       0xd540fff       VadS    PAGE_EXECUTE_READWRITE  1       1       Disabled        N/A<br><br>46 6c 61 67 59 7b 00 00 00 00 00 00 00 00 00 00 FlagY{..........</pre><pre>vol -f SM_Challenge.raw windows.netscan -&gt; To find the local IP address and network connections<br>vol -f SM_Challenge.raw windows.envars --pid 5644 -&gt; to see who ran the process</pre><p>Challenge Solved!..</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6555884adb09" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Collector — FlagYrad]]></title>
            <link>https://medium.com/@ox21.lo/collector-flagyrad-2be9fbfab376?source=rss-dfaf5f3e7d94------2</link>
            <guid isPermaLink="false">https://medium.com/p/2be9fbfab376</guid>
            <category><![CDATA[flagyard]]></category>
            <category><![CDATA[ctf]]></category>
            <category><![CDATA[ctf-writeup]]></category>
            <category><![CDATA[forensics]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <dc:creator><![CDATA[lyön]]></dc:creator>
            <pubDate>Sat, 24 Jan 2026 01:53:00 GMT</pubDate>
            <atom:updated>2026-01-24T02:05:05.115Z</atom:updated>
            <content:encoded><![CDATA[<h3>Collector — FlagYrad</h3><p><a href="https://flagyard.com/labs/training-labs/14/challenges/a7036150-2a56-4220-accf-2004ac2ada1c"><em>Forensics </em></a><em>— Medium</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/807/1*k8Em8pRN9yndlIw7W3VWLw.png" /><figcaption>o o o</figcaption></figure><blockquote>Description:</blockquote><blockquote><em>The antivirus has detected multiple files being dropped on the machine. We need to identify the downloaded files and retrieve the flag.</em></blockquote><h4>System Information:</h4><p>Hostname: castelblack.north.sevenkingdoms.local</p><p>User: CASTELBLACK\vagrant</p><h3>The Tool: Chainsaw</h3><p>Manually parsing Windows Event Logs (.evtx) is slow. To speed up the triage, I used <strong>Chainsaw</strong>, a powerful &quot;first-response&quot; tool. It allowed me to scan for known &quot;bad&quot; behaviors using <strong>Sigma rules</strong>—standardized signatures for threat detection.</p><p>I ran the following command to hunt for anomalies:</p><pre>chainsaw hunt logs/ -s sigma - mapping chainsaw/mappings/sigma-event-logs-all.yml</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*l0FtA-Y8TvkiDI7VmoSyDw.png" /><figcaption>Microsoft-Windows-Bits-Clint</figcaption></figure><p>Chainsaw quickly flagged suspicious <strong>PowerShell execution</strong> and <strong>BITS transfer jobs</strong>.</p><blockquote>looking at the jobTitle<em>😄 it the format [FlagY]</em></blockquote><h3>1. The PowerShell Engine</h3><p>Before the files were dropped, I found <strong>Event ID 4104 (Script Block Logging)</strong>. This log revealed that <strong>Process ID 6808</strong> was running an automated script.</p><pre>if((Get-ExecutionPolicy ) -ne &#39;AllSigned&#39;) { Set-ExecutionPolicy -Scope Process Bypass }; &amp; &#39;C:\Users\vagrant\Desktop\AnAn.ps1&#39;</pre><p>The script checked the security policy, bypassed it, and executed a file called AnAn.ps1. Interestingly, the wrapper used for this execution appeared to be an <strong>Ansible automation payload</strong>, suggesting the attacker was using automated management tools to stay under the radar.</p><p><strong>The “JobTitle” Twist</strong> The attacker used a clever technique: <strong>Living off the Land</strong>. Instead of naming the <em>transfer </em>something obvious, they used the jobTitle field to spell out the flag character by character, simple string searches for “Flag” or “FlagY” would fail. I had to reconstruct it manually.</p><h3>Lessons Learned</h3><ol><li><strong>Metadata is Evidence:</strong> The “Flag” wasn’t inside a file; it was in the <strong>name</strong> of the transfer job.</li><li><strong>Watch the BITS logs:</strong> Attackers love “Living off the Land” (LotL) techniques because they use legitimate Windows services to bypass detection.</li><li><strong>Automate Triage:</strong> Using tools like <strong>Chainsaw</strong> allows you to move from “Alert” to “Root Cause” in minutes rather than hours.</li></ol><p><em>The End..</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2be9fbfab376" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Pwny CTF]]></title>
            <link>https://medium.com/@ox21.lo/pwny-ctf-e1563ff75154?source=rss-dfaf5f3e7d94------2</link>
            <guid isPermaLink="false">https://medium.com/p/e1563ff75154</guid>
            <category><![CDATA[forensics]]></category>
            <category><![CDATA[ctf-writeup]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[ctf]]></category>
            <category><![CDATA[pwnyctf]]></category>
            <dc:creator><![CDATA[lyön]]></dc:creator>
            <pubDate>Wed, 30 Jul 2025 22:45:38 GMT</pubDate>
            <atom:updated>2025-11-28T19:00:14.406Z</atom:updated>
            <content:encoded><![CDATA[<p>Memory Dump — Ram Dump</p><p><strong>Uncovering Flags in Raw Memory</strong></p><p>These two memory dump challenges were a solid reminder that even basic tools like strings, grep, and base64 can go a long way. With a little patience and pattern recognition, you can uncover hidden flags and solve forensics puzzles without needing advanced software.</p><h3>Challenge 1 — Memory Dump 0</h3><blockquote>I got a memory dump from a friend, who mentioned something about Pastebin.</blockquote><h3>Step-by-Step Walkthrough</h3><ol><li><strong>Download the Memory Dump</strong> Start by grabbing the provided .dump file. I saved mine as <strong>MEMORY.DMP.</strong></li><li>Run Strings to Extract Text And Search for the Pastebin Clue</li></ol><pre>strings MEMORY.DMP |grep &quot;Pastebin&quot;</pre><p>That did the trick! A Pastebin URL popped out from the noise.</p><p>3.<strong> Follow the Link</strong> Copy the URL and open it in your browser. Inside was the hidden <strong>flag</strong> for the challenge.</p><p><em>sigpwny{ctrl_c_ctrl_v}</em></p><h3>Challenge 2 — Ram Dump 150</h3><blockquote>“Dumped RAM from a running system. A program left a base64 flag behind…”</blockquote><h4>Steps</h4><ol><li><strong>Download </strong>vmss.core<strong> memory file</strong></li><li><strong>Run </strong>strings<strong> to extract text And Search for base64 strings</strong></li></ol><pre>strings vmss.core | grep -E &#39;[A-Za-z0-9+/=]{20,}&#39;</pre><blockquote>c2lncHdueXtyYW1fZHVtcHNfYXJlX2hhbmR5fQ</blockquote><p>3. Decode base64</p><pre>echo c2lncHdueXtyYW1fZHVtcHNfYXJlX2hhbmR5fQ|base64 -d</pre><blockquote>sigpwny{ram_dumps_are_handy}</blockquote><h3>🏁 Conclusion: Memory Never Lies</h3><p>Two dumps, two flavors of digital sleuthing. From spotting rogue Pastebin links to sniffing out base64 strings tucked deep in RAM, each byte told a story. The lesson? Hidden treasures often lurk in plain text — all it takes is the right grep and a hacker’s instinct. 💻🔎</p><p><strong>Stay curious. Stay relentless. And always string your dumps.</strong> <em>— </em><a href="https://ctf.sigpwny.com/"><em>Pwny </em></a><em>CTF, out.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e1563ff75154" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[picoCTF: DISKO 3]]></title>
            <link>https://medium.com/@ox21.lo/picoctf-disko-3-610466f68f7b?source=rss-dfaf5f3e7d94------2</link>
            <guid isPermaLink="false">https://medium.com/p/610466f68f7b</guid>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[ctf-writeup]]></category>
            <category><![CDATA[picoctf-2025]]></category>
            <category><![CDATA[forensics]]></category>
            <category><![CDATA[picoctf]]></category>
            <dc:creator><![CDATA[lyön]]></dc:creator>
            <pubDate>Wed, 23 Jul 2025 16:00:20 GMT</pubDate>
            <atom:updated>2025-11-28T19:00:35.359Z</atom:updated>
            <content:encoded><![CDATA[<h3>📜 Description</h3><p>Can you find the flag hidden in this disk image? This time, it’s not as plain as it seems!</p><h3>Steps to Solve</h3><p><strong>Step 1</strong>: Download the file and extract it using gzip:</p><pre>gzip -d disko-3.dd.gz</pre><p><strong>Step 2</strong>: Use 7z with the extract option to unpack the disk image:</p><pre>7z x disko-3.dd</pre><p>You’ll find a log file and a compressed file named flag.gz.</p><p><strong>Step 3</strong>: Extract flag.gz using gzip again:</p><pre>gzip -d flag.gz<br>strings flag </pre><blockquote>picoCTF{n3v3r_z1p_2_h1d3_7e0a17da}</blockquote><p>If flag.gz is not immediately visible, don’t worry — it’s likely hidden inside one of the kernel log files.</p><p>Check these files:</p><ul><li>kenral.log.3.gz</li><li>kenral.log.4.gz</li></ul><p>You can extract them with</p><pre>gzip -d kenral.log.3.gz<br>gzip -d kenral.log.4.gz</pre><h3>✅ Conclusion</h3><p>DISKO 3 is all about careful extraction and attention to detail. Whether the flag is in flag.gz or tucked inside a kernel log file, with the right tools and a sharp eye, you&#39;ll find it.</p><p>Keep digging — the flag’s waiting. 🧠💡</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=610466f68f7b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[PicoCTF — Most Cookies]]></title>
            <link>https://medium.com/@ox21.lo/picoctf-most-cookies-e394ccbbeccd?source=rss-dfaf5f3e7d94------2</link>
            <guid isPermaLink="false">https://medium.com/p/e394ccbbeccd</guid>
            <category><![CDATA[web-vulnerabilities]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[picoctf]]></category>
            <category><![CDATA[ctf-writeup]]></category>
            <dc:creator><![CDATA[lyön]]></dc:creator>
            <pubDate>Sat, 19 Jul 2025 12:11:18 GMT</pubDate>
            <atom:updated>2025-11-28T18:46:09.965Z</atom:updated>
            <content:encoded><![CDATA[<h3>PicoCTF — Most Cookies🍪</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/342/1*F-F3SRMrzBrNLb2QnNZDvw.png" /></figure><h3>📝 Challenge Description</h3><blockquote><em>“Alright, enough of using my own encryption. Flask session cookies should be plenty secure!” We’re provided with a </em><em>server.py file and a URL:</em><a href="http://mercury.picoctf.net:53700/">http://mercury.picoctf.net:53700</a></blockquote><p>The goal is to find a way to get the server to give us the flag by manipulating Flask session cookies.</p><h3>Steps to Solve</h3><h4>Step 1: Download and Examine server.py</h4><p>Download the provided Python file. Inside, locate a section that defines possible cookie names (likely in a list or variable like cookie_names)</p><h4>Step 2: Visit the Challenge Site</h4><p>Navigate to the URL given above. There’s a search bar — try entering any of the names listed in cookie_names. If the server identifies your session as:{“very_auth”: “admin”} — you’ll get the flag!</p><h4>Step 3: Use flask-unsign to Manipulate Cookies</h4><p>Install <a href="https://github.com/Paradoxis/Flask-Unsign">Flask-Unsign</a> and run the following commands:</p><ol><li><strong>Discover the correct cookie name using a wordlist:</strong></li></ol><pre>flask-unsign -u --server http://mercury.picoctf.net:53700/ --wordlist cookie.txt</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/985/1*Nxf_1OoJ17JCic95lA-iRg.png" /></figure><p><strong>Create a forged session with admin privileges:</strong></p><pre>flask-unsign -s -c &quot;{&#39;very_auth&#39;: &#39;admin&#39;}&quot; -S &#39;peanut butter&#39;</pre><p>This will generate a base64-encoded session token.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/583/1*T00iES43cYKvdOxrafG1CQ.png" /></figure><h4>Step 4: Swap Out the Session Cookie</h4><p>Take the generated token and replace your browser’s session cookie with it.</p><blockquote><em>💡 Tip: You can use browser tools (like DevTools or an extension) to modify your cookies.</em></blockquote><p>Reload the site — and boom — you’ll see the flag pop up!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/780/1*UWZprA1M7AN6lTua4ax6_A.png" /></figure><h3>Flask Session Cookies — Simply Put</h3><ul><li><strong>What are they?</strong> A way for Flask (a Python web framework) to remember who you are when you visit a website.</li><li><strong>Where are they stored?</strong> In your <strong>browser as a cookie</strong> — just a tiny file that the website uses to store info about you.</li><li><strong>Are they secure?</strong> Yes — but only if the site uses a secret key to “sign” the cookie. That way, users can’t change what’s inside without Flask noticing.</li></ul><h3>🏁 Conclusion</h3><p>In this challenge, we learned how to exploit signed <strong>Flask session cookies</strong> to impersonate an admin user and retrieve the flag. By using the flask-unsign tool, we were able to forge a session with elevated privileges, proving how important it is to secure session management in web applications.</p><p>This type of challenge highlights vulnerabilities that can arise when identity and permissions are verified solely through client-side cookies. It sharpened our reverse engineering and web security skills, and reminded us that even small tokens can unlock big discoveries in cybersecurity.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e394ccbbeccd" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[picoCTF:  DISKO 2]]></title>
            <link>https://medium.com/@ox21.lo/picoctf-disko-2-46ee77fc76a5?source=rss-dfaf5f3e7d94------2</link>
            <guid isPermaLink="false">https://medium.com/p/46ee77fc76a5</guid>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[picoctf-2025]]></category>
            <category><![CDATA[forensics]]></category>
            <category><![CDATA[writeup]]></category>
            <category><![CDATA[ctf-writeup]]></category>
            <dc:creator><![CDATA[lyön]]></dc:creator>
            <pubDate>Fri, 04 Jul 2025 08:49:04 GMT</pubDate>
            <atom:updated>2025-11-28T18:59:47.361Z</atom:updated>
            <content:encoded><![CDATA[<h3>picoCTF: DISKO 2</h3><h3><strong>Challenge Description:</strong></h3><blockquote>Can you find the flag in this disk image? The right one is Linux! One wrong step and it’s all gone!</blockquote><h3>Objective:</h3><p>Analyze the provided disk image and extract the flag hidden within the Linux partition.</p><h3>Step-by-Step Solution:</h3><h4>Step 1: Identify Partitions</h4><p>Use the mmls command to list the partitions in the disk image:</p><pre>mmls disko-2.dd</pre><p>This reveals multiple partitions, including one for Linux and one for Windows. According to the challenge hint, the correct partition is the Linux one.</p><h4>Step 2: Extract the Linux Partition</h4><p>Use the dd command to extract the Linux partition from the disk image. Based on the output from mmls, we use the correct offset and size:</p><pre>dd if=disko-2.dd of=linux.partition.img bs=512 skip=2048 count=51200</pre><ul><li>if= specifies the input file.</li><li>of= specifies the output file.</li><li>bs=512 sets the block size.</li><li>skip=2048 skips the first 2048 blocks (based on the Linux partition&#39;s start).</li><li>count=51200 copies 51200 blocks (based on the partition size).</li></ul><h4>Step 3: Search for the Flag</h4><p>Now that we have the Linux partition extracted, we can search for the flag using strings and grep:</p><pre>strings linux.partition.img | grep pico</pre><p>This command filters out all readable strings and searches for any that contain the keyword pico, which is the prefix for picoCTF flags.</p><h3>🏁 Flag:</h3><p>The flag will appear in the output of the last command.</p><blockquote>picoCTF{4_P4Rt_1t_i5_a93c3ba0}</blockquote><h3>🧾 Conclusion:</h3><p>In this challenge, we analyzed a disk image containing multiple partitions. By identifying the correct Linux partition using mmls, extracting it with dd, and scanning it with strings and grep, we successfully located the hidden flag. This task reinforced key forensic skills such as partition analysis, data carving, and string extraction—essential techniques in CTF and real-world digital forensics.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=46ee77fc76a5" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ 247CTF]]></title>
            <link>https://medium.com/@ox21.lo/247ctf-fcbb8cfbedba?source=rss-dfaf5f3e7d94------2</link>
            <guid isPermaLink="false">https://medium.com/p/fcbb8cfbedba</guid>
            <category><![CDATA[ctf]]></category>
            <category><![CDATA[wireshark]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[247ctf]]></category>
            <category><![CDATA[ctf-writeup]]></category>
            <dc:creator><![CDATA[lyön]]></dc:creator>
            <pubDate>Sun, 22 Jun 2025 03:04:28 GMT</pubDate>
            <atom:updated>2025-11-28T18:49:24.353Z</atom:updated>
            <content:encoded><![CDATA[<h3>247CTF</h3><h4><a href="https://247ctf.com/">Follow the Sequence</a></h4><p><strong>Category: Forensics / Network</strong></p><p><strong>Challenge Description:</strong> &gt; We are trying to improve resource utilisation by spreading data across several subflows. We needed to install a new kernel module, but the speed upgrade is worth it! Can you combine requests and recover the flag?</p><h3><strong>Step 1: Merge the PCAP Files</strong></h3><p>We’re given three .pcap files. Combine them using mergecap:</p><pre>mergecap -w chall4.pcap chall-i1.pcap chall-i2.pcap chall-i3.pcap</pre><p>Now we’ve got a unified capture file to work with.</p><h3>🌐 Step 2: Understanding MPTCP (Multipath TCP)</h3><p><strong>MPTCP</strong> lets one TCP connection travel over multiple paths — like using both Wi-Fi and mobile data at the same time.</p><h3>💡 Why It Rocks:</h3><ul><li><em>Faster downloads</em> with multiple paths</li><li><em>Switch networks seamlessly</em> (e.g. Wi-Fi → 5G)</li><li><em>More resilient connections</em></li></ul><h3>Real-Life Example:</h3><p>You’re on a Zoom call while walking through the city. Your phone is connected to <strong>both Wi-Fi and 5G</strong>:</p><ul><li>Traditional TCP would pick just one connection (say, Wi-Fi).</li><li>If Wi-Fi weakens or disconnects, your call would lag or drop.</li><li>With <strong>MPTCP</strong>, both Wi-Fi and 5G are used at the same time.</li></ul><p><strong>Result</strong>: ✅ Seamless call ✅ Higher speed ✅ Instant network failover without interruption</p><h3>Step 3: Inspect TCP Streams in Wireshark</h3><p>Examine streams 0, 1, and 2:</p><ul><li>Filter: tcp.stream eq N</li><li>You’ll spot HTTP headers with Content-Type: application/zip</li><li>That’s our target — the ZIP file is spread across the subflows.</li></ul><h3>Step 4: Reassemble Data Using Pyshark</h3><p>Create a Python script to extract and combine the payloads:</p><pre>import pyshark  # Used to parse the pcap file at the packet level<br><br># === Configuration ===<br>streams = [0, 1, 2]  # TCP stream indexes we identified in Wireshark<br>pcap_file = &quot;chall4.pcap&quot;  # The merged pcap file<br>final_data = b&#39;&#39;  # A byte buffer to hold the reconstructed file<br><br># === Extraction Loop ===<br>for stream_id in streams:<br>    # Apply a stream-specific filter to read just the relevant TCP packets<br>    cap = pyshark.FileCapture(<br>        pcap_file, <br>        display_filter=f&#39;tcp.stream eq {stream_id}&#39;<br>    )<br><br>    for packet in cap:<br>        try:<br>            # Ensure this packet has TCP payload data<br>            if &#39;TCP&#39; in packet and hasattr(packet.tcp, &#39;payload&#39;):<br>                # Convert payload from hex string (colon-separated) to raw bytes<br>                hex_data = packet.tcp.payload.replace(&#39;:&#39;, &#39;&#39;)<br>                final_data += bytes.fromhex(hex_data)<br>        except AttributeError:<br>            # Some packets might lack payloads—ignore them<br>            continue<br><br>    cap.close()  # Free up resources for the next stream<br><br># === Write the Combined Data ===<br># Once all streams have been parsed, write the result to a binary file<br>with open(&quot;recovered_flag_data.bin&quot;, &quot;wb&quot;) as f:<br>    f.write(final_data)<br><br>print(&quot;[+] Combined data written to recovered_flag_data.bin&quot;)</pre><p>This script merges data from all the streams into one binary file.</p><h3>Step 5: Use Binwalk to Extract Embedded Files</h3><p>Before attempting to unzip the recovered data, we scan it for embedded files using binwalk. This helps locate any hidden ZIP signatures, especially when dealing with malformed archives or appended data.</p><pre>binwalk -eM secret_bundle.zip</pre><p>This command:</p><ul><li>Scans for embedded file headers (like ZIP, PNG, etc.)</li><li>Extracts them automatically into a folder like _secret_bundle.zip.extracted/</li></ul><p>Once extracted, we inspect the results — and find another ZIP archive inside.</p><h3>📂 Step 6: Attempt to Unzip the Archive</h3><p>Now that we’ve isolated a cleaner ZIP from the embedded data, we try to unpack it:</p><pre>unzip recovered_inner.zip</pre><p>However… 😬 the archive is malformed:</p><p>No worries — we salvaged it using <strong>WinRAR’s Repair</strong> tool, then extracted successfully.</p><p><strong>Step</strong>:</p><ul><li>Open in <strong>WinRAR</strong></li><li>Click Repair</li><li>Extract the fixed archive</li></ul><p>Zip repaired, challenge back on track.</p><h3>Step 7: Find the Flag!</h3><p>Inside the repaired archive, we find an image.</p><p>Open it — and there’s the flag embedded right inside!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/1*CUpZZDVs47GDzl4voEEZVw.jpeg" /></figure><h3>Conclusion</h3><p>This challenge was a masterclass in network forensics:</p><ul><li>Merged and analyzed MPTCP subflows</li><li>Explored TCP streams and reassembled raw data</li><li>Extracted and repaired a corrupt archive</li><li>Inspected media to uncover an embedded flag</li></ul><p>It blended protocol knowledge, scripting, byte-level investigation, and lateral thinking — all wrapped up in an elegant cyber treasure hunt. Pure digital archaeology.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fcbb8cfbedba" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[247CTF]]></title>
            <link>https://medium.com/@ox21.lo/247ctf-d579b847c4aa?source=rss-dfaf5f3e7d94------2</link>
            <guid isPermaLink="false">https://medium.com/p/d579b847c4aa</guid>
            <category><![CDATA[ctf]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[wireshark]]></category>
            <category><![CDATA[writeup]]></category>
            <category><![CDATA[247ctf]]></category>
            <dc:creator><![CDATA[lyön]]></dc:creator>
            <pubDate>Sun, 15 Jun 2025 00:00:24 GMT</pubDate>
            <atom:updated>2025-11-28T18:52:22.558Z</atom:updated>
            <content:encoded><![CDATA[<p>Challenge: <strong><em>Not My Modulus</em> 🔐</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/283/1*6pa0PKbWHsAJO1Mk-TN1og.png" /></figure><h3>Introduction</h3><p>n this challenge, we need to decrypt a <strong>packet capture</strong> from our internal network. The data is encrypted with <strong>TLS</strong>, and multiple private keys are available.</p><p>Our mission? <strong>Find the public key and the right key</strong> and unlock the traffic!</p><h3><strong>Step-by-Step Solution</strong></h3><h3>1️⃣ Open the PCAP File</h3><p>Start by loading the .pcap file in <strong>Wireshark</strong> . The capture contains <strong>TCP and TLS</strong> traffic.</p><h3>2️⃣ Locate the “Server Hello” Packet</h3><p>Find the <em>Server Hello</em> packet in the TLS handshake. Look for the <strong>Handshake Protocol: Certificate</strong> section, which contains the <strong>public key</strong>.</p><h3>3️⃣ Extract the Public Key</h3><p>Export the certificate as a .der file from <strong>Wireshark</strong>, then extract its public key modulus using <strong>OpenSSL</strong> :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nsXy40iJgFGAX8Fq1F5lEQ.png" /><figcaption><strong><em>click right </em></strong>on Certificate and saved it as “.der”</figcaption></figure><pre>openssl x509 -inform der -in certic.der -noout -modulus | openssl md5</pre><h3>📝 Command Breakdown</h3><ul><li>🔍 openssl x509 → Works with <strong>X.509 certificates</strong>.</li><li>-inform der → Specifies the <strong>DER format</strong> (binary encoding).</li><li>-in certic.der → Path to the <strong>exported certificate</strong>.</li><li>-noout → Suppresses unnecessary output.</li><li>-modulus → Extracts the <strong>public key modulus</strong>.</li><li>| openssl md5 → Hashes the <strong>modulus</strong> for easy comparison.</li></ul><p>This generates an <strong>MD5 hash</strong> of the modulus, which we’ll use to match against the private keys .</p><h3>X.509 Certificates Explained</h3><p>X.509 certificates play a key role in <strong>TLS encryption</strong>, verifying identities and enabling secure communication .</p><h3>Key Components</h3><ul><li><strong>Issuer</strong> → The trusted organization that issued the certificate.</li><li><strong>Subject</strong> → The entity the certificate belongs to (e.g., a website or server).</li><li><strong>Public Key</strong> → Used for encryption and shared publicly.</li><li><strong>Validity Period</strong> → Defines when the certificate is active.</li><li><strong>Signature</strong> → Cryptographically signed for authenticity.</li></ul><p><strong>These certificates help prevent impersonation attacks 🚫🎭 and keep data secure </strong>.</p><h3>4️⃣ Find the Correct Private Key</h3><p>Now, we need to match our <strong>extracted modulus hash</strong> against the available private keys . We automate this search using:</p><pre>for filename in keys/*; do  <br>    echo &quot;$filename: $(openssl rsa -in &quot;$filename&quot; -noout -modulus | openssl md5)&quot;<br>done | grep &quot;&lt;extracted_hash&gt;&quot;</pre><p>This command iterates through all key files, computes their <strong>modulus hashes</strong>, and searches for a match .</p><p><strong>How do we know it’s RSA?openssl rsa</strong> → This command works specifically with RSA key pairs, helping us extract the modulus of private keys.</p><p><strong>Checking the Certificate</strong> → In Wireshark, look at the <em>Certificate</em> details under the <strong>TLS handshake</strong>. If the public key algorithm is listed as <strong>RSA</strong>, that confirms it’s using RSA encryption.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/689/1*HqETCsPQ4y9Mci5lMifvfg.png" /><figcaption>“Server Hello” Packet</figcaption></figure><h3>5️⃣ Decrypt the TLS Traffic</h3><p>Once we identify the correct <strong>private key</strong>, we decrypt the captured packets using <strong>tshark</strong> :</p><p>tshark -r encrypted.pcap -o “tls.keys_list: &lt;server_ip&gt;,&lt;port&gt;,http,&lt;path_to_private_key&gt;” -z “follow,ssl,ascii,0”</p><pre>tshark -r encrypted.pcap -o &quot;tls.keys_list: 172.17.0.2,8443,http,keys/518dfdb269ef17a932a893a63630644c.key&quot; -z &quot;follow,ssl,ascii,0&quot;</pre><h3>6️⃣ Retrieve the Flag 🏁</h3><p>Now that the traffic is <strong>decrypted</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/623/1*3jpRV0AN-uTYNLoRAO-4Bg.png" /></figure><h3>Conclusion</h3><p>This challenge demonstrates how to <strong>extract public key moduli</strong>, <strong>identify the correct private key</strong>, and <strong>decrypt TLS-encrypted traffic</strong> — a valuable skill in <strong>network security analysis</strong> .</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d579b847c4aa" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[247CTF]]></title>
            <link>https://medium.com/@ox21.lo/247ctf-ceaa2ad26aca?source=rss-dfaf5f3e7d94------2</link>
            <guid isPermaLink="false">https://medium.com/p/ceaa2ad26aca</guid>
            <category><![CDATA[wireshark]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[ctf]]></category>
            <category><![CDATA[ctf-writeup]]></category>
            <category><![CDATA[247ctf]]></category>
            <dc:creator><![CDATA[lyön]]></dc:creator>
            <pubDate>Fri, 13 Jun 2025 20:25:36 GMT</pubDate>
            <atom:updated>2025-11-28T18:54:01.921Z</atom:updated>
            <content:encoded><![CDATA[<h4>Extracting Hidden Flags from ICMP Traffic</h4><h3>🔍 Introduction</h3><p>CTF challenges often push the boundaries of conventional protocols for data exfiltration. One clever method? <strong>Transferring images through ICMP traffic!</strong></p><p>In this post, we’ll break down the <strong>“Error Reporting Protocol”</strong> challenge from <a href="https://247ctf.com/">247CTF</a>, showcasing how <strong>ICMP can be leveraged for covert data transmission</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/283/1*6pa0PKbWHsAJO1Mk-TN1og.png" /></figure><h3>🌐 Understanding ICMP Traffic</h3><p><strong>Internet Control Message Protocol (ICMP)</strong> is primarily used for <strong>network diagnostics and error reporting</strong>, rather than structured data transfer like TCP or UDP. However, since ICMP packets can contain <strong>arbitrary payload data</strong>, they can be <strong>repurposed for unconventional uses</strong>.</p><p>🧐 Why Use ICMP for Data Transfer?</p><ul><li>✅ <strong>Firewall evasion:</strong> ICMP is often allowed, making it useful for bypassing restrictions.</li><li>✅ <strong>Covert communication:</strong> Ideal for stealthy data transfer in security testing.</li><li>✅ <strong>Protocol manipulation:</strong> Demonstrates how <strong>network protocols</strong> can be creatively repurposed.</li></ul><h3>Challenge Breakdown</h3><p><strong>Step 1:</strong> Opening the PCAP File</p><p>The first step was <strong>analyzing the </strong>error_reporting.pcap<strong> file</strong> using Wireshark or Tshark. Since <strong>ICMP lacks structured communication streams</strong>, the usual <strong>&quot;Follow Stream&quot;</strong> method wouldn&#39;t work. Instead, we had to <strong>manually locate hidden data</strong>.</p><p><strong>Step 2</strong>: Searching for Embedded Data</p><p>One common indicator of <strong>hidden image data</strong> inside packet payloads is the <strong>JFIF</strong> marker, a signature of <strong>JPEG files</strong>. Using Wireshark, we searched through raw packet bytes to identify such markers.</p><p><strong>Step 3:</strong> Extracting the Image with Tshark</p><p>Since <strong>ICMP packets don’t support automatic stream tracking</strong>, we manually reconstructed the image using <strong>Tshark</strong>:</p><blockquote>tshark -r error_reporting.pcap -Y “ip.src == 192.168.10.113” -T fields -e data | xxd -r -p &gt; data.jpg</blockquote><p><strong>What this command does:</strong></p><ul><li>Reads the PCAP file (<strong>-r error_reporting.pcap</strong>).</li><li>Filters ICMP packets based on source IP (<strong>-Y &quot;ip.src == 192.168.10.113&quot;</strong>).</li><li>Extracts raw data (<strong>-T fields -e data</strong>).</li><li>Converts hex data into binary (<strong>xxd -r -p &gt; data.jpg</strong>).</li></ul><p>Once extracted, opening data.jpg <strong>revealed the hidden flag!</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/1*0OruRKnhY_BLeG_JlRFKtw.jpeg" /></figure><p><strong>Why Can’t We Use “Follow Stream” on ICMP?</strong></p><p>Wireshark’s <strong>“Follow Stream”</strong> works great for <strong>TCP</strong> because it tracks <strong>structured communication between hosts</strong>. TCP maintains <strong>sessions</strong>, ensuring <strong>sequential data flow</strong>. <strong>ICMP, however, is stateless</strong>:</p><ul><li>Each message is <strong>independent</strong>, with no ongoing data stream.</li><li>ICMP is <strong>used mainly for diagnostics</strong>, like <strong>ping requests</strong>.</li><li>No structured sequencing to allow automatic reassembly.</li></ul><p>Because of this, <strong>ICMP payloads require manual extraction and reconstruction</strong>, rather than relying on built-in tools.</p><h3>🔚 Conclusion</h3><p>This challenge demonstrated how <strong>ICMP packets can be leveraged for covert data transfer</strong>, a technique often used in <strong>security testing and penetration scenarios</strong>. Understanding <strong>such methods helps both attackers and defenders</strong>, reinforcing the importance of <strong>deep packet analysis</strong>.</p><p><strong>Have you explored similar network security challenges? I’d love to hear about them! Drop your thoughts in the comments!</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ceaa2ad26aca" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Pwny CTF]]></title>
            <link>https://medium.com/@ox21.lo/pwny-ctf-314165bc3259?source=rss-dfaf5f3e7d94------2</link>
            <guid isPermaLink="false">https://medium.com/p/314165bc3259</guid>
            <category><![CDATA[ctf]]></category>
            <category><![CDATA[sigpwny]]></category>
            <category><![CDATA[writeup]]></category>
            <category><![CDATA[pwnyctf]]></category>
            <dc:creator><![CDATA[lyön]]></dc:creator>
            <pubDate>Sat, 31 May 2025 11:20:21 GMT</pubDate>
            <atom:updated>2025-11-28T18:59:00.638Z</atom:updated>
            <content:encoded><![CDATA[<h4>Networking Security</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/225/1*gZiteG2yDqTm-KW7nVZ7IA.jpeg" /></figure><h4><strong>Solving Layer 1 &amp; Layer 2 Challenges</strong></h4><p>Hi everyone, welcome to my write-up! Today, I’ll be tackling <strong>Layer 1 &amp; Layer 2</strong> challenges from <a href="https://ctf.sigpwny.com/">PwnyCTF</a>. Let’s dive in and extract those flags!</p><h3><strong>Challenge Layer 1</strong></h3><p>The <strong>Layer 1 Network Challenge</strong> from PwnyCTF invites us to analyze network data and sharpen our hacking skills. This adventure will lead us into the <strong>OSI Model’s Layer 1</strong>, explore packet structures, and uncover a <strong>secret flag hidden in packet 16</strong> of a .pcap file.</p><h4><strong>Understanding Layer 1</strong></h4><p>Layer 1 of the <strong>OSI model</strong> is the <strong>Physical Layer</strong>, responsible for <strong>raw data transmission</strong> through cables, signals, and binary streams 🔄. It involves hardware-level communication but does <strong>not</strong> handle protocols like ARP.</p><h4>Challenge Overview</h4><p>Our mission? <strong>Extract a hidden flag</strong> from <strong>packet number 16</strong> in the .pcap file. The flag follows this format:</p><p>🏴 sigpwny{hex_stream}</p><h4>Step 1: Download the PCAP File</h4><p>The .pcap file contains various network packets</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/755/1*M9cjXKXNS4uegW5yy1z7LQ.png" /><figcaption>our goal is to hunt down <strong>packet 16</strong>.</figcaption></figure><h4>Step 2: Locate Packet 16 in Wireshark</h4><p>Packet 16 contains <strong>Address Resolution Protocol (ARP) data</strong>, which operates at <strong>Layer 2</strong> (not Layer 1). ARP helps resolve <strong>IP addresses to MAC addresses</strong> for local network communication.</p><h4>Step 3: Extract the Flag</h4><p>Follow these steps to retrieve the flag:</p><ol><li><strong>Open</strong> the .pcap file in <strong>Wireshark</strong></li><li><strong>Navigate</strong> to <strong>packet number 16</strong>.</li><li><strong>Go to</strong> the <strong>Packet Bytes</strong> section.</li><li><strong>Right-click</strong> → <strong>Copy as Hex Stream</strong>.</li><li>The copied <strong>hex stream</strong> forms the flag:🏴 sigpwny{005056eab5f8000c299a900d08060001080006040001000c299a900dc0a83880000000000000c0a838fe000000000000000000000000000000000000}</li></ol><p><em>Here, I </em><strong><em>extracted</em></strong><em> the raw hex stream but didn’t fully decode it — meaning I captured the flag without analyzing each byte. Now, onto </em><strong><em>Layer 2</em></strong></p><h3>Challenge Layer 2</h3><p>The <strong>Layer 2 Challenge</strong> builds upon Layer 1 using the <strong>same </strong>.pcap<strong> file</strong>. This time, the flag is <strong>the MAC address requested</strong> by packet <strong>number 16</strong>.</p><h4>🖧What is a MAC Address?</h4><p>A <strong>MAC (Media Access Control) address</strong> is a unique hardware identifier assigned to a <strong>device’s network interface card (NIC)</strong>. It operates at <strong>Layer 2</strong> of the <strong>OSI model</strong>, allowing local network communication.</p><h4>MAC Address Format</h4><ul><li><strong>Structure:</strong> Typically written in <strong>hexadecimal</strong> (e.g., 00:1A:2B:3C:4D:5E).</li><li><strong>Uniqueness:</strong> Each device has a fixed <strong>MAC address</strong>, assigned by the manufacturer.</li><li><strong>Function:</strong> Used by <strong>switches</strong> to efficiently route packets within a network.</li></ul><h4>ARP Requests &amp; MAC Addresses</h4><p>When a device wants to communicate, it uses <strong>ARP requests</strong> to ask: <em>“Who has this IP address? Tell me your MAC address!”</em></p><p>The flag is the <strong>MAC address requested by Packet 16</strong>. Let’s extract it!</p><h4>Step-by-Step Guide to Extract the MAC Address Flag</h4><p><strong>1️⃣same file on Layer1</strong></p><p>2️⃣ <strong>Locate</strong> <strong>packet number 16</strong>.</p><p>3️⃣ <strong>Extract</strong> the <strong>requested MAC address</strong>:</p><ul><li><strong>Go to</strong> the <strong>ARP section</strong> in Packet Details.</li><li><strong>Find</strong> the <strong>Destination MAC Address</strong> requested.</li><li><strong>Copy it</strong> — this is your flag!</li></ul><h3>Conclusion</h3><p>This challenge demonstrated the process of <strong>extracting raw network data</strong> without decoding it. At <strong>Layer 1</strong>, we <strong>captured</strong> the raw hex stream from packet data, while at <strong>Layer 2</strong>, we <strong>retrieved the requested MAC address from an ARP packet</strong>.</p><p>By working through these challenges, we strengthened our skills in <strong>packet analysis</strong>, <strong>Wireshark usage</strong>, and understanding <strong>network protocols</strong>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=314165bc3259" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>