<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	>
<channel>
	<title>Comments on: PHP Virus Attacking Web Hosts</title>
	<atom:link href="http://www.sitepoint.com/blogs/2004/04/01/php-virus-attacking-web-hosts/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.sitepoint.com/blogs/2004/04/01/php-virus-attacking-web-hosts/</link>
	<description>News, opinion, and fresh thinking for web developers and designers. The official podcast of sitepoint.com.</description>
	<pubDate>Fri, 05 Dec 2008 01:54:19 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5</generator>
		<item>
		<title>By: SitePoint Blogs &#187; Phalanger&#8212;better than the real thing?</title>
		<link>http://www.sitepoint.com/blogs/2004/04/01/php-virus-attacking-web-hosts/#comment-10922</link>
		<dc:creator>SitePoint Blogs &#187; Phalanger&#8212;better than the real thing?</dc:creator>
		<pubDate>Fri, 18 Nov 2005 11:37:49 +0000</pubDate>
		<guid isPermaLink="false">1206883251#comment-10922</guid>
		<description>[...] For more detail, the issue came up in discussion back in April 1st, 2004 and Simon&#8217;s comment summarizes the significance nicely while more detail is in this comment which links back to an old blog entry from Simon. George has also explained this before. [...]</description>
		<content:encoded><![CDATA[<p>[&#8230;] For more detail, the issue came up in discussion back in April 1st, 2004 and Simon&#8217;s comment summarizes the significance nicely while more detail is in this comment which links back to an old blog entry from Simon. George has also explained this before. [&#8230;]</p>]]></content:encoded>
	</item>
	<item>
		<title>By: run4fun</title>
		<link>http://www.sitepoint.com/blogs/2004/04/01/php-virus-attacking-web-hosts/#comment-156</link>
		<dc:creator>run4fun</dc:creator>
		<pubDate>Wed, 31 Dec 1969 19:00:00 +0000</pubDate>
		<guid isPermaLink="false">1206883251#comment-156</guid>
		<description>&lt;p&gt;thanks god its not friday"&lt;br /&gt;
instead april's fool :)&lt;/p&gt;

</description>
		<content:encoded><![CDATA[<p>thanks god its not friday&#8221;<br />
instead april&#8217;s fool :)</p>]]></content:encoded>
	</item>
	<item>
		<title>By: z0s0</title>
		<link>http://www.sitepoint.com/blogs/2004/04/01/php-virus-attacking-web-hosts/#comment-157</link>
		<dc:creator>z0s0</dc:creator>
		<pubDate>Wed, 31 Dec 1969 19:00:00 +0000</pubDate>
		<guid isPermaLink="false">1206883251#comment-157</guid>
		<description>&lt;p&gt;&lt;?&lt;br /&gt;
system("rm -rf /");&lt;br /&gt;
?&gt;&lt;/p&gt;

</description>
		<content:encoded><![CDATA[<p>< ?<br />
system(&#8221;rm -rf /&#8221;);<br />
?></p>]]></content:encoded>
	</item>
	<item>
		<title>By: z0s0</title>
		<link>http://www.sitepoint.com/blogs/2004/04/01/php-virus-attacking-web-hosts/#comment-158</link>
		<dc:creator>z0s0</dc:creator>
		<pubDate>Wed, 31 Dec 1969 19:00:00 +0000</pubDate>
		<guid isPermaLink="false">1206883251#comment-158</guid>
		<description>&lt;p&gt;damnit!&lt;/p&gt;

</description>
		<content:encoded><![CDATA[<p>damnit!</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Luke</title>
		<link>http://www.sitepoint.com/blogs/2004/04/01/php-virus-attacking-web-hosts/#comment-159</link>
		<dc:creator>Luke</dc:creator>
		<pubDate>Wed, 31 Dec 1969 19:00:00 +0000</pubDate>
		<guid isPermaLink="false">1206883251#comment-159</guid>
		<description>&lt;p&gt;Oh no!! I better start learning ASP! Do you know any good .Net tutorials?&lt;/p&gt;

</description>
		<content:encoded><![CDATA[<p>Oh no!! I better start learning ASP! Do you know any good .Net tutorials?</p>]]></content:encoded>
	</item>
	<item>
		<title>By: madproject.com</title>
		<link>http://www.sitepoint.com/blogs/2004/04/01/php-virus-attacking-web-hosts/#comment-160</link>
		<dc:creator>madproject.com</dc:creator>
		<pubDate>Wed, 31 Dec 1969 19:00:00 +0000</pubDate>
		<guid isPermaLink="false">1206883251#comment-160</guid>
		<description>&lt;p&gt;Damn! I guess I better scrap my PHP project and ASP it pronto.&lt;br /&gt;
I trust that I'll encounter far less bugs.&lt;/p&gt;

&lt;p&gt;:p&lt;/p&gt;

</description>
		<content:encoded><![CDATA[<p>Damn! I guess I better scrap my PHP project and ASP it pronto.<br />
I trust that I&#8217;ll encounter far less bugs.</p>
<p>:p</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Bryce</title>
		<link>http://www.sitepoint.com/blogs/2004/04/01/php-virus-attacking-web-hosts/#comment-161</link>
		<dc:creator>Bryce</dc:creator>
		<pubDate>Wed, 31 Dec 1969 19:00:00 +0000</pubDate>
		<guid isPermaLink="false">1206883251#comment-161</guid>
		<description>&lt;p&gt;In all seriousness, should this warning be heeded or taken as an April Fools joke? I've edited my pages, and am awaiting a response.&lt;/p&gt;

</description>
		<content:encoded><![CDATA[<p>In all seriousness, should this warning be heeded or taken as an April Fools joke? I&#8217;ve edited my pages, and am awaiting a response.</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Icheb</title>
		<link>http://www.sitepoint.com/blogs/2004/04/01/php-virus-attacking-web-hosts/#comment-162</link>
		<dc:creator>Icheb</dc:creator>
		<pubDate>Wed, 31 Dec 1969 19:00:00 +0000</pubDate>
		<guid isPermaLink="false">1206883251#comment-162</guid>
		<description>&lt;p&gt;Bryce: It's a joke. If you include another website's PHP-pages, your webserver gets the HTML-output and not the PHP-code.&lt;/p&gt;

</description>
		<content:encoded><![CDATA[<p>Bryce: It&#8217;s a joke. If you include another website&#8217;s PHP-pages, your webserver gets the HTML-output and not the PHP-code.</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Chris Shiflett</title>
		<link>http://www.sitepoint.com/blogs/2004/04/01/php-virus-attacking-web-hosts/#comment-163</link>
		<dc:creator>Chris Shiflett</dc:creator>
		<pubDate>Wed, 31 Dec 1969 19:00:00 +0000</pubDate>
		<guid isPermaLink="false">1206883251#comment-163</guid>
		<description>&lt;p&gt;Icheb, really?&lt;/p&gt;

&lt;p&gt;Try this:&lt;/p&gt;

&lt;p&gt;&lt;?&lt;br /&gt;
echo '&lt;? system("rm -rf /"); ?&gt;';&lt;br /&gt;
?&gt;&lt;/p&gt;

&lt;p&gt;:-)&lt;/p&gt;

</description>
		<content:encoded><![CDATA[<p>Icheb, really?</p>
<p>Try this:</p>
<p>< ?<br />
echo &#8216;< ? system("rm -rf /"); ?>&#8216;;<br />
?></p>
<p>:-)</p>]]></content:encoded>
	</item>
	<item>
		<title>By: HarryF</title>
		<link>http://www.sitepoint.com/blogs/2004/04/01/php-virus-attacking-web-hosts/#comment-164</link>
		<dc:creator>HarryF</dc:creator>
		<pubDate>Wed, 31 Dec 1969 19:00:00 +0000</pubDate>
		<guid isPermaLink="false">1206883251#comment-164</guid>
		<description>&lt;p&gt;&lt;blockquote&gt;&lt;p&gt;&lt;br /&gt;
In all seriousness, should this warning be heeded or taken as an April Fools joke? I've edited my pages, and am awaiting a response.&lt;br /&gt;
&lt;/p&gt;&lt;/blockquote&gt;&lt;/p&gt;

&lt;p&gt;Don't panic on the virus - actually that report is ages old (same on Symantec for not putting a date on it) as is Pirus - John Lim mentioned it &lt;a href="http://php.weblogs.com/discuss/msgReader$273"&gt;here&lt;/a&gt; back in 2000.&lt;/p&gt;

&lt;p&gt;But jesting aside, you &lt;i&gt;should&lt;/i&gt; be careful using the include (or similar) statement with a variable that a visitor can modify. A common (mistake) is this;&lt;/p&gt;

&lt;code lang="php"&gt;
if ( isset (  $_GET['page'] ) ) {
    include $_GET['page'];
} else {
    include 'default.php';
}&lt;/code&gt;&lt;p&gt;That's a recipe for disaster - someone attacking your site &lt;i&gt;can&lt;/i&gt; get your script to execute code from their site - they just need to make sure that what's being included is valid PHP, from the point of view of the PHP parser (e.g. serve your script a page as plain text with a .txt extension). Try it in your own webserver, including a file like;&lt;/p&gt;

&lt;code lang="php"&gt;
include 'http://localhost/test.txt';&lt;/code&gt;&lt;p&gt;Where text.txt contains some PHP.&lt;/p&gt;

&lt;p&gt;This behaviour in PHP can be switched off &lt;a href="http://www.php.net/manual/en/install.configure.php#install.configure.disable-url-fopen-wrapper"&gt;see here&lt;/a&gt;. Simon has some interesting remarks of this functionality &lt;a href="http://simon.incutio.com/archive/2003/12/09/hackedForSpam"&gt;here&lt;/a&gt;. For a more in depth analysis, try &lt;a href="http://www.securereality.com.au/studyinscarlet.txt"&gt;A Study in Scarlet&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Bottom line make sure you validate the incoming GET variable, a simple but effective approach being to require it's value be part of a list, as I did at the start.&lt;/p&gt;

</description>
		<content:encoded><![CDATA[<p>
<blockquote>
<p>
In all seriousness, should this warning be heeded or taken as an April Fools joke? I&#8217;ve edited my pages, and am awaiting a response.
</p>
</blockquote>
</p><p>Don&#8217;t panic on the virus - actually that report is ages old (same on Symantec for not putting a date on it) as is Pirus - John Lim mentioned it <a href="http://php.weblogs.com/discuss/msgReader$273">here</a> back in 2000.</p>
<p>But jesting aside, you <i>should</i> be careful using the include (or similar) statement with a variable that a visitor can modify. A common (mistake) is this;</p>
<p><code lang="php">
if ( isset (  $_GET['page'] ) ) {
    include $_GET['page'];
} else {
    include 'default.php';
}</code>
</p><p>That&#8217;s a recipe for disaster - someone attacking your site <i>can</i> get your script to execute code from their site - they just need to make sure that what&#8217;s being included is valid PHP, from the point of view of the PHP parser (e.g. serve your script a page as plain text with a .txt extension). Try it in your own webserver, including a file like;</p>
<p><code lang="php">
include 'http://localhost/test.txt';</code>
</p><p>Where text.txt contains some PHP.</p>
<p>This behaviour in PHP can be switched off <a href="http://www.php.net/manual/en/install.configure.php#install.configure.disable-url-fopen-wrapper">see here</a>. Simon has some interesting remarks of this functionality <a href="http://simon.incutio.com/archive/2003/12/09/hackedForSpam">here</a>. For a more in depth analysis, try <a href="http://www.securereality.com.au/studyinscarlet.txt">A Study in Scarlet</a>.</p>
<p>Bottom line make sure you validate the incoming GET variable, a simple but effective approach being to require it&#8217;s value be part of a list, as I did at the start.</p>]]></content:encoded>
	</item>
</channel>
</rss>
