<?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 Ron Stoner on Medium]]></title>
        <description><![CDATA[Stories by Ron Stoner on Medium]]></description>
        <link>https://medium.com/@forwardsecrecy?source=rss-2417201225d7------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*p7PlAs0xASZkzbn2PlciAg.png</url>
            <title>Stories by Ron Stoner on Medium</title>
            <link>https://medium.com/@forwardsecrecy?source=rss-2417201225d7------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 09 Jun 2026 03:39:05 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@forwardsecrecy/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[#kksctf open 2019 — Postman]]></title>
            <link>https://medium.com/@forwardsecrecy/kksctf-open-2019-postman-837b6968d1b7?source=rss-2417201225d7------2</link>
            <guid isPermaLink="false">https://medium.com/p/837b6968d1b7</guid>
            <category><![CDATA[hacking]]></category>
            <category><![CDATA[security]]></category>
            <category><![CDATA[infosec]]></category>
            <category><![CDATA[ctf]]></category>
            <category><![CDATA[ctf-writeup]]></category>
            <dc:creator><![CDATA[Ron Stoner]]></dc:creator>
            <pubDate>Sun, 29 Dec 2019 19:35:38 GMT</pubDate>
            <atom:updated>2019-12-29T19:35:38.683Z</atom:updated>
            <content:encoded><![CDATA[<h3>#kksctf open 2019 — Postman</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/605/1*oFRt2vQe2fu79aGbi9q0jA.png" /></figure><h3>The Challenge</h3><blockquote>Hey, some kaсkers steal my mail. Can you help return and deliver it?</blockquote><p>The Postman challenge provides us with a remote website and port. Navigating to the site shows us only a single line of text asking us to help the user retrieve their email.</p><h3>The Solution</h3><p>Let’s help the user get their mail! Trying things like a mail. sub-domain unfortunately did not work. We will have to go back to basics. Checking the <strong>robots.txt</strong> file gives us an unlisted URL to check.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/407/1*YU5O1W8uU0IEs9SEnNtCGA.png" /><figcaption>robots.txt</figcaption></figure><p>We find the <strong>/postbox</strong> URL and navigate to it, but immediately get shut down due to an incorrect HTTP call.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/426/1*e7SCk6EV8UcLW-kGIsxCCA.png" /><figcaption>Denied</figcaption></figure><p>“Method Not Allowed” indicates that we made an incorrect type of request to the web server. By default, this call is a <strong>GET</strong> request. We can either change the request type using proxies or extensions in our browser, or we can use <strong>curl</strong> and send a <strong>POST </strong>request. While <strong>GET</strong> makes a call to retrieve information from a website, <strong>POST</strong> sends data (such as logging into a mailbox service!).</p><blockquote>curl -X POST <a href="http://tasks.open.kksctf.ru:8001/postbox">http://tasks.open.kksctf.ru:8001/postbox</a></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/351/1*frTyyfA_7bQAzPQ3Bd7NSw.png" /><figcaption>The final flag</figcaption></figure><p>The request is processed and the final flag is returned to us. Our user is now happy that they have their mail, and we are happy that this challenge is solved.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=837b6968d1b7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[#kksctf open 2019 — Xmas Tree]]></title>
            <link>https://medium.com/@forwardsecrecy/kksctf-open-2019-xmas-tree-a61538fe5e70?source=rss-2417201225d7------2</link>
            <guid isPermaLink="false">https://medium.com/p/a61538fe5e70</guid>
            <category><![CDATA[infosec]]></category>
            <category><![CDATA[ctf]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[hacking]]></category>
            <category><![CDATA[ctf-writeup]]></category>
            <dc:creator><![CDATA[Ron Stoner]]></dc:creator>
            <pubDate>Sun, 29 Dec 2019 19:25:12 GMT</pubDate>
            <atom:updated>2019-12-29T19:25:12.407Z</atom:updated>
            <content:encoded><![CDATA[<h3>#kksctf open 2019 — Xmas Tree</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MuK8_pkbWJ6IKV6RBivkOA.jpeg" /></figure><h3>The Challenge</h3><blockquote>Do you like to decorate the Christmas tree?</blockquote><p>This challenge was listed as “Misc”, and no other hints were provided.</p><h3>The Solution</h3><p>This was an easy challenge, as the answer was literally staring participants in the face during the entire CTF. Navigating to the kksctf web page showed a variety of Christmas themes, including a neat <strong>ASCII</strong> Christmas tree.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/441/1*UvaTSqSaJ-61cl7EmFpivg.png" /><figcaption>ASCII Art!</figcaption></figure><p>The above tree <strong>ASCII</strong> art shows a few different pieces of text in different colors. If we look in the HTML source, we can see the <strong>&lt;span&gt;</strong> tags which indicate a color change for certain pieces of text.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/870/1*tqbqgwAlOSChtwGXwH2Ulg.png" /><figcaption>It looks sweet in HTML too!</figcaption></figure><p>Combining the 7 pieces of colored text results in the final flag of <strong>kks{n3w_y34r_m@dn3$$}</strong>. Happy New Year!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a61538fe5e70" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[#kksctf open 2019 — Stego Warmup]]></title>
            <link>https://medium.com/@forwardsecrecy/kksctf-open-2019-stego-warmup-87898a18f9fd?source=rss-2417201225d7------2</link>
            <guid isPermaLink="false">https://medium.com/p/87898a18f9fd</guid>
            <category><![CDATA[ctf-writeup]]></category>
            <category><![CDATA[hacking]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[infosec]]></category>
            <category><![CDATA[ctf]]></category>
            <dc:creator><![CDATA[Ron Stoner]]></dc:creator>
            <pubDate>Sun, 29 Dec 2019 19:14:33 GMT</pubDate>
            <atom:updated>2019-12-29T19:14:33.362Z</atom:updated>
            <content:encoded><![CDATA[<h3>#kksctf open 2019 — Stego Warmup</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/622/1*1mWChuZbCKOtnXFq5_A7kg.jpeg" /></figure><h3>The Challenge</h3><blockquote>We get some file. Can you find secret?</blockquote><p>We are provided the above file of Shaq gracefully obfuscating himself behind a tree. No other clues or hints are provided.</p><h3>The Solution</h3><p>This was an extremely easy steganography challenge. The flag we are looking for is embedded inside the image data. We can extract the <strong>EXIF</strong> metadata from the image using <strong>exiftool</strong>, revealing the final flag.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/494/1*4QMDWgZMOs38BhXuPd1AbQ.png" /><figcaption>Solved!</figcaption></figure><p>We can see in the above image that the flag was in the <strong>Author</strong> field in clear text. On to the next challenge!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=87898a18f9fd" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[#kksctf open 2019 — Red XOXOXO]]></title>
            <link>https://medium.com/@forwardsecrecy/kksctf-open-2019-red-xoxoxo-df2b1fe454f2?source=rss-2417201225d7------2</link>
            <guid isPermaLink="false">https://medium.com/p/df2b1fe454f2</guid>
            <category><![CDATA[ctf]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[ctf-writeup]]></category>
            <category><![CDATA[hacking]]></category>
            <category><![CDATA[infosec]]></category>
            <dc:creator><![CDATA[Ron Stoner]]></dc:creator>
            <pubDate>Sun, 29 Dec 2019 19:06:27 GMT</pubDate>
            <atom:updated>2019-12-29T19:08:36.227Z</atom:updated>
            <content:encoded><![CDATA[<h3>#kksctf open 2019 — Red XOXOXO</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*D-utnHa5XIelU-b76t_A-g.jpeg" /></figure><h3>The Challenge</h3><p>We receive a message that is captured, and since this challenge is listed as “crypto”, we need to decipher the cipher text of<em> -*;91~.,1*1=12~;-*?&lt;27–6;:r~+-;~=27;0*~*1~=100;=*p~7y3~)?7*709~81,~+,~,;.2&#39;p~55-%?**j=5.?*.:j)0#</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/447/1*tZL91dB62b7Jg_SeVc-6xw.png" /><figcaption>Our challenge information</figcaption></figure><h3>The Solution</h3><p>The above cipher text has a variety of characters in it. Due to this, we can greatly reduce the type of encryption being used. Our hint also gives us a pointer in the right direction with the <strong>XOXOXO </strong>(XOR) in the title.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/445/1*r9VYUQ8Iy6DF3C72H8lrDw.png" /><figcaption>Brute forcing the key space</figcaption></figure><p>When attempting a variety of ciphers, a <strong>XOR</strong> brute force attack is attempted.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/321/1*RmzSTDk48cYsg3x-wb14eg.png" /><figcaption>Finding a possible key</figcaption></figure><p>Our brute force attack has found a possible key and provided us with positive confirmation in the form of clear text. Unfortunately, this is not the correct flag, as this tool and key combination do not give us correct output. Using another tool, we can brute force the key space and find the correct key.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/683/1*thrbER_5n84iOXZHlOEAog.png" /><figcaption>Finding the flag for the win</figcaption></figure><p>The key of 5e is found and the string is decrypted, revealing to us the final flag.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=df2b1fe454f2" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[OverTheWire Advent Bonanza 2019 — Challenge Zero]]></title>
            <link>https://medium.com/@forwardsecrecy/overthewire-advent-bonanza-2019-challenge-zero-daec71e7b3b8?source=rss-2417201225d7------2</link>
            <guid isPermaLink="false">https://medium.com/p/daec71e7b3b8</guid>
            <category><![CDATA[information-security]]></category>
            <category><![CDATA[hacking]]></category>
            <category><![CDATA[security]]></category>
            <category><![CDATA[ctf-writeup]]></category>
            <category><![CDATA[ctf]]></category>
            <dc:creator><![CDATA[Ron Stoner]]></dc:creator>
            <pubDate>Fri, 27 Dec 2019 08:16:58 GMT</pubDate>
            <atom:updated>2019-12-27T08:21:47.459Z</atom:updated>
            <content:encoded><![CDATA[<h3>OverTheWire Advent Bonanza 2019 — Challenge Zero</h3><p>This write up is part of a bigger Capture The Flag competition. You can see other challenge write ups on the main post <a href="https://medium.com/@forwardsecrecy/overthewire-advent-bonanza-2019-capture-the-flag-competition-66c50671c641">here</a>.</p><p>Prior to the start of OverTheWire Advent Bonanza 2019, the creators released a “Challenge Zero” for teams to work on. The challenge was located at <a href="https://advent2019.overthewire.org/challenge-zero">https://advent2019.overthewire.org/challenge-zero</a>, which showed a web page with an animated GIF of fire burning with the following message:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/400/1*5fXFSfkeQVkqNjiW2mVvTA.gif" /></figure><pre>Fox! Fox! Burning bright! In the forests of the night!<br><br>Hint: $ break *0x7c00</pre><p>The above hint refers to the command line of <strong>gdb</strong>, a linux debugger. At this point though, we have nothing to break so we need to keep looking. In the spirit of Capture The Flag competitions, my team and I tried viewing the web page and GIF in different ways. Using the text based browser <strong>links</strong> leads us to our next clue.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/551/1*8UX9wipYt9JvC0UuvVTajA.png" /></figure><p>The line “D0NT PU5H M3 C0Z 1M C1053 TO T3H 3DG3” is l33tspeak for a song lyric from <em>The Message</em> by <strong>GrandMaster Flash</strong>.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FPobrSpMwKk4%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DPobrSpMwKk4&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FPobrSpMwKk4%2Fhqdefault.jpg&amp;type=text%2Fhtml&amp;schema=youtube" width="640" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/856e05837a79a6aad6b4d59b3f805115/href">https://medium.com/media/856e05837a79a6aad6b4d59b3f805115/href</a></iframe><p>The next lyric in the song “I’m trying not to lose my <strong>HEAD” </strong>clues us in that we need to make a <strong>HEAD </strong>web request. We can use <strong>curl</strong> and the command line to easily do this.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/628/1*glBiQV_XktZHwXQFotHsmg.gif" /><figcaption>Animated Texty Goodness</figcaption></figure><p>We can see in the above image that the flames are made up of random text characters to achieve the animation effect. The other hint we saw above was “If only the flames wouldn’t move so much” which alludes to the fact that the image is an animation made up of multiple frames. Since we are using <strong>curl</strong> on the command line, we can scroll back through our console buffer and see each frame of text making up the animation. I noticed that the string of text ended in “==”, which signifies <strong>base64 </strong>encoding.<strong> </strong>By compiling all the text and removing padding characters (# in this case), we get a completed <strong>base64</strong> string.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/995/1*ZExMnIz3uub3zek9u632pA.png" /><figcaption>Base64 decoding the string resulting in a new uuencoded file to play with</figcaption></figure><p>The output above is uuencoded and can be decoded using the xxd tool. Once decoded, we have a boot.bin file. To my surprise, the <strong>base64</strong> string did not contain the flag itself, but rather a bootable virtual machine image.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/954/1*Rid9lSRDA8e81J_vzWtl7Q.png" /><figcaption>Confirming the file type of boot.bin</figcaption></figure><p>Taking the binary boot file and loading it into a virtualization hypervisor resulted in the following:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/434/1*tCnOxFvVvdRPzWO7uQmGzg.png" /></figure><p>Aha! We have a binary that is loaded and referencing last year’s CTF challenge using the <strong>RC4</strong> stream cipher. It seems we need to break this binary as well. Thankfully, the linux command line debugging tool <strong>gdb </strong>can connect to remotely running binaries for remote debugging purposes. Our original hint of <em>break *0x7c00</em> finally comes into play. We can now load up <strong>gdb</strong>, set the proper breakpoint, and start attacking the binary.</p><p>Using <strong>gdb</strong> allows us to dump the Intel formatted assembly code so we can get a better understand of what is going on.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/478/1*ZocSjgylPVnt-n5jO2wc2Q.png" /><figcaption>A sampling of the dumped code</figcaption></figure><p>We can see from the code that we are performing some <strong>AES</strong> encryption functions of data in the registers. I also noticed that there was a condition to check if the input was 16 characters or not. If it wasn’t, a different jump and code routine was executed. When a password of 16 characters is used, a new jump is taken which performs some XOR operations on the code and various registers.</p><p>The program ultimately takes the users input and stores it into <strong>xmm3</strong>. The instruction at <strong>0x7c62: movaps xmm0,XMMWORD PTR [rsi]</strong> moves the AES encryption key into <strong>xmm0</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/639/1*oRZ_w71dw5TiZb7pL9RrSg.png" /><figcaption>Storing the user input into xmm3</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/650/1*74j04SrTedlskgpQAdDQaQ.png" /><figcaption>The key is loaded into xmm0</figcaption></figure><p>The data in <strong>xmm3</strong> then gets XOR’d against a static address which contains hard coded cipher text to see if it matches. If it does, we get the flag. If it does not, the program cleans up the registers and prompts the user again for a password. When we check the debug output we can find the hard coded location and it’s data.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/540/1*dHDZ0-1_3VTRJxEu7wc0bg.png" /><figcaption>The location of the hard coded cipher text</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/538/1*YgGmIC5I2iqGTf4ihAjcwg.png" /><figcaption>The cipher text contents in little endian format</figcaption></figure><p>Taking both the cipher text and key allows us to perform an AES decryption which reveals the password we need — <strong>MiLiT4RyGr4d3MbR</strong>.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/182ce4e897e6edd66854fcf2ae4ea717/href">https://medium.com/media/182ce4e897e6edd66854fcf2ae4ea717/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/352/1*tTmrmNJ_i9xvRmkzxZ1iyg.png" /><figcaption>Running the script and decrypting the password</figcaption></figure><p>At this point we can input the password into the virtual machine, pass the check, and receive the final flag. We went from an animated gif, to base64 text, to a uuencoded boot image, to a binary that needed to be remotely debugged. What a challenge!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/489/1*Gt9cUDLfkhy7zYfEnIAO9A.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=daec71e7b3b8" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[OverTheWire Advent Bonanza 2019 — Sudo Sudoku]]></title>
            <link>https://medium.com/@forwardsecrecy/overthewire-advent-bonanza-2019-sudo-sudoku-44aa41c24a81?source=rss-2417201225d7------2</link>
            <guid isPermaLink="false">https://medium.com/p/44aa41c24a81</guid>
            <category><![CDATA[ctf-writeup]]></category>
            <category><![CDATA[infosec]]></category>
            <category><![CDATA[ctf]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[hacking]]></category>
            <dc:creator><![CDATA[Ron Stoner]]></dc:creator>
            <pubDate>Fri, 27 Dec 2019 05:41:06 GMT</pubDate>
            <atom:updated>2019-12-27T16:54:25.689Z</atom:updated>
            <content:encoded><![CDATA[<h3>OverTheWire Advent Bonanza 2019 — Sudo Sudoku</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_vpzO6M-uTikvYBxVk45Dg.jpeg" /></figure><p>This write up is part of a bigger Capture The Flag competition. You can see other challenge write ups on the main post <a href="https://medium.com/@forwardsecrecy/overthewire-advent-bonanza-2019-capture-the-flag-competition-66c50671c641">here</a>.</p><h4>The Challenge</h4><p><em>Santa’s little helpers are notoriously good at solving Sudoku puzzles.<br>Because regular Sudoku puzzles are too trivial, they have invented a variant.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/280/1*AMvY4RW3qe_HTTloqktdaQ.png" /><figcaption>The Sudoko puzzle to solve</figcaption></figure><p><em>In addition to the standard Sudoku puzzle above,<br>the following equations must also hold:</em></p><p><em>B9 + B8 + C1 + H4 + H4 = 23<br>A5 + D7 + I5 + G8 + B3 + A5 = 19<br>I2 + I3 + F2 + E9 = 15<br>I7 + H8 + C2 + D9 = 26<br>I6 + A5 + I3 + B8 + C3 = 20<br>I7 + D9 + B6 + A8 + A3 + C4 = 27<br>C7 + H9 + I7 + B2 + H8 + G3 = 31<br>D3 + I8 + A4 + I6 = 27<br>F5 + B8 + F8 + I7 + F1 = 33<br>A2 + A8 + D7 + E4 = 21<br>C1 + I4 + C2 + I1 + A4 = 20<br>F8 + C1 + F6 + D3 + B6 = 25</em></p><p><em>If you then read the numbers clockwise starting from A1 to A9, to I9, to I1 and<br>back to A1, you end up with a number with 32 digits. Enclose that in AOTW{…}<br>to get the flag.</em></p><h4>The Solution</h4><p>This is a tough challenge consisting of math and programming in order to find the flag. One must solve a Sudoku puzzle by finding 32 digits, but the puzzle must also meet a list of very specific conditions. Due to this, only an extremely small subset of Sudoku solutions (in this case, one) will meet the conditions and unlock the final flag.</p><p>Enter <strong>go</strong> programming guru and CTF team member <strong>solipsis</strong>.</p><p>In order to solve a challenge such as this, one must do some paper math and preparation work in order to prune and reduce the search space early on. Since we have a fixed number of already filled out numbers, ranges for the missing inputs could be figured out — which helps reduce the complexity and brute force space search by a few orders of magnitude.</p><p>Programming this script to “fail early” as soon as it finds any value that exceeds those in the list of conditions, rather than checking conditions once it has an entire puzzle solution, also helps to speed things up quite a bit.</p><p>These techniques, combined with a descending 9 -&gt;1 number order, help to trigger the failure conditions faster, and reduces magnitudes even further.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/b6589a4741fd55d97a0040647ed6abf3/href">https://medium.com/media/b6589a4741fd55d97a0040647ed6abf3/href</a></iframe><p>After running the script for some time, a final Sudoku solution that meets the list of requirements is found.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/279/1*i-XSplUDmAfuvpwWfqyAyg.png" /><figcaption>Success!</figcaption></figure><p>Per the challenge description, the 32 found numbers are compiled into a single string for a final flag of <strong>AOTW{86472953189247356794813521457639}</strong>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=44aa41c24a81" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[OverTheWire Advent Bonanza 2019–Santa’s Signature]]></title>
            <link>https://medium.com/@forwardsecrecy/overthewire-advent-bonanza-2019-santas-signature-77a67e01a5d?source=rss-2417201225d7------2</link>
            <guid isPermaLink="false">https://medium.com/p/77a67e01a5d</guid>
            <category><![CDATA[ctf]]></category>
            <category><![CDATA[hacking]]></category>
            <category><![CDATA[security]]></category>
            <category><![CDATA[infosec]]></category>
            <category><![CDATA[ctf-writeup]]></category>
            <dc:creator><![CDATA[Ron Stoner]]></dc:creator>
            <pubDate>Fri, 27 Dec 2019 05:02:30 GMT</pubDate>
            <atom:updated>2019-12-27T05:05:50.640Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*m7Jo2Tj0WFlug5e4MLo0mA.jpeg" /></figure><p>This write up is part of a bigger Capture The Flag competition. You can see other challenge write ups on the main post <a href="https://medium.com/@forwardsecrecy/overthewire-advent-bonanza-2019-capture-the-flag-competition-66c50671c641">here</a>.</p><h4>The Challenge</h4><blockquote>Can you forge Santa’s signature?</blockquote><h4>The Data</h4><p>We are provided a remote service to connect to, as well as some source code on how that service is running.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/538/1*KJClFQt0PwzBRfs7Gx9dNA.png" /><figcaption>The remote service</figcaption></figure><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/4bca5b5e2ef8b13cabac160466e94fa2/href">https://medium.com/media/4bca5b5e2ef8b13cabac160466e94fa2/href</a></iframe><p>The remote service (and reading the source code) shows us a generated textbook <strong>RSA</strong> public key, and a request for us to provide 3 signed messages and digital signatures in hex encoding. Generally during CTF competitions, RSA challenges come down to factoring an unknown private key in order to decode a message. This is due to the fact that textbook RSA does not contain any padding, and can be defeated using cryptography and algebra.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Rj73QYCxglnLKFHArhYybA.jpeg" /><figcaption>Textbook RSA</figcaption></figure><p>In order to crack the private key, we need a modulus (<strong>n</strong>) and exponent (<strong>e</strong>) that conform to certain properties (small modulus, small exponent, similar modulus/exponent)so that it’s easier to defeat the cryptography and math.</p><p>When checking these values, it seems we cannot crack the private key itself in this challenge due to such a large modulus (<strong>n</strong>) value.</p><blockquote>n = 0xbb58dbdfd1999…[lots of characters]...d64f501c6640b95c57f<br>e = 65537</blockquote><p>Based off the source code for the remote service, we need to pass 3 messages and provide 3 valid digital signatures per the <em>key.verify(m,s) </em>check<em>.</em></p><p>Since we can provide the message and digital signature, there is an easy way to trick this automated verification system into accepting forged signatures. If we use the values of <strong>0</strong> for the message and signature, or the values of <strong>1</strong> for both — the RSA signature formula (s^e mod n) should still calculate out and pass all the requested checks.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/338/1*DNVDbUn8HH8WqXKyzLPxGQ.png" /><figcaption>Passing check 1 and 2, but not check 3.</figcaption></figure><p>We were able to pass message 1 and message 2 by using the values <strong>0 </strong>and <strong>1</strong>, but we can’t provide either of those again for the 3rd message. Bummer.</p><p>But wait…we know the modulus (<strong>n</strong>), the exponent (<strong>e</strong>), and we can control the digital signature (<strong>s</strong>). Using this, we can figure out an appropriate message (<strong>m</strong>) that should pass verification from a set digital signature.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/8124bc697af82fc36989f2492ca2cb2b/href">https://medium.com/media/8124bc697af82fc36989f2492ca2cb2b/href</a></iframe><p>Since this is an automated system, our message does not need to be human readable — it only needs to pass the signature verification check. Running the script above outputs a hex string that we can input as the message, and a digital signature of <strong>0xf.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/642/1*P-Z4OqItEa6SJk92hb5xMw.png" /></figure><p>This passes the third check, and we can see the final flag.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=77a67e01a5d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[OverTheWire Advent Bonanza 2019–tiny runes]]></title>
            <link>https://medium.com/@forwardsecrecy/overthewire-advent-bonanza-2019-tiny-runes-d69c9b170dc0?source=rss-2417201225d7------2</link>
            <guid isPermaLink="false">https://medium.com/p/d69c9b170dc0</guid>
            <category><![CDATA[ctf-writeup]]></category>
            <category><![CDATA[infosecurity]]></category>
            <category><![CDATA[hacking]]></category>
            <category><![CDATA[ctf]]></category>
            <category><![CDATA[security]]></category>
            <dc:creator><![CDATA[Ron Stoner]]></dc:creator>
            <pubDate>Fri, 27 Dec 2019 04:22:08 GMT</pubDate>
            <atom:updated>2019-12-27T04:27:03.527Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/960/1*SOEl9Z3Sy_1j6jPtXi_5zA.jpeg" /></figure><p>This write up is part of a bigger Capture The Flag competition. You can see other challenge write ups on the main post <a href="https://medium.com/@forwardsecrecy/overthewire-advent-bonanza-2019-capture-the-flag-competition-66c50671c641">here</a>.</p><h4>The Challenge</h4><p><em>One of Santa’s Little Helpers received an unusual Christmas wish, a copy of the yet to be released Deus Hex game. All they managed to find were fragments from the dialogue system. Can you decode the last one?</em></p><h4>The Data</h4><p>The “tiny runes” challenge was a reverse engineering and forensics challenge that included an archive containing 4 binary files containing speech text data for a game engine. Files 1 through 3 included a .txt file showing the game text, so that competitors would have examples to reference. The goal was to take the binary data for the fourth file, and come up with the corresponding text (hopefully containing the flag).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*A8r4cV_KnN0julmYGq35HQ.png" /><figcaption>An example of provided game engine text</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/742/1*VnQzxHTZTGrAdnkmEfUuug.png" /><figcaption>Contents of the binary file</figcaption></figure><p>While we didn’t see anything in the binary files using things like <strong>strings</strong>, the real magic was looking at the hex data (per the game name in the clue) of the file in order to see what bytes were being read.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/752/1*tPig2d97ZPS7r49Qiz5WNw.png" /><figcaption>A hex dump of the example binary file #1</figcaption></figure><p>All 4 provided binary files had mostly the same bytes and format, up until the section starting at <strong>0x329</strong>. Since the data was different between all 4 files, it was determined that this was where the speech text data was being stored.</p><p>Each file had the values <strong>00 00 00 XX </strong>in<strong> 0x329</strong> to <strong>0x3BF</strong>, with the last byte seeming to indicate the size of the text about to follow.</p><p>We know from the 1st binary file and text that the line starts off with “JC Denton”, but the next bytes we are looking at currently show <strong>05 01. </strong>How does this map to the letter “J”?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/639/1*wFr83lIP9tRon-YM36X_hQ.png" /><figcaption>Binwalking for more</figcaption></figure><p>Running the <strong>binwalk</strong> or <strong>foremost</strong> forensic tools on the binary files not only shows text data, but we see a <strong>PNG</strong> image file that we can carve out and extract. The image file itself appears to be a character legend, showing a different arrangement of game text characters.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/400/1*cnbz6W9FLoLgHnKmG7qW0w.png" /><figcaption>The extracted PNG file.</figcaption></figure><h4>The Solution</h4><p>Remember we were trying to figure out how to get the next bytes in the binary file, <strong>05</strong> and <strong>01</strong>, to represent the character “J”? From the above legend, if we count starting from 0 from the top down, left to right — “J” is <strong>01</strong> row down, and <strong>05 </strong>characters over. Remember to start counting from 0. “C” would be <strong>03</strong> across, and <strong>0A</strong> rows down. It seems the text is being encoded in the file using a grid pattern with coordinates to which character is which.</p><p>Using this, we can reverse engineer the 3 provided binary and text files to generate our own character mapping so that we can process the 4th binary file, and get the final text.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/752/1*bK3gPZJ-HmeCT_nGm8uBSQ.png" /><figcaption>Checking the bytes for the 4th binary</figcaption></figure><p>The bytes from 0x399 to 0x3D8 contain our flag string.</p><blockquote>07 04 04 05 04 0A 04 09 01 09 00 06 00 09 05 03 00 0A 02 02 05 03 02 02 07 03 02 00 00 0A 00 0A 01 05 00 05 02 02 06 02 01 04 03 08 01 05 02 02 06 02 02 00 07 03 04 02 05 03 00 0A 07 09 06 07</blockquote><p>Using the legend above, we can start working through the byte pairs/coordinates by hand, or use an automated script. <strong>07</strong> across and <strong>04 </strong>down would be the character “A”. <strong>04</strong> across and <strong>05</strong> down would be the character “O”, and so on and so on until we get the final flag — <strong>AOTW{wh4t_4_r0tt3n_fi13_f0rm4t}</strong>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d69c9b170dc0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[OverTheWire Advent Bonanza 2019–mooo]]></title>
            <link>https://medium.com/@forwardsecrecy/overthewire-advent-bonanza-2019-mooo-7d557646ee05?source=rss-2417201225d7------2</link>
            <guid isPermaLink="false">https://medium.com/p/7d557646ee05</guid>
            <category><![CDATA[ctf]]></category>
            <category><![CDATA[ctf-writeup]]></category>
            <category><![CDATA[security]]></category>
            <category><![CDATA[hacking]]></category>
            <category><![CDATA[infosecurity]]></category>
            <dc:creator><![CDATA[Ron Stoner]]></dc:creator>
            <pubDate>Fri, 27 Dec 2019 01:25:29 GMT</pubDate>
            <atom:updated>2019-12-27T19:54:50.343Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*EkHtlgVdgKnbe4kqZm38bw.png" /></figure><p>This write up is part of a bigger Capture The Flag competition. You can see other challenge write ups on the main post <a href="https://medium.com/@forwardsecrecy/overthewire-advent-bonanza-2019-capture-the-flag-competition-66c50671c641">here</a>.</p><h4>The Challenge</h4><blockquote>‘Moo may represent an idea, but only the cow knows.’ — Mason Cooley</blockquote><p>Mooo was one of the more fun challenges and provided us with a web service running on a specific port and IP address. Navigating to the site brings us to an implementation of <strong>cowsay</strong>. <strong>Cowsay</strong> takes input from a user and displays it in an ASCII art formatted cow.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/370/1*iCT8MVFrR0GjQ98o_yZPQQ.png" /><figcaption>The cowsay program (banner at bottom is cut off)</figcaption></figure><p>We know the name of the program due to the banner at the very bottom of the page (not shown here) listing the program version as <strong>Powered by </strong><a href="https://packages.ubuntu.com/bionic/cowsay"><strong>cowsay 3.03+dfsg2–4</strong></a><strong>. </strong>As a hacker, if we can get access to the source code then we can start looking at places to poke and prod. <strong>Cowsay</strong> happens to have it’s source code listed at <a href="https://github.com/schacon/cowsay/blob/master/cowsay">https://github.com/schacon/cowsay/blob/master/cowsay</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/649/1*vGYStlxNQxvZORCysrpNng.png" /><figcaption>Part of the cowsay source code</figcaption></figure><h4>The Solution</h4><p>After reviewing the Github and source code, we know that <strong>cowsay</strong> is written in the <strong>Perl</strong> programming language. Unfortunately, the only input field we’ve seen so far places text in the cow’s speech bubble. Attacking this did not seem to yield any results, as it seems the input field is being sanitized. We need to look elsewhere for an attack vector. Fortunately, a “custom” cow template exists that gives us more input fields to play with.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/427/1*x_-FSRNDRn0MAYvabfwJBQ.png" /><figcaption>The custom cow template</figcaption></figure><p>We now know that the program is written in Perl, and we have more input fields to play with. No attacks were found after trying some web application and string escapes in the <strong>Message</strong>, <strong>Eyes</strong>, and <strong>Tongue</strong> field, but something interesting was found when testing things against the <strong>Cow</strong> text field.</p><p><strong>Perl</strong> is not one of my strongest or favorite programming languages. Someone on my team decided to <strong>RTFM</strong> and found a gem inside the Perl documentation located at <a href="https://perldoc.perl.org/perlop.html">https://perldoc.perl.org/perlop.html</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/778/1*05BWHPgZVyOJBwHzs9AOSg.png" /><figcaption>The key to the kingdom, and a great Perl escape</figcaption></figure><p>They noticed that some Perl scripts contained <strong>EOF </strong>(End of File), while this one had <strong>EOC</strong> (I’m assuming End of Command, but it’s actually End of Cow), indicating that the code was to exit after finishing it’s code processing. This <strong>EOC</strong> command was also present in the custom cow template. We tried to pass <strong>EOC, </strong>which seemed to work without reporting any errors. After that, we tried chaining commands with the linux <strong>id</strong> command to see if we had escaped Perl and reached a shell.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/392/1*ScxeYbnRqaSuGY2vh388EA.png" /><figcaption>Cowsay failed, but have we?</figcaption></figure><p>The server didn’t like our <strong>id </strong>command, so it didn’t seem we were at a shell yet. We did get an error message when adding the <strong>id</strong> command, whereas we did not when previously trying just <strong>EOC</strong>, so it seems we’ve escaped Perl, but now we’re….somewhere else entirely.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/196/1*aQApTBsEdy7eEbqtjhMirw.jpeg" /><figcaption>No, not there.</figcaption></figure><p>Knowing that web applications can only be hosted by a variety of services, we try a variety of commands in different syntax. When attempting a <strong>python</strong> module import, we no longer receive any errors.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/384/1*PhZRjM2aHpsYkNbhElEjgA.png" /><figcaption>No errors!</figcaption></figure><p>Did we escape from <strong>Perl</strong> and land in <strong>Python</strong>? I think we did! Let’s see if we can get <strong>python</strong> to execute shell commands for us using the <strong>os.system</strong> call.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/401/1*a6KKQOw1sDH0eLeJV9HUSA.png" /><figcaption>The final flag</figcaption></figure><p>The <strong>python</strong> call executes and we get the final flag. Mooo!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7d557646ee05" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[OverTheWire Advent Bonanza 2019–7110]]></title>
            <link>https://medium.com/@forwardsecrecy/overthewire-advent-bonanza-2019-7110-98ccf8116130?source=rss-2417201225d7------2</link>
            <guid isPermaLink="false">https://medium.com/p/98ccf8116130</guid>
            <category><![CDATA[ctf]]></category>
            <category><![CDATA[ctf-writeup]]></category>
            <category><![CDATA[information-security]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[hacking]]></category>
            <dc:creator><![CDATA[Ron Stoner]]></dc:creator>
            <pubDate>Fri, 27 Dec 2019 00:44:07 GMT</pubDate>
            <atom:updated>2019-12-27T00:44:07.042Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1lnl_Ft0lBzIFoHjgBsNkQ.jpeg" /></figure><p>This write up is part of a bigger Capture The Flag competition. You can see other challenge write ups on the main post <a href="https://medium.com/@forwardsecrecy/overthewire-advent-bonanza-2019-capture-the-flag-competition-66c50671c641">here</a>.</p><h4>The Challenge</h4><p><em>Santa is stranded on the Christmas Islands and is desperately trying to reach his trusty companion via cellphone. We’ve bugged the device with a primitive keylogger and have been able to decode some of the SMS, but couldn’t make much sense of the last one. Can you give us a hand?</em></p><h4>The Data</h4><p>The challenge included an archive consisting of 4 comma delimited files, and 3 text files so that competitors could compare the data to the expected result. It was up to us to figure out message #4. Since I’ve been around awhile, I immediately recognized the name and nature of this type of challenge.</p><h4>The Background</h4><p>In the pre-smartphone days, Nokia ruled the land of cell phones. They had limited features, could play Snake, and were built like tanks. Before we were all able to touch our screens to make things happen, we needed to use physical hardware buttons. Insane, right?!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*11lDx4R7DjKdqlOjFQzvNA.png" /></figure><p>Those same hardware buttons were used for sending SMS text messages between phones. Since you were only limited to the buttons on the keypad, each button needed to provide multiple functions.</p><p>In order to type the letter <strong>A</strong>, a user would hit the number <strong>2</strong> button one time. If you wanted to type a <strong>B</strong>, you’d hit the number <strong>2</strong> button two times. If you wanted a <strong>C</strong>, you’d hit it three times. This input style was referred to as <strong>Multi-tap </strong>— <a href="https://en.wikipedia.org/wiki/Multi-tap">https://en.wikipedia.org/wiki/Multi-tap</a>.</p><p>Now imagine having to type a long story or grocery list to someone using that input style. Thankfully those days of painful texting are over, but this challenge reached out to the old school phreaker inside me.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/1*CSiPXpnHnip9y6u1PDOh6A.jpeg" /><figcaption>Nokia 7110</figcaption></figure><p>In regards to the challenge name, the Nokia 7110 was a special edition phone with a sliding cover in honor of the movie “The Matrix”. The model number itself doesn’t have much to do with the challenge itself, but does point us to the text character set we should be using for the challenge.</p><h4>The Solution</h4><p>The 4th message file contained data in the same format as the other files. When looking at the format, it shows a timestamp in the first column, with the digit pressed on the phone in the second. Numbers in the second column appearing in sequence indicate that specific button being pressed multiple times (in order for the letters for that number to cycle).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/168/1*GCBdH4MG-FUUKHl3frHQWw.png" /><figcaption>A sample of csv4 data — the first column is a timestamp/uid and the second is the number pressed</figcaption></figure><p>You may notice the numbers <strong>100</strong> through <strong>103</strong> and <strong>11</strong> in the above data. These represent the <strong>hash</strong>, <strong>MENU_LEFT</strong>, <strong>MENU_RIGHT</strong>, and other navigation buttons. At this point, the numbered key presses can be extracted and decoded for the flag. Due to the nature and knowledge of multi-tap, this can be achieved manually by hand, or using an automated script such as a python custom dictionary.</p><h4>The extracted key presses:</h4><blockquote>100 100 100 100 11 11 2 5 5 5 7 7 7 4 4 4 4 4 4 8 0 7 2 5 5 5 0 4 4 3 3 7 7 7 7 7 7 7 102 3 3 103 0 9 9 9 3 3 0 3 3 3 5 5 5 2 4 0 4 6 6 6 6 6 6 6 6 6 6 3 0 5 5 5 8 8 2 2 2 5 0 3 3 6 6 8 3 3 7 7 7 102 102 102 102 102 102 102 103 101 5 5 103 103 103 103 103 103 4 4 4 6 6 4 0 4 4 4 8 0 9 4 4 4 8 4 4 0 8 4 4 6 6 6 7 7 7 7 3 3 0 4 4 6 6 6 6 6 6 8 8 8 3 3 7 7 7 7 0 5 5 5 6 6 6 5 5 5 0 4 4 4 8 7 7 7 7 0 2 6 6 6 8 9 10 10 10 10 10 10 10 10 10 10 10 10 5 5 5 3 3 3 3 8 7 7 7 7 10 10 10 10 3 7 7 7 1 1 1 1 1 1 1 6 6 5 5 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 7 7 7 7 0 0 6 3 3 3 3 10 10 10 10 3 3 4 4 6 6 6 6 6 6 6 6 6 4 101 101 0 0 4 10 10 10 10 9 9 9 0 0 8 8 10 10 10 10 2 2 2 7 7 7 4 4 4 4 9 9 9 9 9 9 9 10 10 10 10 3 3 3 3 3 3 3 3 3 7 7 7 10 10 10 10 10 10 10 10 10 10 10 10 10 100 100 0 0 6 1 1 0 1 5 5 5 0 1 1 7 100</blockquote><h4>The Multi-tap decoded output and final flag:</h4><blockquote>MENU_LEFT MENU_LEFT MENU_LEFT MENU_LEFT HASH HASH [a][l][r][i][g][h][t][ ][p][a][l][ ][h][e][r][s] MENU_UP [e] MENU_DOWN [ ][y][e][ ][f][l][a][g][ ][g][o][o][d][ ][l][u][c][j][ ][e][n][t][e][r] MENU_UP MENU_UP MENU_UP MENU_UP MENU_UP MENU_UP MENU_UP MENU_DOWN MENU_RIGHT [k] MENU_DOWN MENU_DOWN MENU_DOWN MENU_DOWN MENU_DOWN MENU_DOWN [i][n][g][ ][i][t][ ][w][i][t][h][ ][t][h][o][s][e][ ][h][o][o][v][e][s][ ][l][o][l][ ][i][t][s][ ][a][o][t][w][{][l][3][t][s][_][d][r][1][n][k][_][s][0][m][3][_][e][g][g][n][o][g] MENU_RIGHT MENU_RIGHT [0][g][_][y][0][u][_][c][r][4][z][y][_][d][3][3][r][}] MENU_LEFT MENU_LEFT [0][m][.][.][ ][.][l][ ][,][p] MENU_LEFT</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=98ccf8116130" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>