<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>PlaidCTF on System Overlord</title><link>https://systemoverlord.com/tags/plaidctf.html</link><description>Recent content in PlaidCTF on System Overlord</description><generator>Hugo</generator><language>en-us</language><managingEditor>david@systemoverlord.com (David Tomaschik)</managingEditor><webMaster>david@systemoverlord.com (David Tomaschik)</webMaster><lastBuildDate>Sun, 17 Apr 2016 00:00:00 +0000</lastBuildDate><atom:link href="https://systemoverlord.com/tags/plaidctf/index.xml" rel="self" type="application/rss+xml"/><item><title>PlaidCTF 2016: Butterfly</title><link>https://systemoverlord.com/2016/04/17/plaidctf-2016-butterfly.html</link><pubDate>Sun, 17 Apr 2016 00:00:00 +0000</pubDate><author>david@systemoverlord.com (David Tomaschik)</author><guid>https://systemoverlord.com/2016/04/17/plaidctf-2016-butterfly.html</guid><description>&lt;p&gt;Butterfly was a 150 point pwnable in the 2016 PlaidCTF. Basic properties:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;x86_64&lt;/li&gt;
&lt;li&gt;Not PIE&lt;/li&gt;
&lt;li&gt;Assume ASLR, NX&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;It turns out to be a very simple binary, all the relevant code in one function
(&lt;code&gt;main&lt;/code&gt;), and using only a handful of libc functions. The first thing that
jumped out to me was two calls to &lt;code&gt;mprotect&lt;/code&gt;, at the same address. I spent some
time looking at the disassembly and figuring out what was going on. The
relevant portions can be seen here:&lt;/p&gt;</description></item><item><title>PlaidCTF 2014: Conclusion</title><link>https://systemoverlord.com/2014/04/14/plaidctf-2014-conclusion/</link><pubDate>Mon, 14 Apr 2014 17:30:42 +0000</pubDate><author>david@systemoverlord.com (David Tomaschik)</author><guid>https://systemoverlord.com/2014/04/14/plaidctf-2014-conclusion/</guid><description>&lt;p&gt;The 2014 edition of PlaidCTF was excellent, but I wish we&amp;rsquo;d been able to make it through more challenges. We cleared about 7 challenges, but really only two of them felt worth writing up. The others have been well documented elsewhere, no sense in rewriting the same thing.&lt;/p&gt;
&lt;p&gt;I liked how the challenges often required a series of exploits/techniques, this is much like what happens in the real world. I do wish I had spent more time on binary exploitation, attempting to get a solution to &lt;code&gt;_&lt;em&gt;nightmares&lt;/em&gt;_&lt;/code&gt; burned a lot of time.&lt;/p&gt;</description></item><item><title>PlaidCTF 2014: ReeKeeeee</title><link>https://systemoverlord.com/2014/04/14/plaidctf-2014-reekeeeee/</link><pubDate>Mon, 14 Apr 2014 06:46:01 +0000</pubDate><author>david@systemoverlord.com (David Tomaschik)</author><guid>https://systemoverlord.com/2014/04/14/plaidctf-2014-reekeeeee/</guid><description>&lt;p&gt;ReeKeeeeee was, by far, the most visually painful challenge in the CTF, with a flashing rainbow background on every page. Blocking scripts was clearly a win here. Like many of the challenges this year, it turned out to require multiple exploitation steps.&lt;/p&gt;
&lt;p&gt;ReeKeeeeee was a meme-generating service that allowed you to provide a URL to an image and text to overlay on the image. Source code was provided, and it was worth noting that it&amp;rsquo;s a Django app using the &lt;code&gt;django.contrib.sessions.serializers.PickleSerializer&lt;/code&gt; serializer. As the &lt;a href="https://docs.djangoproject.com/en/3.0/topics/http/sessions/"&gt;documentation for the serializer&lt;/a&gt; notes, &lt;strong&gt;If the SECRET_KEY is not kept secret and you are using the PickleSerializer, this can lead to arbitrary remote code execution.&lt;/strong&gt; So, maybe, can we get the SECRET_KEY?&lt;/p&gt;</description></item><item><title>PlaidCTF 2014: mtpox</title><link>https://systemoverlord.com/2014/04/14/plaidctf-mtpox/</link><pubDate>Mon, 14 Apr 2014 05:13:12 +0000</pubDate><author>david@systemoverlord.com (David Tomaschik)</author><guid>https://systemoverlord.com/2014/04/14/plaidctf-mtpox/</guid><description>&lt;p&gt;&lt;strong&gt;150 Point Web Challenge&lt;/strong&gt;&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;The Plague has traveled back in time to create a cryptocurrency before Satoshi does in an attempt to quickly gain the resources required for his empire. As you step out of your time machine, you learn his exchange has stopped trades, due to some sort of bug. However, if you could break into the database and show a different story of where the coins went, we might be able to stop The Plague.&lt;/p&gt;</description></item><item><title>Weekly Reading List for 4/4/14</title><link>https://systemoverlord.com/2014/04/04/weekly-reading-list-for-3114/</link><pubDate>Fri, 04 Apr 2014 07:00:00 +0000</pubDate><author>david@systemoverlord.com (David Tomaschik)</author><guid>https://systemoverlord.com/2014/04/04/weekly-reading-list-for-3114/</guid><description>&lt;p&gt;It&amp;rsquo;s been a while where I&amp;rsquo;ve been too busy even for any good reading, but we&amp;rsquo;re back to the reading lists!&lt;/p&gt;
&lt;h4 id="return-oriented-programming-rop"&gt;Return-Oriented Programming (ROP)&lt;/h4&gt;
&lt;p&gt;Code Arcana has an &lt;a href="http://codearcana.com/posts/2013/05/28/introduction-to-return-oriented-programming-rop.html"&gt;excellent introduction to ROP exploitation techniques&lt;/a&gt;. In addition to providing an introduction to the concept, it takes it through detailed implementation and debugging. I look forward to getting an opportunity to try it during the next CTF with a ROP challenge. (I&amp;rsquo;m guess PlaidCTF will offer such a chance.)&lt;/p&gt;</description></item><item><title>PlaidCTF Compression</title><link>https://systemoverlord.com/2013/04/30/plaidctf-compression/</link><pubDate>Tue, 30 Apr 2013 05:26:20 +0000</pubDate><author>david@systemoverlord.com (David Tomaschik)</author><guid>https://systemoverlord.com/2013/04/30/plaidctf-compression/</guid><description>&lt;p&gt;PlaidCTF 2013 had a level called "Compression". Here's the provided code for
this level:&lt;/p&gt;
&lt;div class="geshifilter"&gt;&lt;div class="python geshifilter-python" style="font-family:monospace;"&gt;&lt;pre style="font-family: monospace; font-weight: normal; font-style: normal"&gt;&lt;span style="color: #808080; font-style: italic;"&gt;#!/usr/bin/python&lt;/span&gt;
&lt;span style="color: #ff7700;font-weight:bold;"&gt;import&lt;/span&gt; &lt;span style="color: #dc143c;"&gt;os&lt;/span&gt;
&lt;span style="color: #ff7700;font-weight:bold;"&gt;import&lt;/span&gt; &lt;span style="color: #dc143c;"&gt;struct&lt;/span&gt;
&lt;span style="color: #ff7700;font-weight:bold;"&gt;import&lt;/span&gt; &lt;span style="color: #dc143c;"&gt;SocketServer&lt;/span&gt;
&lt;span style="color: #ff7700;font-weight:bold;"&gt;import&lt;/span&gt; &lt;span style="color: #dc143c;"&gt;zlib&lt;/span&gt;
&lt;span style="color: #ff7700;font-weight:bold;"&gt;from&lt;/span&gt; Crypto.&lt;span style="color: black;"&gt;Cipher&lt;/span&gt; &lt;span style="color: #ff7700;font-weight:bold;"&gt;import&lt;/span&gt; AES
&lt;span style="color: #ff7700;font-weight:bold;"&gt;from&lt;/span&gt; Crypto.&lt;span style="color: black;"&gt;Util&lt;/span&gt; &lt;span style="color: #ff7700;font-weight:bold;"&gt;import&lt;/span&gt; Counter
 
