<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>PatriotCTF&#39;23 on 404Unfound</title>
    <link>https://404unfound.com/ctfs/patriotctf23/</link>
    <description>Recent content in PatriotCTF&#39;23 on 404Unfound</description>
    <generator>Hugo -- gohugo.io</generator>
    <language>en-us</language>
    <lastBuildDate>Thu, 14 Sep 2023 23:00:02 +0800</lastBuildDate><atom:link href="https://404unfound.com/ctfs/patriotctf23/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>[PatriotCTF&#39;23] WPA</title>
      <link>https://404unfound.com/writeups/patriotctf_23/wpa/</link>
      <pubDate>Thu, 14 Sep 2023 23:00:02 +0800</pubDate>
      
      <guid>https://404unfound.com/writeups/patriotctf_23/wpa/</guid>
      <description>&lt;h2 id=&#34;patriot-ctf-wpa&#34;&gt;Patriot CTF: WPA&lt;/h2&gt;
&lt;p&gt;This was an easy wifi hacking challenge which required the use of a dictionary attack to find out the password of a wifi password. The challenge pcap file can be found &lt;a href=&#34;savedcap.cap&#34;&gt;here&lt;/a&gt;&lt;/p&gt;
&lt;h2 id=&#34;the-challenge&#34;&gt;The Challenge&lt;/h2&gt;
&lt;pre&gt;&lt;code class=&#34;language-md&#34;&gt;I really need to get on my friends WiFi, but he won&#39;t give me the password. I think he thinks I&#39;ll mess around on his network. I started a packet capture and left it running a while, I think someone connected to the network before I stopped the capture. Can you help me?
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Looking at the pcap file, there were 888 packets with the 802.11 protocol, which is the WLAN protocol.
&lt;img src=&#34;wireshark.png&#34; alt=&#34;wireshark&#34;&gt;&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>[PatriotCTF&#39;23] ReReCaptcha</title>
      <link>https://404unfound.com/writeups/patriotctf_23/rerecaptcha/</link>
      <pubDate>Tue, 12 Sep 2023 21:29:34 +0800</pubDate>
      
      <guid>https://404unfound.com/writeups/patriotctf_23/rerecaptcha/</guid>
      <description>&lt;h2 id=&#34;patriot-ctf-rerecaptcha&#34;&gt;Patriot CTF: ReReCaptcha&lt;/h2&gt;
&lt;p&gt;This was an RSA challenge which required the use of OCR (Optical character recognition - converting an image of text into text format).&lt;/p&gt;
&lt;h2 id=&#34;the-challenge&#34;&gt;The Challenge&lt;/h2&gt;
&lt;p&gt;The challenge had a zip file containing four images:&lt;/p&gt;
&lt;p&gt;CT.png:&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;CT.png&#34; alt=&#34;CT&#34;&gt;&lt;/p&gt;
&lt;p&gt;E.png:&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;E.png&#34; alt=&#34;E&#34;&gt;&lt;/p&gt;
&lt;p&gt;P.png:&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;P.png&#34; alt=&#34;P&#34;&gt;&lt;/p&gt;
&lt;p&gt;Q.png:&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;Q.png&#34; alt=&#34;Q&#34;&gt;&lt;/p&gt;
&lt;p&gt;In RSA (and here),&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;CT&lt;/code&gt; - Ciphertext / Encrypted Message&lt;/li&gt;
&lt;li&gt;&lt;code&gt;E&lt;/code&gt; - Public Exponent (Part of Public Key) that is relatively prime (share no common factors other than 1) to the product of &lt;code&gt;P-1&lt;/code&gt; and &lt;code&gt;Q-1&lt;/code&gt; which is represented by &lt;code&gt;phi&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;P&lt;/code&gt; and &lt;code&gt;Q&lt;/code&gt; - (Part of private key) Distinct, large prime numbers used in the generation of the RSA key pair.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;retrieving-values&#34;&gt;Retrieving Values&lt;/h2&gt;
&lt;p&gt;To retrieve the values from the image, what we had to do was to use OCR to get the values from the image. I used a free &lt;a href=&#34;https://www.onlineocr.net/&#34;&gt;OCR&lt;/a&gt; tool and uploaded the files.&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>[PatriotCTF&#39;23] Bookshelf</title>
      <link>https://404unfound.com/writeups/patriotctf_23/bookshelf/</link>
      <pubDate>Tue, 12 Sep 2023 19:52:02 +0800</pubDate>
      
      <guid>https://404unfound.com/writeups/patriotctf_23/bookshelf/</guid>
      <description>&lt;h1 id=&#34;bookshelf&#34;&gt;Bookshelf&lt;/h1&gt;
