<?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 Rory Flynn on Medium]]></title>
        <description><![CDATA[Stories by Rory Flynn on Medium]]></description>
        <link>https://medium.com/@roryflynn?source=rss-315382bee20a------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*iy4vzc91bTtR9hfNj1fdnQ.png</url>
            <title>Stories by Rory Flynn on Medium</title>
            <link>https://medium.com/@roryflynn?source=rss-315382bee20a------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 01 Dec 2026 09:02:44 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@roryflynn/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[Zerodays 2017 - Pacman 400 Writeup]]></title>
            <link>https://medium.com/@roryflynn/zerodays-2017-writeup-cf5b508acc38?source=rss-315382bee20a------2</link>
            <guid isPermaLink="false">https://medium.com/p/cf5b508acc38</guid>
            <category><![CDATA[ctf]]></category>
            <category><![CDATA[infosec]]></category>
            <category><![CDATA[zero-day]]></category>
            <dc:creator><![CDATA[Rory Flynn]]></dc:creator>
            <pubDate>Tue, 11 Apr 2017 16:16:08 GMT</pubDate>
            <atom:updated>2017-04-11T16:35:38.521Z</atom:updated>
            <content:encoded><![CDATA[<blockquote><strong>Pacman</strong></blockquote><blockquote><strong>400</strong></blockquote><blockquote>Pacman needs your help to find the next flag.<br><a href="http://worldsbiggestpacman.com/play/#161,-182">http://worldsbiggestpacman.com/play/#161,-182</a></blockquote><blockquote>flag format:<br>url shortcode</blockquote><p>Let’s have a looksie at the game:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9X6HaBaNlEKtczC9iM3I9w.png" /></figure><p>The game is hosted on a third party website so it’s unlikely that there’s any vulnerabilities we can exploit.</p><p>Hang on a sec, the map looks like a QR code! But it’s unlikely I’ll be able to find an app that will let me scan it ;). Let’s see if we can get access to the raw data that’s generating the map.</p><p>Open up Chrome Developer Tools Ctrl+shift+iand click the ‘Network’ tab and filter by ‘XHR’ requests only. (This will give you only the requests generated during runtime by the website’s Javascript code).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*C3oo1tFW_cUSg_7Z9X4GTQ.png" /></figure><p>ajax_request_level.php looks interesting. Click to open a preview of what was received:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rbVfqzYxm3aaWOknu3bLiQ.png" /></figure><p>Judging by the screen layout, # means a wall element, o means a gap element, e means an empty space and - means a dot. Double click on ajax_request_level.php to open it in a new tab, and press Ctrl-S to save as level.json .</p><p>Alright, we have the map data in a structured format, let’s try print a QR code.</p><p>I wrote a quick python script to parse level.json and output the QR code into a HTML document using the Unicode black and white <a href="http://www.fileformat.info/info/unicode/char/25a0/index.htm">squares</a>, inspired by this <a href="http://asciiqr.com/">ASCII QR code website</a>:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/58775665c1151ceaafbaf75129f5ebd6/href">https://medium.com/media/58775665c1151ceaafbaf75129f5ebd6/href</a></iframe><p>Open qr.html in you browser and voila:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/828/1*6wVSNSDlv8jZ4MNvzbp6nA.png" /></figure><p>But… it <strong>doesn’t scan.</strong> Then you realise that the corners <a href="https://www.google.ie/search?q=qr+code&amp;source=lnms&amp;tbm=isch">should be</a> solid black squares. You have to manually edit the source code of qr.html to figure out which ones to change to black squares. You then end up with this, which does scan:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/739/1*oosYw6yTw7OWA7WywUhQqA.png" /></figure><p>It scans to http://q-r.to/bajM0B which is the flag you have to input.</p><p>Thanks to everyone involved involved in making <a href="https://www.zerodays.ie/">Zerodays</a> a really fun, Irish CTF and supplying great challenges like this one! Join the <a href="https://www.facebook.com/groups/ZeroDaysCTF/">Facebook group</a> if you want to hear more.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cf5b508acc38" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Zerodays ECSC Qualifier Writeup]]></title>
            <link>https://medium.com/@roryflynn/zerodays-ecsc-qualifier-writeup-3c153c08702c?source=rss-315382bee20a------2</link>
            <guid isPermaLink="false">https://medium.com/p/3c153c08702c</guid>
            <category><![CDATA[ethical-hacking]]></category>
            <category><![CDATA[ctf]]></category>
            <category><![CDATA[information-security]]></category>
            <dc:creator><![CDATA[Rory Flynn]]></dc:creator>
            <pubDate>Wed, 02 Nov 2016 20:28:53 GMT</pubDate>
            <atom:updated>2016-11-02T20:29:11.914Z</atom:updated>
            <content:encoded><![CDATA[<h4><strong>Challenge 1: Small, Far away!</strong></h4><blockquote>This number 191311212 is small. <br>The flag is hidden</blockquote><p>The flag is ‘hidden’ translated using alphabet indexes, h=8, i=9 etc.</p><h4><strong>Challenge 2: Decode the flag</strong></h4><pre>N = 0xb197d3afe713816582ee988b276f635800f728f118f5125de1c7c1e57f2738351de8ac643c118a5480f867b6d8756021911818e470952bd0a5262ed86b4fc4c2b7962cd197a8bd8d8ae3f821ad712a42285db67c85983581c4c39f80dbb21bf700dbd2ae9709f7e307769b5c0e624b661441c1ddb62ef1fe7684bbe61d8a19e7<br>e = 65537<br>p = 0xc315d99cf91a018dafba850237935b2d981e82b02d994f94db0a1ae40d1fc7ab9799286ac68d620f1102ef515b348807060e6caec5320e3dceb25a0b98356399<br>q = 0xe90bbb3d4f51311f0b7669abd04e4cc48687ad0e168e7183a9de3ff9fd2d2a3a50303a5109457bd45f0abe1c5750edfaff1ad87c13eed45e1b4bd2366b49d97f<br>d = 0x496747c7dceae300e22d5c3fa7fd1242bda36af8bc280f7f5e630271a92cbcbeb7ae04132a00d5fc379274cbce8c353faa891b40d087d7a4559e829e513c97467345adca3aa66550a68889cf930ecdfde706445b3f110c0cb4a81ca66f8630ed003feea59a51dc1d18a7f6301f2817cb53b1fb58b2a5ad163e9f1f9fe463b901<br><br>Encrypted flag = 53562528421309543933712082527318352089314970318900882831401436196705293795310078793035357848002230423376163334603329018456348091500453312224777761591136257077258185221003922118678887681035009591312900905792295003123820991241024462515455337520215267897301998645696742628740124864169789720416114526144232911232</pre><p>We notice straight away that the letters N, p, q, d and e are from the RSA cryptosystem. All we need to <a href="https://warrenguy.me/blog/regenerating-rsa-private-key-python">reconstruct the private key</a> is N, e and d (d is derived from p and q). I did this using the Pycrypto library:</p><pre>&gt;&gt; from Crypto.PublicKey import RSA</pre><pre># convert hex to long<br>&gt;&gt;&gt; N = long(&#39;0xb197d3afe713816582ee988b276f635800f728f118f5125de1c7c1e57f2738351de8ac643c118a5480f867b6d8756021911818e470952bd0a5262ed86b4fc4c2b7962cd197a8bd8d8ae3f821ad712a42285db67c85983581c4c39f80dbb21bf700dbd2ae9709f7e307769b5c0e624b661441c1ddb62ef1fe7684bbe61d8a19e7&#39;, 16)</pre><pre>&gt;&gt;&gt; e = long(65537)</pre><pre>&gt;&gt;&gt; d = long(&#39;0x496747c7dceae300e22d5c3fa7fd1242bda36af8bc280f7f5e630271a92cbcbeb7ae04132a00d5fc379274cbce8c353faa891b40d087d7a4559e829e513c97467345adca3aa66550a68889cf930ecdfde706445b3f110c0cb4a81ca66f8630ed003feea59a51dc1d18a7f6301f2817cb53b1fb58b2a5ad163e9f1f9fe463b901&#39;, 16)</pre><pre>&gt;&gt;&gt; key = RSA.construct((N, e, d))</pre><pre>&gt;&gt;&gt; key.decrypt(53562528421309543933712082527318352089314970318900882831401436196705293795310078793035357848002230423376163334603329018456348091500453312224777761591136257077258185221003922118678887681035009591312900905792295003123820991241024462515455337520215267897301998645696742628740124864169789720416114526144232911232)</pre><pre>49014571712205592625635526485209296459896806791758384353960004295365643469531945664468842533914184922170896546935957966561831572642030717L</pre><pre>&gt;&gt;&gt; from Crypto.Util.number import long_to_bytes</pre><pre>&gt;&gt;&gt; long_to_bytes(49014571712205592625635526485209296459896806791758384353960004295365643469531945664468842533914184922170896546935957966561831572642030717L)<br>&#39;Congrats u decoded the Flag{if_at_first_you_dont_succeed}&#39;</pre><h4><strong>Challenge 3: Wait and see</strong></h4><blockquote>Can you get the flag from <a href="https://www.zerodays.ie/ecsc/challs/index.php">this webpage</a></blockquote><p>This challenge involved a login page which has the following information in a meta tag in the header:</p><pre>&lt;head&gt;<br>  &lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=utf-8&quot; /&gt;<br>  &lt;meta name=&quot;keywords&quot; content=&quot;user name is SCA&quot;/&gt;<br>  &lt;meta name=&quot;keywords&quot; content=&quot;password is alpha&quot;/&gt;<br>  &lt;title&gt;Challenge 3&lt;/title&gt; &lt;/head&gt;</pre><p>But this login doesn’t work! We google SCA and find out it could stand for <a href="https://en.wikipedia.org/wiki/Side-channel_attack">Side Channel Attack</a> which includes timing attacks on its wiki page. Given the title of this challenge is “Wait and see”, this is probably a timing attack.</p><p>We check whether we can do a timing attack on the login. Sure enough, if you enter an “a” in the password field, the error page takes ~2 seconds to load. If you enter a “b” in the password field, it comes back instantly. This indicates that the function that does a string comparison on the password takes ~2 seconds to compare each character and returns as soon as it finds two characters that don’t match. If you enter “aa” it takes ~2 seconds, if you enter “ab” it takes ~4 seconds, showing us that “ab” is the correct first two characters. You can do this character by character manually or write a python script to do it for you.</p><h4><strong>Challenge 4: JS reversing</strong></h4><blockquote>I seem to have forgotten my access code. Is there any way I can gain access now?</blockquote><blockquote>I was using this <a href="https://www.zerodays.ie/ecsc/challs/js.html">website</a> to help me create my hashes</blockquote><p>I did this one by hand, character by character. You could waste a lot of time manually reversing the JS hash function but a quick test of repeated input tells you some of the properties instantly:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WQv-5JFfJ_-JEBLM53Uecw.png" /></figure><p>This tells us that the hash function is probably a per-character hash with the exception of the first character and that the input is padded with characters that map to ‘8’ when hashed. NB: Multiple inputs produced the correct hash and were accepted.</p><h4><strong>Challenge 5: Scrambled</strong></h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*WPGvIR8IHCpD-Lh1.jpg" /></figure><p>Looking closely at the individual strips, they appear to be parts of the same image: note the metallic lines present on all four corners of the image. Note that every 4 strips the image appears to be the same. We guess that it’s probably the same image rotated 90 degrees every strip.</p><p>I used the <a href="https://python-pillow.org/">Pillow (Python Imaging Library)</a> to repeatedly crop, rotate and paste successively larger squares onto a new image:</p><pre>#!/usr/bin/env python</pre><pre>import sys<br>from PIL import Image</pre><pre>SLICE_WIDTH = 10</pre><pre>def main():<br>    source = Image.open(sys.argv[1])<br>    canvas = source.copy()<br>    for n in range(0, (source.width / 2) / SLICE_WIDTH):<br>        x = n * SLICE_WIDTH<br>        cropped = source.crop((x, x, source.width - x, source.height - x))</pre><pre>        rotation_angle = -1 * ((90 * n) % 360)<br>        rotated = cropped.rotate(rotation_angle)<br>        canvas.paste(rotated, (x, x))<br>    canvas.show()</pre><pre>if __name__ == &quot;__main__&quot;:<br>    main()</pre><p>This results in the following image:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*X1-_lP6JTIj9JYLM79dZag.png" /></figure><h4><strong>Challenge 6: </strong>Reverse me!</h4><blockquote>Can you find the address of the function we need, from this <a href="https://www.zerodays.ie/ecsc/challs/program">program</a>?</blockquote><p>Output when we run the program:</p><pre>Bet you can&#39;t find the address of find_string!<br>Did you know that &quot;class&quot; appears in &quot;the following class&quot; at index 14?</pre><p>GNU Debugger can actually debug programs without debugging symbols. Load the program and set a breakpoint at the function:</p><pre>$ gdb program</pre><pre>GNU gdb (Ubuntu 7.11.1-0ubuntu1~16.04) 7.11.1<br>Copyright (C) 2016 Free Software Foundation, Inc.<br>License GPLv3+: GNU GPL version 3 or later &lt;<a href="http://gnu.org/licenses/gpl.html">http://gnu.org/licenses/gpl.html</a>&gt;<br>This is free software: you are free to change and redistribute it.<br>There is NO WARRANTY, to the extent permitted by law.  Type &quot;show copying&quot;<br>and &quot;show warranty&quot; for details.<br>This GDB was configured as &quot;x86_64-linux-gnu&quot;.<br>Type &quot;show configuration&quot; for configuration details.<br>For bug reporting instructions, please see:<br>&lt;<a href="http://www.gnu.org/software/gdb/bugs/">http://www.gnu.org/software/gdb/bugs/</a>&gt;.<br>Find the GDB manual and other documentation resources online at:<br>&lt;<a href="http://www.gnu.org/software/gdb/documentation/">http://www.gnu.org/software/gdb/documentation/</a>&gt;.<br>For help, type &quot;help&quot;.<br>Type &quot;apropos word&quot; to search for commands related to &quot;word&quot;...<br>Reading symbols from program...(no debugging symbols found)...done.<br>(gdb) break find_string<br>Breakpoint 1 at 0x8048448<br>(gdb)</pre><p>Note that the address shown by gdb strips leading zeros from the function address, so the answer is actually <em>0x08048448</em></p><h4>Challenge 7: Inspect</h4><blockquote>Can you bypass the local access restrictions for this <a href="https://www.zerodays.ie/ecsc/challs/7.html">website</a></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-ONjSeL5X1yjsh_ZnupCHw.png" /></figure><p>Read the challenge title carefully! The flag is in plain view in the source. (You could also manually remove the CSS blur properties from the table.)</p><h4>Challenge 8: forensic</h4><p>Following image is provided:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*URnFD6OyKhcyFEjg.jpg" /></figure><p>Inspecting the EXIF metadata using <a href="http://www.sno.phy.queensu.ca/~phil/exiftool/">exiftool</a> doesn’t reveal much in the text-based fields. But the thumbnail looks downright weird:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3ObnkSgVLx4idRBlDgJnSg.png" /></figure><p>Maybe they match up to the characters? Open both the original and the thumbnail in GIMP then scale the thumbnail layer without interpolation via the dropdown menu. Turn down the opacity of the thumbnail layer and you get this when you align the edges slightly:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VmoZxtAKTwIoD99xLwUtJg.png" /><figcaption>ZOMG! I is l33t h4x0r</figcaption></figure><p>which spells “The flag is tihRChh”</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3c153c08702c" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>