&lt;span style="color: #808080; font-style: italic;"&gt;# Not the real keys!&lt;/span&gt;
ENCRYPT_KEY &lt;span style="color: #66cc66;"&gt;=&lt;/span&gt; &lt;span style="color: #483d8b;"&gt;'0000000000000000000000000000000000000000000000000000000000000000'&lt;/span&gt;.&lt;span style="color: black;"&gt;decode&lt;/span&gt;&lt;span style="color: black;"&gt;(&lt;/span&gt;&lt;span style="color: #483d8b;"&gt;'hex'&lt;/span&gt;&lt;span style="color: black;"&gt;)&lt;/span&gt;
&lt;span style="color: #808080; font-style: italic;"&gt;# Determine this key.&lt;/span&gt;
&lt;span style="color: #808080; font-style: italic;"&gt;# Character set: lowercase letters and underscore&lt;/span&gt;
PROBLEM_KEY &lt;span style="color: #66cc66;"&gt;=&lt;/span&gt; &lt;span style="color: #483d8b;"&gt;'XXXXXXXXXXXXXXXXXXXX'&lt;/span&gt;
 
&lt;span style="color: #ff7700;font-weight:bold;"&gt;def&lt;/span&gt; encrypt&lt;span style="color: black;"&gt;(&lt;/span&gt;data&lt;span style="color: #66cc66;"&gt;,&lt;/span&gt; ctr&lt;span style="color: black;"&gt;)&lt;/span&gt;:
    aes &lt;span style="color: #66cc66;"&gt;=&lt;/span&gt; AES.&lt;span style="color: #dc143c;"&gt;new&lt;/span&gt;&lt;span style="color: black;"&gt;(&lt;/span&gt;ENCRYPT_KEY&lt;span style="color: #66cc66;"&gt;,&lt;/span&gt; AES.&lt;span style="color: black;"&gt;MODE_CTR&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;,&lt;/span&gt; counter&lt;span style="color: #66cc66;"&gt;=&lt;/span&gt;ctr&lt;span style="color: black;"&gt;)&lt;/span&gt;
    &lt;span style="color: #ff7700;font-weight:bold;"&gt;return&lt;/span&gt; aes.&lt;span style="color: black;"&gt;encrypt&lt;/span&gt;&lt;span style="color: black;"&gt;(&lt;/span&gt;&lt;span style="color: #dc143c;"&gt;zlib&lt;/span&gt;.&lt;span style="color: black;"&gt;compress&lt;/span&gt;&lt;span style="color: black;"&gt;(&lt;/span&gt;data&lt;span style="color: black;"&gt;)&lt;/span&gt;&lt;span style="color: black;"&gt;)&lt;/span&gt;
 