&lt;p&gt;This pwn challenge involved the use of &lt;a href=&#34;https://en.wikipedia.org/wiki/Return-oriented_programming&#34;&gt;return-oriented programming&lt;/a&gt; to call &lt;code&gt;system&lt;/code&gt; and spawn a shell.&lt;/p&gt;
&lt;h2 id=&#34;description&#34;&gt;Description&lt;/h2&gt;
&lt;blockquote&gt;
&lt;p&gt;Just finished up my project based around books! Hope you enjoy reading&amp;hellip;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;You can download the binary &lt;a href=&#34;bookshelf&#34;&gt;here&lt;/a&gt; and the corresponding libc &lt;a href=&#34;libc.so.6&#34;&gt;here&lt;/a&gt;.&lt;/p&gt;
&lt;hr&gt;
&lt;h2 id=&#34;part-i-getting-the-address-of-puts&#34;&gt;Part I: Getting the address of puts&lt;/h2&gt;
&lt;p&gt;When we connect to the server, we see that there are multiple options to choose from. Lets take a look at option 2.&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;main_menu.png&#34; alt=&#34;main menu&#34;&gt;&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>[PatriotCTF&#39;23] Flower Shop</title>
      <link>https://404unfound.com/writeups/patriotctf_23/flower-shop/</link>
      <pubDate>Tue, 12 Sep 2023 12:15:01 +0800</pubDate>
      
      <guid>https://404unfound.com/writeups/patriotctf_23/flower-shop/</guid>
      <description>&lt;h1 id=&#34;flower-shop&#34;&gt;Flower Shop&lt;/h1&gt;
