<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>arturmarques.com iLog &#187; .NET</title>
	<atom:link href="http://arturmarques.com/wordpress/index.php/category/dev/net/feed/" rel="self" type="application/rss+xml" />
	<link>http://arturmarques.com/wordpress</link>
	<description>Artur Marques&#039; blog - supporting the arturmarques.com website</description>
	<lastBuildDate>Tue, 07 Feb 2012 11:13:55 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.1</generator>
		<item>
		<title>Tips from being WWW&#8217;mugged</title>
		<link>http://arturmarques.com/wordpress/index.php/2011/01/30/tips-from-being-wwwmugged/</link>
		<comments>http://arturmarques.com/wordpress/index.php/2011/01/30/tips-from-being-wwwmugged/#comments</comments>
		<pubDate>Sun, 30 Jan 2011 23:28:47 +0000</pubDate>
		<dc:creator>am</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[ENG]]></category>
		<category><![CDATA[sw]]></category>
		<category><![CDATA[wordpress stuff]]></category>

		<guid isPermaLink="false">http://arturmarques.com/wordpress/index.php/2011/01/30/tips-from-being-wwwmugged/</guid>
		<description><![CDATA[I would love to be as superior as Bernie Ecclestone was after being mugged, selling is battered face for a fortune and showing the abusers how to brilliantly volte-face a situation, but of course I am just a nobody and the best turnaround I can ambition is to help at least one person with some [...]]]></description>
			<content:encoded><![CDATA[<p>I would love to be as superior as Bernie Ecclestone was after being mugged, selling is battered face for a fortune and showing the abusers how to brilliantly volte-face a situation, but of course I am just a nobody and the best turnaround I can ambition is to help at least one person with <strong>some lessons learned the hard way, after being WWW&#8217;mugged myself</strong>.</p>
<p><img alt="20110130 bernie mugged volte face" src="http://arturmarques.com/wordpress/wp-content/uploads/2011/01/20110130_bernie_mugged_volte_face.jpg" width="50%" /></p>
<p>The full Bernie story: <a href="http://www.youtube.com/watch?v=b7AiMoOSxlk">http://www.youtube.com/watch?v=b7AiMoOSxlk</a></p>
<p>It is very unpleasant to have a website mugged, or &#8220;hacked&#8221;, for no reason at all but the display of the &#8220;signatures&#8221; of the abusers.<br />
After all these years, here are some tips.</p>
<p>(1)</p>
<p>If you have an ASP.NET web.config global file, yet the system says it can NOT find a valid <strong>web.config</strong> for a particular application, it might be because of wrong permissions on that app&#8217;s file system containing folder.</p>
<p>Since I run IIS6, this page was helpful:</p>
<p><a href="http://support.microsoft.com/kb/317955/">http://support.microsoft.com/kb/317955/</a></p>
<p>It basically says: &#8220;add the <strong>NETWORK SERVICE</strong> user to the app&#8217;s folder&#8221;.</p>
<p>Indeed, every .NET app folder must allow the &#8220;<strong>NETWORK SERVICE</strong>&#8221; user with the permissions:<br />
- read<br />
- read and execute<br />
- list folder contents</p>
<p>(2)</p>
<p>In IIS6 the user <strong>IUSR_TEMPLATE</strong> represents an anonymous web visitor and so must be available for all resources to be made public on the WWW.</p>
<p>Generally, this user <strong>should only have READ permits and nothing else</strong>, for all resources.</p>
<p>If some particular folders require writing, give this user READ and WRITE permits, but *never* WRITE and EXECUTE.</p>
<p>Ideally, the WRITE permit should only be given to out-of-reach-of-the-web-server folders, meaning locations that are nowhere in the tree being made public by IIS, Apache or whatever the http server. But this isn&#8217;t always possible: most Content Management Systems (CMSs) will require at least one writable public folder, for example to where bloggers can upload pictures &#8211; just follow the minimal approach and the *never* WRITE and EXECUTE rule.</p>
<p>(3)</p>
<p>For read-only web presences, if you strictly follow the minimal rule, giving nothing but the READ permit to the web visitor user <strong><em>and</em></strong> no other permits to no other users at all, you&#8217;ll end up with a very secure site, but with some annoyances, e.g. <strong>FTP uploading contents will fail probably with a &#8220;450 can&#8217;t access file&#8221; error</strong>.</p>
<p>In Windows, you can easily fix it by giving &#8220;full control&#8221; to the SYSTEM user at some entry point.</p>
<p>(4)</p>
<p>Some CMSs that support themes, like <strong>Worpress, might display a blank page</strong> after being moved or copied. One very simple solution is to install a new theme, activate it, then return to the original.</p>
]]></content:encoded>
			<wfw:commentRss>http://arturmarques.com/wordpress/index.php/2011/01/30/tips-from-being-wwwmugged/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to run C# binaries, as CGI applications, in IIS</title>
		<link>http://arturmarques.com/wordpress/index.php/2006/11/29/how-to-run-c-binaries-as-cgi-applications-in-iis/</link>
		<comments>http://arturmarques.com/wordpress/index.php/2006/11/29/how-to-run-c-binaries-as-cgi-applications-in-iis/#comments</comments>
		<pubDate>Thu, 30 Nov 2006 01:07:17 +0000</pubDate>
		<dc:creator>am</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[dev]]></category>
		<category><![CDATA[distributed systems]]></category>
		<category><![CDATA[edu]]></category>
		<category><![CDATA[inet]]></category>
		<category><![CDATA[inet tech]]></category>
		<category><![CDATA[sistemas distribuídos]]></category>
		<category><![CDATA[sistemas web]]></category>
		<category><![CDATA[web systems]]></category>

		<guid isPermaLink="false">http://arturmarques.com/wordpress/index.php/2006/11/29/how-to-run-c-binaries-as-cgi-applications-in-iis/</guid>
		<description><![CDATA[If you want to use C# to write CGI applications, you might stumble on some technical difficulties, when using the IIS web server: no matter what are the permissions you set for the folder holding the CGI executable, whenever executing it, the web server doesn’t process the file and tries to serve it as if [...]]]></description>
			<content:encoded><![CDATA[<p>If you want to use C# to write CGI applications, you <strong><em>might</em> </strong>stumble on some technical difficulties, when using the IIS web server: no matter what are the permissions you set for the folder holding the CGI executable, whenever executing it, the web server doesn’t process the file and tries to serve it as if the client had requested its download!</p>
<p>One workaround is to explicitly map some dummy extension, to the EXE that you want to use as the CGI application.<br />
For example, map “.CSX” to the executable that is the output of your C# CGI solution.</p>
<p>The HTML that needs to invoke the CGI, <strong><em>must </em></strong>invoke the dummy (zero bytes) .CSX file, because invoking the .EXE would produce the IIS problem already mentioned.</p>
<p>In order to do the “.CSX” &lt;—&gt; “CGI.EXE” mapping, (1) create one server side directory (virtual or not) to hold the C# CGI solutions.</p>
<p>The picture below shows that, in some computer, the “\cgi-bin\cgi_cs” folder was chosen to hold the C# executables.</p>
<p><img border="0" alt="IIS configuration for C# CGI (1 of 6)" src="http://arturmarques.com/images/blog/iis_cgi_cs_config_01_ok.jpg" /></p>
<p>After (1), make sure that you (2) create an “IIS application” for the folder, having execute permissions for BOTH script and executables.</p>
<p><img border="0" alt="IIS configuration for C# CGI (2 of 6)" src="http://arturmarques.com/images/blog/iis_cgi_cs_config_02_ok.jpg" /></p>
<p>Once the application is created, it is possible to configure it. So, (3) click the configuration button.</p>
<p><img border="0" alt="IIS configuration for C# CGI (3 of 6)" src="http://arturmarques.com/images/blog/iis_cgi_cs_config_03_ok.jpg" /></p>
<p>(4) The relevant tab in “application configuration” is the “mappings” tab. Here, click the “Add” button. This operation is the way to build the aforementioned “.CSX” &lt;—&gt; “CGI.EXE” relation.</p>
<p><img border="0" alt="IIS configuration for C# CGI (4 of 6)" src="http://arturmarques.com/images/blog/iis_cgi_cs_config_04_ok.jpg" /></p>
<p>(5) In the “mapping” dialog, browse to the C# .EXE file that is intended to run as a CGI; then type “.CSX” as the extension; then you can uncheck the “check that file exists” option and, finally, press the OK button.</p>
<p>If the OK button is dimmed/grayed/not enabled, just click once on the executable textbox!</p>
<p><img border="0" alt="IIS configuration for C# CGI (5 of 6)" src="http://arturmarques.com/images/blog/iis_cgi_cs_config_05_ok.jpg" /></p>
<p>(6) After this, the “application configuration” dialog box should list the “.CSX” extension at the bottom.</p>
<p>In order to use the new mapping, restart (stop, then start) the IIS web server.</p>
<p>Having done these six steps, all that is left is to code the right invocation of the CGI. For example, if using forms and its action attribute, point the action to some empty .CSX file.</p>
<p>To build an empty CGI.CSX file, go to the “command prompt” and type “copy con cgi.csx”, followed by ENTER, followed by CTRL+Z (which is the end-of-file character).</p>
<p><img border="0" alt="IIS configuration for C# CGI (6 of 6)" src="http://arturmarques.com/images/blog/iis_cgi_cs_config_06_ok.jpg" /></p>
]]></content:encoded>
			<wfw:commentRss>http://arturmarques.com/wordpress/index.php/2006/11/29/how-to-run-c-binaries-as-cgi-applications-in-iis/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