&lt;span style="color: #ff7700;font-weight:bold;"&gt;class&lt;/span&gt; ProblemHandler&lt;span style="color: black;"&gt;(&lt;/span&gt;&lt;span style="color: #dc143c;"&gt;SocketServer&lt;/span&gt;.&lt;span style="color: black;"&gt;StreamRequestHandler&lt;/span&gt;&lt;span style="color: black;"&gt;)&lt;/span&gt;:
    &lt;span style="color: #ff7700;font-weight:bold;"&gt;def&lt;/span&gt; handle&lt;span style="color: black;"&gt;(&lt;/span&gt;&lt;span style="color: #008000;"&gt;self&lt;/span&gt;&lt;span style="color: black;"&gt;)&lt;/span&gt;:
        nonce &lt;span style="color: #66cc66;"&gt;=&lt;/span&gt; &lt;span style="color: #dc143c;"&gt;os&lt;/span&gt;.&lt;span style="color: black;"&gt;urandom&lt;/span&gt;&lt;span style="color: black;"&gt;(&lt;/span&gt;&lt;span style="color: #ff4500;"&gt;8&lt;/span&gt;&lt;span style="color: black;"&gt;)&lt;/span&gt;
        &lt;span style="color: #008000;"&gt;self&lt;/span&gt;.&lt;span style="color: black;"&gt;wfile&lt;/span&gt;.&lt;span style="color: black;"&gt;write&lt;/span&gt;&lt;span style="color: black;"&gt;(&lt;/span&gt;nonce&lt;span style="color: black;"&gt;)&lt;/span&gt;
        ctr &lt;span style="color: #66cc66;"&gt;=&lt;/span&gt; Counter.&lt;span style="color: #dc143c;"&gt;new&lt;/span&gt;&lt;span style="color: black;"&gt;(&lt;/span&gt;&lt;span style="color: #ff4500;"&gt;64&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;,&lt;/span&gt; prefix&lt;span style="color: #66cc66;"&gt;=&lt;/span&gt;nonce&lt;span style="color: black;"&gt;)&lt;/span&gt;
        &lt;span style="color: #ff7700;font-weight:bold;"&gt;while&lt;/span&gt; &lt;span style="color: #008000;"&gt;True&lt;/span&gt;:
            data &lt;span style="color: #66cc66;"&gt;=&lt;/span&gt; &lt;span style="color: #008000;"&gt;self&lt;/span&gt;.&lt;span style="color: black;"&gt;rfile&lt;/span&gt;.&lt;span style="color: black;"&gt;read&lt;/span&gt;&lt;span style="color: black;"&gt;(&lt;/span&gt;&lt;span style="color: #ff4500;"&gt;4&lt;/span&gt;&lt;span style="color: black;"&gt;)&lt;/span&gt;
            &lt;span style="color: #ff7700;font-weight:bold;"&gt;if&lt;/span&gt; &lt;span style="color: #ff7700;font-weight:bold;"&gt;not&lt;/span&gt; data:
                &lt;span style="color: #ff7700;font-weight:bold;"&gt;break&lt;/span&gt;
 
            &lt;span style="color: #ff7700;font-weight:bold;"&gt;try&lt;/span&gt;:
                length &lt;span style="color: #66cc66;"&gt;=&lt;/span&gt; &lt;span style="color: #dc143c;"&gt;struct&lt;/span&gt;.&lt;span style="color: black;"&gt;unpack&lt;/span&gt;&lt;span style="color: black;"&gt;(&lt;/span&gt;&lt;span style="color: #483d8b;"&gt;'I'&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;,&lt;/span&gt; data&lt;span style="color: black;"&gt;)&lt;/span&gt;&lt;span style="color: black;"&gt;[&lt;/span&gt;&lt;span style="color: #ff4500;"&gt;0&lt;/span&gt;&lt;span style="color: black;"&gt;]&lt;/span&gt;
                &lt;span style="color: #ff7700;font-weight:bold;"&gt;if&lt;/span&gt; length &lt;span style="color: #66cc66;"&gt;&amp;gt;&lt;/span&gt; &lt;span style="color: black;"&gt;(&lt;/span&gt;&lt;span style="color: #ff4500;"&gt;1&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;&amp;lt;&amp;lt;&lt;/span&gt;&lt;span style="color: #ff4500;"&gt;20&lt;/span&gt;&lt;span style="color: black;"&gt;)&lt;/span&gt;:
                    &lt;span style="color: #ff7700;font-weight:bold;"&gt;break&lt;/span&gt;
                data &lt;span style="color: #66cc66;"&gt;=&lt;/span&gt; &lt;span style="color: #008000;"&gt;self&lt;/span&gt;.&lt;span style="color: black;"&gt;rfile&lt;/span&gt;.&lt;span style="color: black;"&gt;read&lt;/span&gt;&lt;span style="color: black;"&gt;(&lt;/span&gt;length&lt;span style="color: black;"&gt;)&lt;/span&gt;
                data +&lt;span style="color: #66cc66;"&gt;=&lt;/span&gt; PROBLEM_KEY
                ciphertext &lt;span style="color: #66cc66;"&gt;=&lt;/span&gt; encrypt&lt;span style="color: black;"&gt;(&lt;/span&gt;data&lt;span style="color: #66cc66;"&gt;,&lt;/span&gt; ctr&lt;span style="color: black;"&gt;)&lt;/span&gt;
                &lt;span style="color: #008000;"&gt;self&lt;/span&gt;.&lt;span style="color: black;"&gt;wfile&lt;/span&gt;.&lt;span style="color: black;"&gt;write&lt;/span&gt;&lt;span style="color: black;"&gt;(&lt;/span&gt;&lt;span style="color: #dc143c;"&gt;struct&lt;/span&gt;.&lt;span style="color: black;"&gt;pack&lt;/span&gt;&lt;span style="color: black;"&gt;(&lt;/span&gt;&lt;span style="color: #483d8b;"&gt;'I'&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;,&lt;/span&gt; &lt;span style="color: #008000;"&gt;len&lt;/span&gt;&lt;span style="color: black;"&gt;(&lt;/span&gt;ciphertext&lt;span style="color: black;"&gt;)&lt;/span&gt;&lt;span style="color: black;"&gt;)&lt;/span&gt;&lt;span style="color: black;"&gt;)&lt;/span&gt;
                &lt;span style="color: #008000;"&gt;self&lt;/span&gt;.&lt;span style="color: black;"&gt;wfile&lt;/span&gt;.&lt;span style="color: black;"&gt;write&lt;/span&gt;&lt;span style="color: black;"&gt;(&lt;/span&gt;ciphertext&lt;span style="color: black;"&gt;)&lt;/span&gt;
            &lt;span style="color: #ff7700;font-weight:bold;"&gt;except&lt;/span&gt;:
                &lt;span style="color: #ff7700;font-weight:bold;"&gt;break&lt;/span&gt;
 
