<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title>Php on Hashbang.ca</title>
		<link>https://hashbang.ca/tag/php</link>
		<description>Recent content in Php on Hashbang.ca</description>
		<generator>Hugo</generator>
		<language>en-us</language>
		
		
		
		
			<lastBuildDate>Tue, 09 Jul 2013 08:48:00 -0400</lastBuildDate>
		
			<atom:link href="https://hashbang.ca/tag/php/index.xml" rel="self" type="application/rss+xml" />
			<item>
				<title>Server-side security war games: Part 16</title>
				<link>https://hashbang.ca/post/natas-16</link>
				<pubDate>Tue, 09 Jul 2013 08:48:00 -0400</pubDate>
				<guid>https://hashbang.ca/post/natas-16/</guid>
				<description>&lt;p&gt;This is the last level. We&amp;rsquo;re challenged with an improved version of level 9 &amp;ndash; they&amp;rsquo;ve added additional &amp;ldquo;sanitation&amp;rdquo; to keep us out.&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-php&#34; data-lang=&#34;php&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;k&#34;&gt;if&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;preg_match&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s1&#34;&gt;&amp;#39;/[;|&amp;amp;`\&amp;#39;&amp;#34;]/&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$key&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;))&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;k&#34;&gt;print&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;Input contains an illegal character!&amp;#34;&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;p&#34;&gt;}&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;else&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;nx&#34;&gt;passthru&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;grep -i &lt;/span&gt;&lt;span class=&#34;se&#34;&gt;\&amp;#34;&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;$key&lt;/span&gt;&lt;span class=&#34;se&#34;&gt;\&amp;#34;&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt; dictionary.txt&amp;#34;&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;p&#34;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;</description>
			</item>
			<item>
				<title>Server-side security war games: Part 14</title>
				<link>https://hashbang.ca/post/natas-14</link>
				<pubDate>Thu, 04 Jul 2013 11:05:00 -0400</pubDate>
				<guid>https://hashbang.ca/post/natas-14/</guid>
				<description>&lt;p&gt;In level 14, we see a more traditional username &amp;amp; password form. Let&amp;rsquo;s check the source code to see if there are holes we can slip through.&lt;/p&gt;</description>
			</item>
			<item>
				<title>Server-side security war games: Part 13</title>
				<link>https://hashbang.ca/post/natas-13</link>
				<pubDate>Tue, 02 Jul 2013 13:31:00 -0400</pubDate>
				<guid>https://hashbang.ca/post/natas-13/</guid>
				<description>&lt;p&gt;This is level 13. Looks like they claim to only accept image files, in order to close the flaw we used previously. I bet we can get around that restriction just like we did when they disallowed certain characters in the search term. Let&amp;rsquo;s examine the code.&lt;/p&gt;&#xA;&lt;p&gt;Here&amp;rsquo;s the new part of the 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-php&#34; data-lang=&#34;php&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;k&#34;&gt;if&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;!&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;exif_imagetype&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$_FILES&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;[&lt;/span&gt;&lt;span class=&#34;s1&#34;&gt;&amp;#39;uploadedfile&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;][&lt;/span&gt;&lt;span class=&#34;s1&#34;&gt;&amp;#39;tmp_name&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;]))&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;k&#34;&gt;echo&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;File is not an image&amp;#34;&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;p&#34;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;</description>
			</item>
			<item>
				<title>Server-side security war games: Part 12</title>
				<link>https://hashbang.ca/post/natas-12</link>
				<pubDate>Mon, 01 Jul 2013 14:23:00 -0400</pubDate>
				<guid>https://hashbang.ca/post/natas-12/</guid>
				<description>&lt;p&gt;In level 12, we&amp;rsquo;re given a file upload form. Let&amp;rsquo;s take a look at the code that processes input.&lt;/p&gt;</description>
			</item>
			<item>
				<title>Server-side security war games: Part 11</title>
				<link>https://hashbang.ca/post/natas-11</link>
				<pubDate>Fri, 28 Jun 2013 10:04:00 -0400</pubDate>
				<guid>https://hashbang.ca/post/natas-11/</guid>
				<description>&lt;p&gt;This is level 11. Your clue is that &amp;ldquo;XOR encryption&amp;rdquo; is not encryption. Let&amp;rsquo;s look in the cookies to find out they have XOR-ed, so we can mess with it.&lt;/p&gt;</description>
			</item>
			<item>
				<title>Server-side security war games: Part 8</title>
				<link>https://hashbang.ca/post/natas-8</link>
				<pubDate>Tue, 25 Jun 2013 09:24:00 -0400</pubDate>
				<guid>https://hashbang.ca/post/natas-8/</guid>
				<description>&lt;p&gt;Level 8 shows us another &amp;ldquo;Input secret&amp;rdquo; form. Let&amp;rsquo;s examine the source again. This time, there is an &amp;ldquo;encoded&amp;rdquo; secret. Let&amp;rsquo;s try to reverse engineer this. They&amp;rsquo;re using &lt;code&gt;bin2hex&lt;/code&gt;, &lt;code&gt;strrev&lt;/code&gt;, and &lt;code&gt;base64_encode&lt;/code&gt; &amp;ndash; those are all trivially reversible.&lt;/p&gt;</description>
			</item>
			<item>
				<title>Server-side security war games: Part 6</title>
				<link>https://hashbang.ca/post/natas-6</link>
				<pubDate>Sat, 22 Jun 2013 10:35:00 -0400</pubDate>
				<guid>https://hashbang.ca/post/natas-6/</guid>
				<description>&lt;p&gt;On level 6, there is a curious &amp;ldquo;Input secret&amp;rdquo; form. I wonder what it does? Well, there is also a &amp;ldquo;View sourcecode&amp;rdquo; link, which will presumably show us the source code for that form. Then, we can try to anaylze whether it has any weaknesses we can take advantage of.&lt;/p&gt;</description>
			</item>
			<item>
				<title>OMG, is that WordPress?!</title>
				<link>https://hashbang.ca/post/omg-is-that-wordpress</link>
				<pubDate>Sat, 29 Jan 2011 06:34:00 -0400</pubDate>
				<guid>https://hashbang.ca/post/omg-is-that-wordpress/</guid>
				<description>&lt;p&gt;I&amp;rsquo;m a Perl guy. I like the language a lot &amp;ndash; how it looks, how it works&amp;hellip; Even if it isn&amp;rsquo;t &lt;a href=&#34;https://metacpan.org/pod/perl5i&#34;&gt;perfect&lt;/a&gt;, I like it a lot. But I also love things that work, and Wordpress &lt;em&gt;works&lt;/em&gt;.&lt;/p&gt;</description>
			</item>
	</channel>
</rss>