&lt;p&gt;This web challenge involves exploiting a &lt;code&gt;exec&lt;/code&gt; statement in a vulnerable PHP script. Apparently this solution was unintended, but it made the challenge a whole lot easier as the intended solution was almost impossible to solve.&lt;/p&gt;
&lt;h2 id=&#34;description&#34;&gt;Description&lt;/h2&gt;
&lt;blockquote&gt;
&lt;p&gt;Flowers!&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;The files for this challenge can be found &lt;a href=&#34;FlowerShop.zip&#34;&gt;here&lt;/a&gt;.&lt;/p&gt;
&lt;hr&gt;
&lt;h2 id=&#34;overview&#34;&gt;Overview&lt;/h2&gt;
&lt;p&gt;&lt;img src=&#34;flower-shop.png&#34; alt=&#34;flower shop page&#34;&gt;&lt;/p&gt;
&lt;p&gt;Upon visiting the site, we see that there are fields to sign up, login, and reset one&amp;rsquo;s password. The login and signup functionalities seem to function normally and do not seem vulnerable to SQL injections. However, when looking through the source for password reset, I came across an &lt;code&gt;exec&lt;/code&gt; statement.&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>[PatriotCTF&#39;23] Printshop</title>
      <link>https://404unfound.com/writeups/patriotctf_23/printshop/</link>
      <pubDate>Mon, 11 Sep 2023 15:37:38 +0800</pubDate>
      
      <guid>https://404unfound.com/writeups/patriotctf_23/printshop/</guid>
      <description>&lt;h1 id=&#34;printshop&#34;&gt;Printshop&lt;/h1&gt;
&lt;p&gt;This pwn challenge involved exploiting a &lt;code&gt;printf&lt;/code&gt; format string vulnerability to overwrite the &lt;code&gt;exit&lt;/code&gt; function in the &lt;code&gt;GOT&lt;/code&gt; table to point to the &lt;code&gt;win&lt;/code&gt; function, which prints the flag.&lt;/p&gt;
&lt;h2 id=&#34;description&#34;&gt;Description&lt;/h2&gt;
&lt;blockquote&gt;
&lt;p&gt;That print shop down the road is useless, can you make it do something interesting?&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;You can get the challenge file &lt;a href=&#34;printshop&#34;&gt;here&lt;/a&gt;.&lt;/p&gt;
&lt;hr&gt;
&lt;h2 id=&#34;overview&#34;&gt;Overview&lt;/h2&gt;
&lt;p&gt;Upon dumping the binary into a disassembler (in my case I use Binary Ninja), we see that there are 2 functions, &lt;code&gt;main&lt;/code&gt; and &lt;code&gt;win&lt;/code&gt;. However, &lt;code&gt;main&lt;/code&gt; does not ever call &lt;code&gt;win&lt;/code&gt; which means that we somehow have to control the instruction pointer to jump to the address of &lt;code&gt;win&lt;/code&gt;.&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>[PatriotCTF&#39;23] Breakfast club</title>
      <link>https://404unfound.com/writeups/patriotctf_23/breakfast-club/</link>
      <pubDate>Mon, 11 Sep 2023 13:49:34 +0800</pubDate>
      
      <guid>https://404unfound.com/writeups/patriotctf_23/breakfast-club/</guid>
      <description>&lt;h2 id=&#34;patriot-ctf-breakfast-club&#34;&gt;Patriot CTF: Breakfast club&lt;/h2&gt;
&lt;p&gt;This was a cryptography challenge focused on hash cracking. The challenge involved various hashing algorithms, and each character in the flag was hashed using a different algorithm. The objective was to crack the hash for each algorithm to retrieve the flag.&lt;/p&gt;
&lt;h2 id=&#34;the-challenge&#34;&gt;The Challenge&lt;/h2&gt;
&lt;pre&gt;&lt;code&gt;As the sysadmin for your college, you&#39;re responsible for overseeing the security of all the clubs. One of the on campus orginizations is a breakfast club with their own personal website that the leader assured you was &amp;quot;unhackable&amp;quot;. He was so sure of this, that he sent you an example of how hashes are stored in the database, something about &amp;quot;changing the hash type multiple times for each password&amp;quot; or something like that. Can you crack the password and prove him wrong?
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Text file:&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>[PatriotCTF’23] My phone!</title>
      <link>https://404unfound.com/writeups/patriotctf_23/my-phone/</link>
      <pubDate>Mon, 11 Sep 2023 13:44:46 +0800</pubDate>
      
      <guid>https://404unfound.com/writeups/patriotctf_23/my-phone/</guid>
      <description>&lt;h2 id=&#34;patriot-ctf-my-phone&#34;&gt;Patriot CTF: My phone!&lt;/h2&gt;
&lt;p&gt;This was a simple Crypto challenge where we had to figure out the location of a phone thief, that was encrypted by a odd cipher.&lt;/p&gt;
&lt;h2 id=&#34;the-challenge&#34;&gt;The Challenge&lt;/h2&gt;
&lt;pre&gt;&lt;code&gt;Some weird triangle man stole my phone, he taunted me by sending me his location but it seems to be encrypted with some odd cipher I&#39;ve never seen before, could you please help me get my phone back?
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&#34;challenge.jpg&#34; alt=&#34;challenge&#34;&gt;&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>[PatriotCTF&#39;23] Pick Your Starter</title>
      <link>https://404unfound.com/writeups/patriotctf_23/pick-your-starter/</link>
      <pubDate>Mon, 11 Sep 2023 10:50:04 +0800</pubDate>
      
      <guid>https://404unfound.com/writeups/patriotctf_23/pick-your-starter/</guid>
      <description>&lt;h1 id=&#34;pick-your-starter&#34;&gt;Pick Your Starter&lt;/h1&gt;
&lt;p&gt;This was a web challenge that involves the use of exploiting Jinja2 SSTI and navigating around filters to gain remote code execution to read the flag.&lt;/p&gt;
&lt;h2 id=&#34;description&#34;&gt;Description&lt;/h2&gt;
&lt;blockquote&gt;
&lt;p&gt;Picking a starter is hard, I hope you can do it.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;hr&gt;
&lt;h2 id=&#34;overview&#34;&gt;Overview&lt;/h2&gt;
&lt;p&gt;When we go to the site, we are greeted with pictures of the 3 starter pokemons, and when we click on them, we are redirected to &lt;code&gt;/{pokemon name}&lt;/code&gt;.&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>[PatriotCTF&#39;23] Guessinggame</title>
      <link>https://404unfound.com/writeups/patriotctf_23/guessinggame/</link>
      <pubDate>Mon, 11 Sep 2023 10:03:06 +0800</pubDate>
      
      <guid>https://404unfound.com/writeups/patriotctf_23/guessinggame/</guid>
      <description>&lt;h1 id=&#34;guessing-game&#34;&gt;Guessing Game&lt;/h1&gt;
&lt;h2 id=&#34;description&#34;&gt;Description&lt;/h2&gt;
&lt;blockquote&gt;
&lt;p&gt;No one seems to be able to guess my favorite animal&amp;hellip; Can you?&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;You can download the source file &lt;a href=&#34;guessinggame&#34;&gt;here&lt;/a&gt;&lt;/p&gt;
&lt;h2 id=&#34;decompilation&#34;&gt;Decompilation&lt;/h2&gt;
&lt;p&gt;First, let&amp;rsquo;s disassemble the file and have a look inside.&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;disassembly.png&#34; alt=&#34;guessing game disassembly&#34;&gt;&lt;/p&gt;
&lt;p&gt;At first glance, it seems like the correct answer is &lt;code&gt;Giraffe&lt;/code&gt;. However, if we continue reading, we see that no matter what input we give, it will always reject our input 😢&lt;/p&gt;
&lt;h2 id=&#34;solution&#34;&gt;Solution&lt;/h2&gt;
&lt;p&gt;In the decompilation output above, we can see that the program is using &lt;code&gt;gets&lt;/code&gt; to retrieve user input. &lt;code&gt;gets&lt;/code&gt; may vulnerable to a buffer overflow attack as it does not perform any sort of bounds checking, allowing us to write beyond the memory we are allocated.&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>[PatriotCTF&#39;23] Rouge Access Point</title>
      <link>https://404unfound.com/writeups/patriotctf_23/rouge-access-point/</link>
      <pubDate>Sun, 10 Sep 2023 17:30:34 +0800</pubDate>
      
      <guid>https://404unfound.com/writeups/patriotctf_23/rouge-access-point/</guid>
      <description>&lt;h2 id=&#34;patriot-ctf-rouge-access-point&#34;&gt;Patriot CTF: Rouge Access Point&lt;/h2&gt;
&lt;p&gt;This was an OSINT challenge where we had to find the SSID of an access point, given the BSSID.&lt;/p&gt;
&lt;h2 id=&#34;the-challenge&#34;&gt;The Challenge&lt;/h2&gt;
&lt;pre&gt;&lt;code&gt;We&#39;ve received a notice from our companies EDR software that a laptop was attacked while they were on WFH. The employee says they were at home when it happened, but we suspect they were using public wifi. Our EDR software managed to capture the BSSID of the wifi (46:D1:FA:63:BC:66) network before it got disconnected, but not the SSID. Can you still find the network they were connected to?
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;From here, we have one important piece of information, which was the BSSID of the wifi &lt;code&gt;46:D1:FA:63:BC:66&lt;/code&gt;.&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>[PatriotCTF&#39;23] Unsupported Format</title>
      <link>https://404unfound.com/writeups/patriotctf_23/unsupported-format/</link>
      <pubDate>Sun, 10 Sep 2023 17:12:34 +0800</pubDate>
      
      <guid>https://404unfound.com/writeups/patriotctf_23/unsupported-format/</guid>
      <description>&lt;h2 id=&#34;patriot-ctf-unsupported-format&#34;&gt;Patriot CTF: Unsupported Format&lt;/h2&gt;
&lt;p&gt;This was an image fixing forensics challenge, where they gave a corrupted image file. The point was to fix the image and retrieve the flag.&lt;/p&gt;
&lt;h2 id=&#34;the-challenge&#34;&gt;The Challenge&lt;/h2&gt;
&lt;pre&gt;&lt;code&gt;My friend sent me a picture of his brand new computer, but something strange happened to it and now it says &amp;quot;Unsupported Format&amp;quot; when I try to open it. Can you try to help me recover the image?
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Trying to open the attached challenge image file would result in something like this:&lt;/p&gt;</description>
    </item>
    
  </channel>
</rss>