&lt;span style="color: #ff7700;font-weight:bold;"&gt;class&lt;/span&gt; ReusableTCPServer&lt;span style="color: black;"&gt;(&lt;/span&gt;&lt;span style="color: #dc143c;"&gt;SocketServer&lt;/span&gt;.&lt;span style="color: black;"&gt;ForkingMixIn&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;,&lt;/span&gt; &lt;span style="color: #dc143c;"&gt;SocketServer&lt;/span&gt;.&lt;span style="color: black;"&gt;TCPServer&lt;/span&gt;&lt;span style="color: black;"&gt;)&lt;/span&gt;:
    allow_reuse_address &lt;span style="color: #66cc66;"&gt;=&lt;/span&gt; &lt;span style="color: #008000;"&gt;True&lt;/span&gt;
 
&lt;span style="color: #ff7700;font-weight:bold;"&gt;if&lt;/span&gt; __name__ &lt;span style="color: #66cc66;"&gt;==&lt;/span&gt; &lt;span style="color: #483d8b;"&gt;'__main__'&lt;/span&gt;:
    HOST &lt;span style="color: #66cc66;"&gt;=&lt;/span&gt; &lt;span style="color: #483d8b;"&gt;'0.0.0.0'&lt;/span&gt;
    PORT &lt;span style="color: #66cc66;"&gt;=&lt;/span&gt; &lt;span style="color: #ff4500;"&gt;4433&lt;/span&gt;
    &lt;span style="color: #dc143c;"&gt;SocketServer&lt;/span&gt;.&lt;span style="color: black;"&gt;TCPServer&lt;/span&gt;.&lt;span style="color: black;"&gt;allow_reuse_address&lt;/span&gt; &lt;span style="color: #66cc66;"&gt;=&lt;/span&gt; &lt;span style="color: #008000;"&gt;True&lt;/span&gt;
    server &lt;span style="color: #66cc66;"&gt;=&lt;/span&gt; ReusableTCPServer&lt;span style="color: black;"&gt;(&lt;/span&gt;&lt;span style="color: black;"&gt;(&lt;/span&gt;HOST&lt;span style="color: #66cc66;"&gt;,&lt;/span&gt; PORT&lt;span style="color: black;"&gt;)&lt;/span&gt;&lt;span style="color: #66cc66;"&gt;,&lt;/span&gt; ProblemHandler&lt;span style="color: black;"&gt;)&lt;/span&gt;
    server.&lt;span style="color: black;"&gt;serve_forever&lt;/span&gt;&lt;span style="color: black;"&gt;(&lt;/span&gt;&lt;span style="color: black;"&gt;)&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt; So there's a few interesting things of note here:
&lt;/p&gt;</description></item></channel></rss>