<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>unorde.red on unordered</title>
    <link>https://unorde.red/</link>
    <description>Recent content in unorde.red on unordered</description>
    <generator>Hugo</generator>
    <language>en-US</language>
    <lastBuildDate>Fri, 03 Apr 2026 00:00:00 +0000</lastBuildDate>
    <atom:link href="https://unorde.red/feed.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Pihole and IPv6</title>
      <link>https://unorde.red/pihole/</link>
      <pubDate>Fri, 03 Apr 2026 00:00:00 +0000</pubDate>
      <guid>https://unorde.red/pihole/</guid>
      <description>&lt;p&gt;I recently bought a cheap server to run at home, and set up&#xA;&lt;a href=&#34;https://pi-hole.net/&#34;&gt;pihole&lt;/a&gt;. I set up some local records, so my server is&#xA;available via DNS locally. I also enabled DHCP, so I could give all of my&#xA;devices fancy and organized local IP addresses.&lt;/p&gt;&#xA;&lt;p&gt;Unfortunately my ISP, which is part of the Big Telecom oligopoly in Canada, gave&#xA;me a very locked down router. Inexplicably this router allows you to configure&#xA;v4 DNS servers or disable DHCP entirely, but it doesn&amp;rsquo;t allow you to do the&#xA;equivalent for v6.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Mount MacPherson</title>
      <link>https://unorde.red/mount-macpherson/</link>
      <pubDate>Mon, 28 Aug 2023 00:00:00 +0000</pubDate>
      <guid>https://unorde.red/mount-macpherson/</guid>
      <description>&lt;ul&gt;&#xA;&lt;li&gt;2427m (427m prominence)&lt;/li&gt;&#xA;&lt;li&gt;Monashee Mountains, Gold Range&lt;/li&gt;&#xA;&lt;li&gt;Revelstoke, BC&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;In late August my brother and I were looking for a nice, accessible summit to do&#xA;in the area, and settled on Mount MacPherson as a good candidate. The summit is&#xA;quite close to and visible from Revelstoke, although not nearly as spectacular&#xA;as some of the other visible summits such as Mount Begbie.&lt;/p&gt;&#xA;&lt;p&gt;Access is via the Three Valley-Victor FSR, which is about a kilometer east of&#xA;the Three Valley Lake Chateau on Highway 1, west of Revelstoke. The FSR is in&#xA;decent condition, but deactivated past a certain point. This means gullies have&#xA;been dug into the road every few hundred meters, requiring a high clearance&#xA;vehicle. My Ford Escape handled it fine, although I may have scratched up my&#xA;front bumper a bit on the way down. We stopped shortly before the actual&#xA;trailhead, as the road seemed to worsen up the last steep hill to the trailhead.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Mount Carnarvon</title>
      <link>https://unorde.red/mount-carnarvon/</link>
      <pubDate>Wed, 26 Jul 2023 00:00:00 +0000</pubDate>
      <guid>https://unorde.red/mount-carnarvon/</guid>
      <description>&lt;ul&gt;&#xA;&lt;li&gt;3046m (406m prominence)&lt;/li&gt;&#xA;&lt;li&gt;Canadian Rockies, Waputik Mountains&lt;/li&gt;&#xA;&lt;li&gt;Yoho National Park, BC&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;I was camping in the beautiful Yoho National Park, so naturally it was time to&#xA;climb a big mountain. I poked around the map for a bit and settled on Mount&#xA;Carvarnon as a good candidate. Close to the campsite, lots of elevation, and&#xA;reportedly good YDS class 3 scrambling. The most accessible route up is from&#xA;Emerald Lake, which is a popular tourist destination. I drove up in the morning,&#xA;getting there just after 8 AM. The parking lot wasn&amp;rsquo;t full, but there were&#xA;definitely people. The weather was cloudy, and it seemed like it might be cold&#xA;in the alpine.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Mount Fosthall</title>
      <link>https://unorde.red/mount-fosthall/</link>
      <pubDate>Sat, 22 Jul 2023 00:00:00 +0000</pubDate>
      <guid>https://unorde.red/mount-fosthall/</guid>
      <description>&lt;ul&gt;&#xA;&lt;li&gt;2686m (816m prominence)&lt;/li&gt;&#xA;&lt;li&gt;Monashee Mountains, Gold Range&lt;/li&gt;&#xA;&lt;li&gt;Monashee Provincial Park, BC&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;There are two standard ways to do Mount Fosthall, both gaining the south ridge&#xA;from the south east.&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;The easiest is probably to start at the Sol Mountain Lodge from the east,&#xA;taking the South Caribou Pass Trail to the Mount Fosthall route. This&#xA;shouldn&amp;rsquo;t be much more than 1000m elevation gain, and is much shorter than the&#xA;other route.&lt;/li&gt;&#xA;&lt;li&gt;The other way is to start from the Spectrum Lake trailhead to the west,&#xA;taking the long way around the mountain before meeting up with the Mount&#xA;Fosthall route. Out and back, this is a 39km route with 2300m of elevation.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;p&gt;Because the Spectrum Lake trailhead was 2 hours closer by car&#xA;and also offered more of a challenge, the choice was easy.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Trip report: Cape Wrath Trail</title>
      <link>https://unorde.red/cape-wrath-trail/</link>
      <pubDate>Thu, 05 Nov 2020 00:00:00 +0000</pubDate>
      <guid>https://unorde.red/cape-wrath-trail/</guid>
      <description>&lt;p&gt;&lt;em&gt;The Cape Wrath Trail is an approximately 350 km (220 mi) walk through the&#xA;Scottish Highlands, stretching from Fort William to the northwesternmost point&#xA;of mainland Britain, Cape Wrath. The route is unmarked and there is no official&#xA;line. It has the reputation of being Britain&amp;rsquo;s toughest long distance walk.&lt;/em&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&#34;https://unorde.red/assets/cape-wrath-map.png&#34; alt=&#34;Cape Wrath Trail map&#34;&gt;&lt;/p&gt;&#xA;&lt;p&gt;In the fall of 2020 I hiked the Cape Wrath Trail solo in eleven days. This trail&#xA;already has its share of uncertainty, but the global pandemic raging in the&#xA;background brought a few more.&lt;/p&gt;</description>
    </item>
    <item>
      <title>DamCTF: crypto/guess-secret</title>
      <link>https://unorde.red/damctf-crypto-guess-secret/</link>
      <pubDate>Mon, 12 Oct 2020 00:00:00 +0000</pubDate>
      <guid>https://unorde.red/damctf-crypto-guess-secret/</guid>
      <description>&lt;p&gt;This challenge asks us to break a &amp;lsquo;super secure and efficient communication&#xA;method&amp;rsquo;. It also gives us the server code, although this isn&amp;rsquo;t really&#xA;necessary&amp;mdash;the server itself tells us all we need to know.&lt;/p&gt;&#xA;&lt;p&gt;The server explains in detail what it does. It accepts a string, and creates the&#xA;plaintext by concatenating it to the flag. The plaintext is then compressed&#xA;using the lossless deflate (zlib) algorithm. Lastly, the compressed data is&#xA;encrypted using AES_CTR_128. The resulting ciphertext is returned to us.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Bazel, Go and Protobufs</title>
      <link>https://unorde.red/bazel-go-and-protobufs/</link>
      <pubDate>Mon, 20 Apr 2020 00:00:00 +0000</pubDate>
      <guid>https://unorde.red/bazel-go-and-protobufs/</guid>
      <description>&lt;p&gt;Suppose you&amp;rsquo;re setting up your first project using Bazel, written in Go and&#xA;using Protobufs as a data format.&lt;/p&gt;&#xA;&lt;p&gt;It&amp;rsquo;s easy to make mistakes. I did, and ended up with the following build error:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;compilepkg: error running subcommand: &lt;span class=&#34;nb&#34;&gt;exit&lt;/span&gt; status &lt;span class=&#34;m&#34;&gt;2&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;/***/file.go:xx:xx: cannot use o &lt;span class=&#34;o&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nb&#34;&gt;type&lt;/span&gt; *protopb.Object&lt;span class=&#34;o&#34;&gt;)&lt;/span&gt; as &lt;span class=&#34;nb&#34;&gt;type&lt;/span&gt; protoreflect.ProtoMessage in argument to &lt;span class=&#34;s2&#34;&gt;&amp;#34;google.golang.org/protobuf/proto&amp;#34;&lt;/span&gt;.Unmarshal:&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&#x9;*protopb.Object does not implement protoreflect.ProtoMessage &lt;span class=&#34;o&#34;&gt;(&lt;/span&gt;missing ProtoReflect method&lt;span class=&#34;o&#34;&gt;)&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;/***/file.go:yy:yy: cannot use o &lt;span class=&#34;o&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nb&#34;&gt;type&lt;/span&gt; *protopb.Object&lt;span class=&#34;o&#34;&gt;)&lt;/span&gt; as &lt;span class=&#34;nb&#34;&gt;type&lt;/span&gt; protoreflect.ProtoMessage in argument to &lt;span class=&#34;s2&#34;&gt;&amp;#34;google.golang.org/protobuf/proto&amp;#34;&lt;/span&gt;.Marshal:&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&#x9;*protopb.Object does not implement protoreflect.ProtoMessage &lt;span class=&#34;o&#34;&gt;(&lt;/span&gt;missing ProtoReflect method&lt;span class=&#34;o&#34;&gt;)&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;In particular, the phrase &amp;ldquo;missing ProtoReflect method&amp;rdquo; was unknown&lt;sup id=&#34;fnref:1&#34;&gt;&lt;a href=&#34;#fn:1&#34; class=&#34;footnote-ref&#34; role=&#34;doc-noteref&#34;&gt;1&lt;/a&gt;&lt;/sup&gt; to&#xA;Google at time of writing!&lt;/p&gt;</description>
    </item>
    <item>
      <title>Exploring Facebook&#39;s network</title>
      <link>https://unorde.red/exploring-facebooks-network/</link>
      <pubDate>Fri, 28 Feb 2020 00:00:00 +0000</pubDate>
      <guid>https://unorde.red/exploring-facebooks-network/</guid>
      <description>&lt;p&gt;What does the (physical) network of a big internet company like Facebook look&#xA;like? I&amp;rsquo;m going to try to find out. I&amp;rsquo;ll be making a lot of assumptions, loosely&#xA;backed by informaton gathered from possibly out of date sources. I&amp;rsquo;ll try to be&#xA;explicit when something is guesswork.&lt;/p&gt;&#xA;&lt;p&gt;A good place to start is the traceroute tool. By default it performs reverse DNS&#xA;lookups for each hop. This often reveals interesting information, and&#xA;facebook.com is no exception.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Sanity checks</title>
      <link>https://unorde.red/sanity-checks/</link>
      <pubDate>Sat, 14 Dec 2019 00:00:00 +0000</pubDate>
      <guid>https://unorde.red/sanity-checks/</guid>
      <description>&lt;p&gt;In my line of work I&amp;rsquo;ve dealt with a lot of automated data pipelines that feed&#xA;into production systems.&lt;/p&gt;&#xA;&lt;p&gt;Validating the output of these pipelines in an automated manner is frequently&#xA;difficult. Suppose you had a different data source you could validate against.&#xA;If you could reliably tell whether your pipeline was producing invalid data&#xA;using this data source, why not directly incorporate this data into your&#xA;pipeline? Alternatively, if the data source isn&amp;rsquo;t reliable enough to do so,&#xA;chances are you&amp;rsquo;ll need a human to come look at the diffs either way.&lt;/p&gt;</description>
    </item>
    <item>
      <title>RedpwnCTF: mallcop</title>
      <link>https://unorde.red/redpwnctf-mallcop/</link>
      <pubDate>Sat, 17 Aug 2019 00:00:00 +0000</pubDate>
      <guid>https://unorde.red/redpwnctf-mallcop/</guid>
      <description>&lt;p&gt;Mallcop was the least-solved challenge in the Misc category. We were given a&#xA;zipped file of 20 problem instances. The server gives us the following problem&#xA;description:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-txt&#34; data-lang=&#34;txt&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;Sick of Chick-fil-A, Daniel&amp;#39;s son deserts him to make a break for the parking&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;lot. (Un?)fortunately, Max the Mall Cop is here to help!  The n stores in the&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;mall are connected by walkways such that none of them form a cycle; in other&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;words, there is exactly one path from one store to another. Daniel&amp;#39;s son was&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;last seen at store k.  Stores connected to only one store lead to a parking lot.&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;Max the Mall Cop decides to station his miniature clones at some of these&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;parking lot stores.  Every minute, Daniel&amp;#39;s son and the miniature Maxes can move&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;one meter towards an adjacent store or stay put. Daniel&amp;#39;s son is caught when he&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;coincides with a miniature Max at a store or a walkway.  What is the minimum&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;number of miniature Maxes that Max the Mall Cop should station to ensure that&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;Daniel&amp;#39;s son cannot reach a parking lot?&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;Input:&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    First line: n, k&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    Next n-1 lines: a, b, x indicating a walkway between stores a and b with&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;        length x meters&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;Output:&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    One line with the minimum miniature Maxes needed.&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;Download the testcases from in.zip and enter your output here.&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The server has us give the answer to each of the 20 instances one at a time, and&#xA;then disconnects us without giving any information if we got it wrong.&lt;/p&gt;</description>
    </item>
    <item>
      <title>RedpwnCTF: Alien Transmissions</title>
      <link>https://unorde.red/redpwnctf-alien-transmissions/</link>
      <pubDate>Fri, 16 Aug 2019 00:00:00 +0000</pubDate>
      <guid>https://unorde.red/redpwnctf-alien-transmissions/</guid>
      <description>&lt;p&gt;This was one of the higher scoring challenges I completed. We&amp;rsquo;re given the&#xA;following description:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-txt&#34; data-lang=&#34;txt&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;Brownie plugged his USB stick in, ready to take a look at the alien&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;transmissions he had received. However, when he opened the document, he&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;discovered that it was all encrypted! Brownie remembered overhearing Tux&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;bragging about a 38 character xor key, and realized that he must have encrypted&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;his document. Help Brownie find the key to decrypt the transmissions!&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;The transmission list is formatted as a list of strings delimited by ։. Here&amp;#39;s&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;an example list: /Z։Tk8V։gF։ue3T։dae9#&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;Note: ։ is not the regular English colon.&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The description pretty much gives it away. We&amp;rsquo;re looking at a simple XOR cipher&#xA;with a 38 character key. The key insight here is that every 38th character will&#xA;be XORed with the same char. Combining all of these characters into a string&#xA;allows you to do frequency analysis and hopefully recover the char. Rinse and&#xA;repeat to get the whole key and decrypt the message.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Playing with ICMP and NAT</title>
      <link>https://unorde.red/icmp-and-nat/</link>
      <pubDate>Mon, 18 Feb 2019 00:00:00 +0000</pubDate>
      <guid>https://unorde.red/icmp-and-nat/</guid>
      <description>&lt;p&gt;ICMP stands for Internet Control Message Protocol. It is used by network devices&#xA;to send error messages and operational information. If you&amp;rsquo;ve ever used &lt;code&gt;ping&lt;/code&gt;&#xA;to poke a machine, you&amp;rsquo;ve used the ICMP protocol!&lt;/p&gt;&#xA;&lt;p&gt;The ICMP protocol is very simple. It is considered a layer 3 protocol, and&#xA;messages are wrapped by IP. The header consists of several fields. The first&#xA;byte is a numeric type. For example, 8 is an IPv4 echo request, while 0 is an&#xA;IPv4 echo reply. Next is a code that expands on the type, then a checksum and&#xA;finally 4 bytes that depend on the type/code. For ping, these four bytes consist&#xA;of an identifier and a sequence number. After the header there may be a payload.&lt;/p&gt;</description>
    </item>
    <item>
      <title>uid</title>
      <link>https://unorde.red/uid/</link>
      <pubDate>Sat, 17 Mar 2018 00:00:00 +0000</pubDate>
      <guid>https://unorde.red/uid/</guid>
      <description>&lt;p&gt;What happens when an unprivileged user runs the binary&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-txt&#34; data-lang=&#34;txt&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;-r-s---r-x  1 root root 1024 Mar 17 21:57 binary&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;which executes the following lines of code?&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-c&#34; data-lang=&#34;c&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nf&#34;&gt;setreuid&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;geteuid&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(),&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;geteuid&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;());&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nf&#34;&gt;system&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;/bin/sh&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Let&amp;rsquo;s find out. First, we need to understand what a uid is.&lt;/p&gt;&#xA;&lt;p&gt;The POSIX standard defines three different user identifiers. These allow&#xA;processes to dynamically take on different roles, providing they have the&#xA;required privileges.&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;The &lt;strong&gt;real uid&lt;/strong&gt; identifies the (real) owner of a process. The real uid can&#xA;be manipulated with &lt;code&gt;getuid()&lt;/code&gt; and &lt;code&gt;setreuid(uid_t ruid, uid_t euid)&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;li&gt;The &lt;strong&gt;effective uid&lt;/strong&gt; of a process is used for access control. It is also&#xA;used as the owner for files created by that process. See &lt;code&gt;geteuid(void)&lt;/code&gt; and&#xA;&lt;code&gt;seteuid(uid_t euid)&lt;/code&gt; (note that confusingly, &lt;code&gt;setuid&lt;/code&gt; also sets the&#xA;effective uid).&lt;/li&gt;&#xA;&lt;li&gt;The &lt;strong&gt;saved uid&lt;/strong&gt; is used to store the effective user id when it is changed&#xA;temporarily. For example, a privileged process may need do some unprivileged&#xA;work. To do this, it would change its euid. But it would not be able to&#xA;change back unless its original (privileged) euid was stored somewhere.&#xA;That&amp;rsquo;s where the saved uid comes in: an unprivileged process may set its euid&#xA;exclusively to one of uid, suid, or euid.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;p&gt;Processes are managed by the kernel using a process descriptor. In practice,&#xA;this is a &lt;code&gt;task_struct&lt;/code&gt;&#xA;&lt;a href=&#34;https://github.com/torvalds/linux/blob/8f5fd927c3a7576d57248a2d7a0861c3f2795973/include/linux/sched.h#L524&#34;&gt;struct&lt;/a&gt;,&#xA;containing all the process information that the kernel needs. This includes a&#xA;pointer to a &lt;code&gt;cred&lt;/code&gt;&#xA;&lt;a href=&#34;https://github.com/torvalds/linux/blob/8f5fd927c3a7576d57248a2d7a0861c3f2795973/include/linux/cred.h#L111&#34;&gt;struct&lt;/a&gt;,&#xA;which stores the different uids mentioned above. This is how the kernel&#xA;determines whether or not a process has the privileges to do something.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Cryptobin</title>
      <link>https://unorde.red/cryptobin/</link>
      <pubDate>Thu, 04 Jan 2018 00:00:00 +0000</pubDate>
      <guid>https://unorde.red/cryptobin/</guid>
      <description>&lt;p&gt;Over the holidays I spent some time on two different but related sets of&#xA;challenges.&lt;/p&gt;&#xA;&lt;p&gt;The first was the Krypton wargame at &lt;a href=&#34;https://overthewire.org&#34;&gt;OverTheWire&lt;/a&gt;.&#xA;This wargame goes over some basic classical cryptography. I was a bit&#xA;disappointed in the last level, I don&amp;rsquo;t think the way I solved it was the&#xA;intention of the author. It certainly didn&amp;rsquo;t match the level text.&lt;/p&gt;&#xA;&lt;p&gt;The second was the &lt;a href=&#34;https://www.aivd.nl/onderwerpen/informatiebeveiliging/het-nationaal-bureau-voor-verbindingsbeveiliging-nbv/aivd-kerstpuzzel-2017&#34;&gt;AIVD&#xA;kerstpuzzel&lt;/a&gt;,&#xA;which is an annual Christmas puzzle produced by the Dutch equivalent of the CIA.&#xA;This year&amp;rsquo;s edition was particularly difficult (at least, this is what I read&#xA;online). There was some cryptography, word puzzles, number sequences, and a lot&#xA;of pattern recognition. I didn&amp;rsquo;t get very far.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Internet 101: TCP</title>
      <link>https://unorde.red/tcp/</link>
      <pubDate>Sat, 04 Nov 2017 00:00:00 +0000</pubDate>
      <guid>https://unorde.red/tcp/</guid>
      <description>&lt;p&gt;&lt;em&gt;This article assumes the reader has basic knowledge of &lt;a href=&#34;https://unorde.red/ip/&#34;&gt;IP&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;&#xA;&lt;p&gt;IP gives us addressing and the ability to send packets from one machine on the&#xA;internet to another, assuming that routing is configured correctly at each hop.&#xA;However, it provides little else.&lt;/p&gt;&#xA;&lt;p&gt;Imagine trying to send a large file over IP. Due to the length restriction on IP&#xA;packets, the file is broken up into chunks, and each chunk is sent in order as&#xA;an IP packet. In this scenario, any number of things can go wrong. An unreliable&#xA;link may corrupt a packet. A router may choose to route one or more packets&#xA;differently from the others. Packets may be silently dropped or duplicated in&#xA;misconfigured networking devices. Eventually, the destination machine receives&#xA;the packets out of order, with some missing, corrupted or duplicated. Obviously,&#xA;reliably reconstructing the file from these packets is impossible.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Internet 101: Autonomous systems</title>
      <link>https://unorde.red/autonomous-systems/</link>
      <pubDate>Tue, 10 Oct 2017 00:00:00 +0000</pubDate>
      <guid>https://unorde.red/autonomous-systems/</guid>
      <description>&lt;p&gt;&lt;em&gt;This article assumes basic knowledge of &lt;a href=&#34;https://unorde.red/ip/&#34;&gt;IP&lt;/a&gt; and&#xA;&lt;a href=&#34;https://unorde.red/cidr/&#34;&gt;CIDR&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;&#xA;&lt;p&gt;The internet is made up of a huge number of networks. These networks are owned&#xA;by many different entities in many different countries, who each control one or&#xA;many IP prefixes. The IANA and the internet registries under it allocate the&#xA;prefixes. But how are these networks identified, and how does traffic flow&#xA;between them?&lt;/p&gt;&#xA;&lt;p&gt;An autonomous system is collection of IP prefixes controlled by a single entity.&#xA;This entity can be an ISP, large company, government or academic institution.&#xA;The IANA, via the internet registries under it, allocates a unique number (32&#xA;bits, used to be 16) to every such entity. This is called an ASN, or autonomous&#xA;system number.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Internet 101: CIDR</title>
      <link>https://unorde.red/cidr/</link>
      <pubDate>Mon, 09 Oct 2017 00:00:00 +0000</pubDate>
      <guid>https://unorde.red/cidr/</guid>
      <description>&lt;p&gt;&lt;em&gt;This article assumes the reader has basic knowledge of &lt;a href=&#34;https://unorde.red/ip/&#34;&gt;IP&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;&#xA;&lt;p&gt;IP defines the IP address, and the packets that are sent across networks.&#xA;However, it doesn&amp;rsquo;t state how the packets are routed. What happens when a packet&#xA;arrives at a router? The only information the router has is the destination&#xA;address. If it isn&amp;rsquo;t directly connected to the machine hosting this address, how&#xA;will it know where to send the packet?&lt;/p&gt;</description>
    </item>
    <item>
      <title>Internet 101: IP</title>
      <link>https://unorde.red/ip/</link>
      <pubDate>Sun, 08 Oct 2017 00:00:00 +0000</pubDate>
      <guid>https://unorde.red/ip/</guid>
      <description>&lt;p&gt;The Internet Protocol is responsible for moving data across network boundaries.&#xA;How does it do this?&lt;/p&gt;&#xA;&lt;h3 id=&#34;addressing&#34;&gt;Addressing&lt;/h3&gt;&#xA;&lt;p&gt;To route data on a multi node path from one machine to another, it is necessary&#xA;to uniquely and deterministically identify the source and destination machine&#xA;(it should be noted that this idea is abused a lot in the wild). IP does this by&#xA;defining a numerical IP address.&lt;/p&gt;&#xA;&lt;p&gt;For IPv4, this is a 32 bit number (e.g. 172.16.254.1). Since the number of&#xA;possible IPv4 addresses is grossly insufficient, IPv6 defines a 128 bit number.&#xA;IPv6 addresses are typically shown using eight four-digit hexadecimal numbers&#xA;delimited by colons (e.g. 2001:db8:0:1234:0:567:8:1).&lt;/p&gt;</description>
    </item>
    <item>
      <title>Hashwalk</title>
      <link>https://unorde.red/hashwalk/</link>
      <pubDate>Fri, 29 Sep 2017 00:00:00 +0000</pubDate>
      <guid>https://unorde.red/hashwalk/</guid>
      <description>&lt;p&gt;&lt;a href=&#34;https://github.com/avanpo/hashwalk&#34;&gt;Hashwalk&lt;/a&gt; is an exercise in futility. It&#xA;attempts to mount a preimage attack on a cryptographic hash function by using&#xA;local search. This is essentially a poor man&amp;rsquo;s differential cryptanalysis.&lt;/p&gt;&#xA;&lt;p&gt;A good, general purpose cryptographic hash function should exhibit the avalanche&#xA;effect. This means that a small change in the input (e.g. a single bit flip)&#xA;results in a large change in the output (e.g. approximately half of the bits&#xA;being flipped). In other words, the function should be psuedorandom. A hash&#xA;function that isn&amp;rsquo;t psuedorandom is unsuitable for many cryptographic use cases,&#xA;since it may leak information on the data being hashed.&lt;/p&gt;</description>
    </item>
    <item>
      <title>OverTheWire: Bandit</title>
      <link>https://unorde.red/overthewire-bandit/</link>
      <pubDate>Sat, 10 Jun 2017 00:00:00 +0000</pubDate>
      <guid>https://unorde.red/overthewire-bandit/</guid>
      <description>&lt;p&gt;Today I finished the Bandit wargame at &lt;a href=&#34;https://overthewire.org&#34;&gt;OverTheWire&lt;/a&gt;.&#xA;It was a lot of fun! It&amp;rsquo;s aimed at players looking to become familiar with the&#xA;command line and basic linux tooling. I got to use a lot of utilities from&#xA;coreutils that I didn&amp;rsquo;t even know existed.&lt;/p&gt;&#xA;&lt;p&gt;I was familiar with nearly all of the concepts touched on in the levels. Despite&#xA;this, I still managed to get stuck several times. Understanding the concepts on&#xA;a higher level often isn&amp;rsquo;t enough &amp;ndash; sometimes you really need to understand the&#xA;utility intimately to get the job done. Reading man pages is good for you.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Character encoding refresher</title>
      <link>https://unorde.red/character-encoding-refresher/</link>
      <pubDate>Mon, 20 Mar 2017 00:00:00 +0000</pubDate>
      <guid>https://unorde.red/character-encoding-refresher/</guid>
      <description>&lt;p&gt;Sometimes I forget the details on different character encodings. Maybe you do&#xA;too.&lt;/p&gt;&#xA;&lt;h3 id=&#34;unicode&#34;&gt;Unicode&lt;/h3&gt;&#xA;&lt;p&gt;Unicode is a standard designed to facilitate consistent encoding and&#xA;representation of text. Unicode encodes graphemes to code points, where a&#xA;grapheme is the smallest unit of a writing system of a language. A code point is&#xA;a number. So Unicode by itself is not enough to store text on a computer, since&#xA;the way that the code points should be stored in memory is not defined.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Topological sorts</title>
      <link>https://unorde.red/topological-sorts/</link>
      <pubDate>Sun, 12 Mar 2017 00:00:00 +0000</pubDate>
      <guid>https://unorde.red/topological-sorts/</guid>
      <description>&lt;p&gt;Detecting and finding cycles in directed graphs are common problems in graph theory. A while back I was looking for an algorithm to detect whether a graph had a cycle or not, and it turns out there are a lot of different ways to approach this. Ultimately, the best method to use will probably depend on why you&amp;rsquo;re looking for cycles, and what you want to do with them (or their absence).&lt;/p&gt;</description>
    </item>
    <item>
      <title>Spring, @PathVariable, dots, and failed exception handling</title>
      <link>https://unorde.red/spring-pathvariable-dots-failed-exception-handling/</link>
      <pubDate>Thu, 12 Jan 2017 00:00:00 +0000</pubDate>
      <guid>https://unorde.red/spring-pathvariable-dots-failed-exception-handling/</guid>
      <description>&lt;p&gt;If you use Spring Boot to set up an endpoint using &lt;code&gt;@RequestMapping&lt;/code&gt; with a&#xA;&lt;code&gt;@PathVariable&lt;/code&gt; at the end of the request URI, you might run into several quirks&#xA;if this path variable happens to include a dot. For example, consider the&#xA;following mapping:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-java&#34; data-lang=&#34;java&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nd&#34;&gt;@RequestMapping&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;value&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;/api/resource/{id}&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;method&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;RequestMethod&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;na&#34;&gt;GET&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nd&#34;&gt;@ResponseBody&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;kd&#34;&gt;public&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Resource&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;getResource&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nd&#34;&gt;@PathVariable&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;id&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;kd&#34;&gt;final&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;String&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;id&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;  &lt;/span&gt;&lt;span class=&#34;kd&#34;&gt;final&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Resource&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;resource&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;resourceService&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;na&#34;&gt;findById&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;id&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;  &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;if&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;resource&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;o&#34;&gt;==&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;kc&#34;&gt;null&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;    &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;throw&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;new&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;ResourceNotFoundException&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;();&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;  &lt;/span&gt;&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;  &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;return&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;resource&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This mapping returns a &lt;code&gt;Resource&lt;/code&gt; object in the response body, which is&#xA;serialized to JSON using Jackson2. Let&amp;rsquo;s also assume that we handle the&#xA;&lt;code&gt;ResourceNotFoundException&lt;/code&gt; using an &lt;code&gt;@ExceptionHandler&lt;/code&gt;.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Lattices and sphere packings</title>
      <link>https://unorde.red/lattices-and-sphere-packings/</link>
      <pubDate>Sun, 11 Dec 2016 00:00:00 +0000</pubDate>
      <guid>https://unorde.red/lattices-and-sphere-packings/</guid>
      <description>&lt;p&gt;&lt;em&gt;This article assumes basic knowledge of linear algebra and group theory.&lt;/em&gt;&lt;/p&gt;&#xA;&lt;p&gt;What is a lattice? Good question. First, we&amp;rsquo;ll need to define some concepts.&lt;/p&gt;&#xA;&lt;h2 id=&#34;definitions&#34;&gt;Definitions&lt;/h2&gt;&#xA;&lt;p&gt;When we think of the word &lt;em&gt;lattice&lt;/em&gt;, we most likely envision some kind of spacial structure. The faces of a crystal, or the metal beams of a bridge that form a repeating pattern of shapes. Using mathematics, we can distill this structure down to a periodic arrangement of points in some \(n\)-dimensional space.&lt;/p&gt;</description>
    </item>
    <item>
      <title>AVR programming with Arduino</title>
      <link>https://unorde.red/avr-programming/</link>
      <pubDate>Tue, 11 Oct 2016 00:00:00 +0000</pubDate>
      <guid>https://unorde.red/avr-programming/</guid>
      <description>&lt;p&gt;&lt;em&gt;Written by &lt;a href=&#34;https://vvanpo.github.io/%22&#34;&gt;Victor van Poppelen&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;&#xA;&lt;h2 id=&#34;the-arduino-nano&#34;&gt;The Arduino Nano&lt;/h2&gt;&#xA;&lt;p&gt;The Nano is a very simple board, essentially just an AVR &lt;!-- raw HTML omitted --&gt;MCU&lt;!-- raw HTML omitted --&gt; with an FTDI chip for communicating over USB.  On the top left of the schematic&lt;sup id=&#34;fnref:1&#34;&gt;&lt;a href=&#34;#fn:1&#34; class=&#34;footnote-ref&#34; role=&#34;doc-noteref&#34;&gt;1&lt;/a&gt;&lt;/sup&gt; is the pinout of the board, and in the centre is the pinout of the AVR chip (an ATmega328 or ATmega328p)&lt;sup id=&#34;fnref:2&#34;&gt;&lt;a href=&#34;#fn:2&#34; class=&#34;footnote-ref&#34; role=&#34;doc-noteref&#34;&gt;2&lt;/a&gt;&lt;/sup&gt;.&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&#34;https://unorde.red/assets/arduino-nano-atmega328.png&#34; alt=&#34;ATmega328 schematic&#34;&gt;&lt;/p&gt;&#xA;&lt;p&gt;You can follow the pins to various components, and/or directly to the pins of&#xA;the board itself.  For example, the &lt;code&gt;D0/TX&lt;/code&gt; and &lt;code&gt;D1/RX&lt;/code&gt; pins on the board are&#xA;connected to the &lt;code&gt;PD0&lt;/code&gt; and &lt;code&gt;PD1&lt;/code&gt; pins of the AVR, which are the &lt;!-- raw HTML omitted --&gt;UART&lt;!-- raw HTML omitted --&gt; TX and RX pins.&#xA;The schematic is confusing at first but gets simpler once you see that every&#xA;label is unique, and anywhere a label appears multiple times means they are&#xA;connected at those points within the board.  So, in the case of the &lt;code&gt;D0&lt;/code&gt; and&#xA;&lt;code&gt;D1&lt;/code&gt; pins, they are connected to the AVR directly &lt;em&gt;before&lt;/em&gt; the 1k resistors&#xA;&lt;code&gt;RP1B&lt;/code&gt; and &lt;code&gt;RP1C&lt;/code&gt;, which are in turn connected to the &lt;code&gt;TXD&lt;/code&gt; and &lt;code&gt;RXD&lt;/code&gt; pins of&#xA;the FT232RL (via the &lt;code&gt;RX&lt;/code&gt; and &lt;code&gt;TX&lt;/code&gt; labels, respectively).  The FT232RL chip&lt;sup id=&#34;fnref:3&#34;&gt;&lt;a href=&#34;#fn:3&#34; class=&#34;footnote-ref&#34; role=&#34;doc-noteref&#34;&gt;3&lt;/a&gt;&lt;/sup&gt;&#xA;is a USB slave to UART converter that connects to the mini-USB connector&#xA;(labelled &lt;code&gt;USB-MINI-B%C&lt;/code&gt;).&lt;/p&gt;</description>
    </item>
    <item>
      <title>What is Diffie-Hellman?</title>
      <link>https://unorde.red/what-is-diffie-hellman/</link>
      <pubDate>Tue, 15 Mar 2016 00:00:00 +0000</pubDate>
      <guid>https://unorde.red/what-is-diffie-hellman/</guid>
      <description>&lt;p&gt;&lt;em&gt;This article assumes knowledge of basic group theory, and basic asymptotic complexity (big O notation).&lt;/em&gt;&lt;/p&gt;&#xA;&lt;p&gt;For efficiency reasons, most encryption used on the internet and elsewhere is done using symmetric-key algorithms. A symmetric key algorithm uses one key for both encryption and decryption. This requires the sender and receiver to share knowledge of a secret key. For two parties who have never communicated securely before, this is a non-trivial problem. How does one establish a shared secret using insecure channels? This is where a key exchange algorithm like Diffie-Hellman comes in.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Styling machine schedules in LaTeX</title>
      <link>https://unorde.red/styling-machine-schedules-in-latex/</link>
      <pubDate>Sat, 23 Jan 2016 00:00:00 +0000</pubDate>
      <guid>https://unorde.red/styling-machine-schedules-in-latex/</guid>
      <description>&lt;p&gt;Recently I worked on a project about the Job Shop Problem, and came across the need to visualize the machine schedules that were being generated. A quick search revealed the type of diagram I was looking for to be the Gantt chart. There&amp;rsquo;s a lot of tools that can produce these kinds of charts from data, like this &lt;a href=&#34;https://github.com/losalamos/Gazebo/blob/master/bin/util/Gantt/gantt.py&#34;&gt;python script&lt;/a&gt; in combination with gnuplot. However, I wasn&amp;rsquo;t looking to make a chart from data, and preferred to do it inside LaTeX, without embedding any images (to be fair, gnuplot is capable of outputting latex markup &amp;ndash; but it seemed quicker to do myself).&lt;/p&gt;</description>
    </item>
    <item>
      <title>Microcorruption CTF: Hollywood</title>
      <link>https://unorde.red/microcorruption-ctf-hollywood/</link>
      <pubDate>Sun, 20 Dec 2015 00:00:00 +0000</pubDate>
      <guid>https://unorde.red/microcorruption-ctf-hollywood/</guid>
      <description>&lt;p&gt;This is my writeup for &amp;ldquo;Hollywood&amp;rdquo;, the very last level on the &lt;a href=&#34;https://microcorruption.com&#34;&gt;Microcorruption&lt;/a&gt; CTF. Like usual, if you haven&amp;rsquo;t already solved it or given it your very best shot, you should stop reading and go do that now. This level doesn&amp;rsquo;t have any clever tricks, it just takes perseverance.&lt;/p&gt;&#xA;&lt;h2 id=&#34;intro&#34;&gt;Intro&lt;/h2&gt;&#xA;&lt;p&gt;The introduction text reveals two things. One is randomization, and the second is that there are no hardware modules attached. If this lock is to open using a valid password, it means that the password is checked within the binary, and thus the password must also exist somewhere in the binary. All we have to do is reverse engineer until we find it. Of course, some previous locks lacked legitimate means of opening them, but given the obvious theme of this level, I figured it was probably safe to assume the password existed somewhere.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Microcorruption CTF: Chernobyl</title>
      <link>https://unorde.red/microcorruption-ctf-chernobyl/</link>
      <pubDate>Fri, 18 Dec 2015 00:00:00 +0000</pubDate>
      <guid>https://unorde.red/microcorruption-ctf-chernobyl/</guid>
      <description>&lt;p&gt;This is my writeup for &amp;ldquo;Chernobyl&amp;rdquo;, the second to last level on the &lt;a href=&#34;https://microcorruption.com&#34;&gt;Microcorruption&lt;/a&gt; CTF. Like usual, if you haven&amp;rsquo;t already solved it or given it your very best shot, you should stop reading and go do that now.&lt;/p&gt;&#xA;&lt;h2 id=&#34;the-input&#34;&gt;The input&lt;/h2&gt;&#xA;&lt;p&gt;This binary is pretty big compared to previous levels. There&amp;rsquo;s a lot more functionality, and I spent a fair bit of time getting acquainted with the program.&lt;/p&gt;&#xA;&lt;p&gt;I first stepped through some test inputs to see what was going on. The first character is tested against 0x61, or &amp;lsquo;a&amp;rsquo;, and then against &amp;rsquo;n&amp;rsquo;. A bit more digging revealed the following information:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Microcorruption CTF: Lagos</title>
      <link>https://unorde.red/microcorruption-ctf-lagos/</link>
      <pubDate>Tue, 15 Dec 2015 00:00:00 +0000</pubDate>
      <guid>https://unorde.red/microcorruption-ctf-lagos/</guid>
      <description>&lt;p&gt;This is my writeup for the &amp;ldquo;Lagos&amp;rdquo; level in the &lt;a href=&#34;https://microcorruption.com&#34;&gt;Microcorruption&lt;/a&gt; CTF. It goes through my (naive) thought process and my initial solution. If you haven&amp;rsquo;t already solved it or given it your best shot, you should probably stop reading and do that first.&lt;/p&gt;&#xA;&lt;h2 id=&#34;the-filter&#34;&gt;The filter&lt;/h2&gt;&#xA;&lt;p&gt;This level takes your input from the heap, and filters out non-alphanumeric characters before copying them to the stack. As soon as a non-alphanumeric character is reached, the copying stops. There is a familiar &lt;code&gt;conditional_unlock_door&lt;/code&gt; function that uses the &lt;code&gt;INT 0x7E&lt;/code&gt; interrupt. It also uses &lt;code&gt;memset&lt;/code&gt; to wipe the heap clean before testing the password copied to the stack. The overflow is potentially quite large, as up to 0x200 characters are taken as input.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Microcorruption CTF: Bangalore</title>
      <link>https://unorde.red/microcorruption-ctf-bangalore/</link>
      <pubDate>Mon, 14 Dec 2015 00:00:00 +0000</pubDate>
      <guid>https://unorde.red/microcorruption-ctf-bangalore/</guid>
      <description>&lt;p&gt;This is my writeup for the &amp;ldquo;Bangalore&amp;rdquo; level on the &lt;a href=&#34;https://microcorruption.com&#34;&gt;Microcorruption&lt;/a&gt; CTF. If you haven&amp;rsquo;t already solved it or given it your best shot, you should probably stop reading and go do that first.&lt;/p&gt;&#xA;&lt;p&gt;This level introduces the concept of DEP, or Data Execution Prevention. You can read a lot about DEP elsewhere, but the gist of it is in the name&amp;mdash;it prevents instructions from being executed in certain areas of memory. So simply injecting and running your favorite shellcode will no longer work, if that area of memory is marked as non-executable. We will have to find a way around DEP. Let&amp;rsquo;s check the Lock Manual for the specifics.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Particle swarm optimization</title>
      <link>https://unorde.red/particle-swarm-optimization/</link>
      <pubDate>Wed, 15 Jul 2015 00:00:00 +0000</pubDate>
      <guid>https://unorde.red/particle-swarm-optimization/</guid>
      <description>&lt;p&gt;Particle swarm optimization (PSO) is a local search metaheuristic. It was initially developed by Kennedy, Eberhart and Shi in the late 1990s, and was meant to simulate social behaviour such as birds flocking to a promising position in a multi-dimensional space. A simplified version of the algorithm was found to perform optimization, which led to its adoptation as a local search algorithm.&lt;/p&gt;&#xA;&lt;p&gt;The algorithm is easy to implement, and makes very few assumptions about the problem. PSO can be applied to a wide range of optimization problems, as it does not use the objective function&amp;rsquo;s gradient and therefore does not require the objective function to be differentiable.&lt;/p&gt;</description>
    </item>
    <item>
      <title>0</title>
      <link>https://unorde.red/0/</link>
      <pubDate>Sun, 21 Jun 2015 00:00:00 +0000</pubDate>
      <guid>https://unorde.red/0/</guid>
      <description>&lt;p&gt;Hi, I&amp;rsquo;m Alex and I&amp;rsquo;ll be writing about stuff that I&amp;rsquo;m interested in. Right now&#xA;that includes algorithm design, cryptography, infosec and data mining, but that&#xA;may change in the future.&lt;/p&gt;&#xA;&lt;p&gt;I&amp;rsquo;m not the best at keeping a blog going, but we&amp;rsquo;ll see how it goes this time.&lt;/p&gt;</description>
    </item>
    <item>
      <title>About</title>
      <link>https://unorde.red/about/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      <guid>https://unorde.red/about/</guid>
      <description>&lt;p&gt;Hi, my name is Alex van Poppelen. This is my digital space, where I write about&#xA;things that interest me.&lt;/p&gt;&#xA;&lt;p&gt;I&amp;rsquo;m a Senior Software Engineer at Google. I work on Google&amp;rsquo;s network&#xA;infrastructure. I&amp;rsquo;ve worked as an SRE, on DNS, load balancing, traffic&#xA;engineering, security and a lot of data and configuration pipelines.&lt;/p&gt;&#xA;&lt;p&gt;Before Google, I completed an M.Sc. in Computer Science where I wrote my&#xA;&lt;a href=&#34;https://eprint.iacr.org/2016/1050&#34;&gt;thesis&lt;/a&gt; on the intersection of coding theory&#xA;and lattice cryptography, followed by a short stint in the security and identity&#xA;management industry at a small scale-up.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Archive</title>
      <link>https://unorde.red/archive/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      <guid>https://unorde.red/archive/</guid>
      <description></description>
    </item>
    <item>
      <title>Now</title>
      <link>https://unorde.red/now/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      <guid>https://unorde.red/now/</guid>
      <description>&lt;p&gt;&lt;em&gt;Last updated January 2023.&lt;/em&gt;&lt;/p&gt;&#xA;&lt;p&gt;I recently moved back to Kelowna, BC, Canada, after about 14 years away. It&amp;rsquo;s&#xA;changed! But in other ways, it also hasn&amp;rsquo;t.&lt;/p&gt;&#xA;&lt;p&gt;2022 was a very good year for me, full of friends, enriching experiences and big&#xA;changes. It&amp;rsquo;s bittersweet to have closed the chapter on London. I&amp;rsquo;ll always look&#xA;back fondly on my five years there.&lt;/p&gt;&#xA;&lt;p&gt;So what&amp;rsquo;s next?&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Now that my personal life is settling down, I&amp;rsquo;m starting to think more about&#xA;my career. What do I want out of work? Are there any side projects I should be&#xA;working on?&lt;/li&gt;&#xA;&lt;li&gt;I signed up for a few ultra marathons in the 50-60km range. We&amp;rsquo;ll see how&#xA;trail running goes this year.&lt;/li&gt;&#xA;&lt;li&gt;A big goal this year is to explore more of BC and the outdoors. I don&amp;rsquo;t have&#xA;concrete plans yet, but they&amp;rsquo;ll come.&lt;/li&gt;&#xA;&lt;li&gt;I want to breathe some life into this blog. I don&amp;rsquo;t care about readers, but I&#xA;want to write and think more actively.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;hr&gt;&#xA;&lt;p&gt;&lt;em&gt;What is this? This is a &lt;a href=&#34;https://nownownow.com/about&#34;&gt;now page&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
