<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Misceleannous on Stephen Swanson</title>
    
    
    
    <link>https://stephenswanson.xyz/categories/misceleannous/</link>
    <description>Recent content in Misceleannous on Stephen Swanson</description>
    <generator>Hugo -- gohugo.io</generator>
    <language>en</language>
    <managingEditor>stephen@stephenswanson.xyz (Stephen Swanson)</managingEditor>
    <webMaster>stephen@stephenswanson.xyz (Stephen Swanson)</webMaster>
    <copyright>Stephen Swanson - CC BY 3.0 US.</copyright>
    <lastBuildDate>Mon, 23 May 2022 00:00:00 -0700</lastBuildDate>
    
	<atom:link href="https://stephenswanson.xyz/categories/misceleannous/index.xml" rel="self" type="application/rss+xml" />
    
    
    <item>
      <title>The Head Bone is Connected to The Bash Shell- Compressor: HTB Cyber Apocalypse 2022</title>
      <link>https://stephenswanson.xyz/articles/htb-cyber-apocalypse-2022-compressor/</link>
      <pubDate>Mon, 23 May 2022 00:00:00 -0700</pubDate>
      <author>stephen@stephenswanson.xyz (Stephen Swanson)</author>
      <guid>https://stephenswanson.xyz/articles/htb-cyber-apocalypse-2022-compressor/</guid>
      <description>
        
          &lt;img src=&#34;https://stephenswanson.xyz/articles/htb-cyber-apocalypse-2022-compressor/65c2b241534b236fedea2a3e6347549e.png&#34;/&gt;
          
        
        
        &lt;blockquote&gt;
&lt;p&gt;Ramona&amp;rsquo;s obsession with modifications and the addition of artifacts to her body has slowed her down and made her fail and almost get killed in many missions. For this reason, she decided to hack a tiny robot under Golden Fang&amp;rsquo;s ownership called &amp;ldquo;Compressor&amp;rdquo;, which can reduce and increase the volume of any object to minimize/maximize it according to the needs of the mission. With this item, she will be able to carry any spare part she needs without adding extra weight to her back, making her fast. Can you help her take it and hack it?&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;This was the first of the misc challenges. I&amp;rsquo;m not sure if my solution was intended, but it was easy and it works, so why not?&lt;/p&gt;
&lt;h2 id=&#34;the-challenge&#34;&gt;The Challenge&lt;/h2&gt;
&lt;p&gt;We&amp;rsquo;re given an ip and address of a python server. We have a nice set of menus that seem to correspond to the directory structure on the server.&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;e3bac0797081972bfaba432934c6aa88.png&#34; alt=&#34;e3bac0797081972bfaba432934c6aa88.png&#34;&gt;&lt;/p&gt;
&lt;h2 id=&#34;the-solution&#34;&gt;The solution&lt;/h2&gt;
&lt;p&gt;Seeing linux commands anywhere in a challenge screams command injection. We can confirm this by trying some special characters, like &amp;lsquo;&lt;code&gt;;&lt;/code&gt;&amp;rsquo;, which is a way to chain commands together. Let&amp;rsquo;s try injecting the &lt;code&gt;id&lt;/code&gt; command after the &lt;code&gt;cat&lt;/code&gt; command:&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;bf7eb4bd8487699f77bd9f3f7100c3bc.png&#34; alt=&#34;bf7eb4bd8487699f77bd9f3f7100c3bc.png&#34;&gt;&lt;/p&gt;
&lt;p&gt;We see that we have command execution! Now we just need to find the flag. After using &lt;code&gt;ls&lt;/code&gt; commands on the parent directories, we eventually figure out that the flag is two directories above the current:&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;dbae2dedd62d545d64a4c50bf9d58870.png&#34; alt=&#34;dbae2dedd62d545d64a4c50bf9d58870.png&#34;&gt;&lt;/p&gt;
&lt;p&gt;Lastly, we just use the cat command to read the flag!&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;232e4c82168f91d8a34cc64ebfc4341f.png&#34; alt=&#34;232e4c82168f91d8a34cc64ebfc4341f.png&#34;&gt;&lt;/p&gt;
&lt;p&gt;Boom! We have the flag! Hopefully Ramona can put this compressor to good use!&lt;/p&gt;
&lt;p&gt;If this was interesting at all, helped you with one of your challenges, or if you have any questions or corrections, please drop me a line!&lt;/p&gt;

        
        </description>
    </item>
    
  </channel>
</rss>