<?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>Nefaria.com &#187; I.T.</title>
	<atom:link href="http://nefaria.com/category/information_technology/feed/" rel="self" type="application/rss+xml" />
	<link>http://nefaria.com</link>
	<description>☠ ☠ ☠ ☠ ☠ ☠</description>
	<lastBuildDate>Thu, 11 Mar 2010 00:30:19 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>How to make your GNU/Linux servers just a bit more secure (using iptables)</title>
		<link>http://nefaria.com/2010/02/how-to-make-your-gnulinux-servers-just-a-bit-more-secure-using-iptables/</link>
		<comments>http://nefaria.com/2010/02/how-to-make-your-gnulinux-servers-just-a-bit-more-secure-using-iptables/#comments</comments>
		<pubDate>Fri, 26 Feb 2010 13:59:43 +0000</pubDate>
		<dc:creator>musashi</dc:creator>
				<category><![CDATA[I.T.]]></category>
		<category><![CDATA[GNU/Linux]]></category>
		<category><![CDATA[iptables]]></category>

		<guid isPermaLink="false">http://nefaria.com/?p=862</guid>
		<description><![CDATA[First, the code:


#!/bin/bash
shopt&#160;-s&#160;-o&#160;nounset
shopt&#160;-s&#160;extglob

declare&#160;APNIC=&#34;ftp://ftp.apnic.net/public/stats/apnic/delegated-apnic-latest&#34;
declare&#160;AFRINIC=&#34;ftp://ftp.afrinic.net/pub/stats/afrinic/delegated-afrinic-latest&#34;
declare&#160;LACNIC=&#34;ftp://ftp.lacnic.net/pub/stats/lacnic/delegated-lacnic-latest&#34;
declare&#160;RIPENCC=&#34;ftp://ftp.ripe.net/pub/stats/ripencc/delegated-ripencc-latest&#34;
declare&#160;IP=unset
declare&#160;CACHE_MAX_AGE=30&#160;#Number of days to rely on the cached list of networks
declare&#160;USE_CACHE=false&#160;&#160;#Do not use cache by default

#Wipe out any existing iptables rules before proceeding
iptables -F

checkcache() {
if [&#160;`find&#160;/tmp/ -maxdepth 1&#160;-iname &#34;cached_IP_addresses&#34;&#160;-mtime +$CACHE_MAX_AGE`&#160;];&#160;then
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;rm&#160;-f&#160;/tmp/cached_IP_addresses
elif&#160;[&#160;-f&#160;/tmp/cached_IP_addresses ];&#160;then
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;USE_CACHE=true
fi
}

ipfeeder() {
if [&#160;&#34;$USE_CACHE&#34;&#160;=&#160;&#34;true&#34;&#160;];&#160;then
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;cat /tmp/cached_IP_addresses
else
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;curl -s&#160;$APNIC&#160;$AFRINIC&#160;$LACNIC&#160;$RIPENCC&#160;&#124;\
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;awk -F'&#124;'&#160;'{print $4}'&#124;\
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;fgrep&#160;&#34;.0.0.0&#34;&#160;&#124;\
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;sed&#160;-e&#160;'s:$:/8:g'
fi
}

checkcache

ipfeeder &#124; tee /tmp/cached_IP_addresses &#124; {
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;while read&#160;IP;&#160;do
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;#Drop inbound packets from $IP
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;iptables -A&#160;INPUT -s&#160;$IP&#160;-j&#160;DROP 
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;#Drop outbound packets to [...]]]></description>
			<content:encoded><![CDATA[<p>First, the code:</p>
<div class="code_block">
<pre>
<font color="#8080ff">#!/bin/bash</font>
<font color="#ffff00">shopt</font>&nbsp;<font color="#ff40ff">-s</font>&nbsp;<font color="#ff40ff">-o</font>&nbsp;nounset
<font color="#ffff00">shopt</font>&nbsp;<font color="#ff40ff">-s</font>&nbsp;extglob

<font color="#ffff00">declare</font><font color="#00ffff">&nbsp;APNIC=</font><font color="#ffff00">&quot;</font><font color="#ff6060">ftp://ftp.apnic.net/public/stats/apnic/delegated-apnic-latest</font><font color="#ffff00">&quot;</font>
<font color="#ffff00">declare</font><font color="#00ffff">&nbsp;AFRINIC=</font><font color="#ffff00">&quot;</font><font color="#ff6060">ftp://ftp.afrinic.net/pub/stats/afrinic/delegated-afrinic-latest</font><font color="#ffff00">&quot;</font>
<font color="#ffff00">declare</font><font color="#00ffff">&nbsp;LACNIC=</font><font color="#ffff00">&quot;</font><font color="#ff6060">ftp://ftp.lacnic.net/pub/stats/lacnic/delegated-lacnic-latest</font><font color="#ffff00">&quot;</font>
<font color="#ffff00">declare</font><font color="#00ffff">&nbsp;RIPENCC=</font><font color="#ffff00">&quot;</font><font color="#ff6060">ftp://ftp.ripe.net/pub/stats/ripencc/delegated-ripencc-latest</font><font color="#ffff00">&quot;</font>
<font color="#ffff00">declare</font><font color="#00ffff">&nbsp;IP=</font>unset
<font color="#ffff00">declare</font><font color="#00ffff">&nbsp;CACHE_MAX_AGE=</font><font color="#ff6060">30</font>&nbsp;<font color="#8080ff">#Number of days to rely on the cached list of networks</font>
<font color="#ffff00">declare</font><font color="#00ffff">&nbsp;USE_CACHE=</font><font color="#ffff00">false</font>&nbsp;&nbsp;<font color="#8080ff">#Do not use cache by default</font>

<font color="#8080ff">#Wipe out any existing iptables rules before proceeding</font>
iptables <font color="#ff40ff">-F</font>

<font color="#00ffff">checkcache() {</font>
<font color="#ffff00">if </font><font color="#ffff00">[</font>&nbsp;<font color="#ff40ff">`</font><font color="#ffff00">find</font><font color="#ff40ff">&nbsp;/tmp/ -maxdepth </font><font color="#ff6060">1</font><font color="#ff40ff">&nbsp;-iname </font><font color="#ffff00">&quot;</font><font color="#ff6060">cached_IP_addresses</font><font color="#ffff00">&quot;</font><font color="#ff40ff">&nbsp;-mtime +</font><font color="#ff40ff">$CACHE_MAX_AGE</font><font color="#ff40ff">`</font>&nbsp;<font color="#ffff00">]</font><font color="#ffff00">;</font>&nbsp;<font color="#ffff00">then</font>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="#ffff00">rm</font>&nbsp;<font color="#ffff00">-f</font>&nbsp;/tmp/cached_IP_addresses
<font color="#ffff00">elif</font>&nbsp;<font color="#ffff00">[</font>&nbsp;<font color="#ffff00">-f</font>&nbsp;/tmp/cached_IP_addresses <font color="#ffff00">]</font><font color="#ffff00">;</font>&nbsp;<font color="#ffff00">then</font>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="#00ffff">USE_CACHE</font>=<font color="#ffff00">true</font>
<font color="#ffff00">fi</font>
<font color="#00ffff">}</font>

<font color="#00ffff">ipfeeder() {</font>
<font color="#ffff00">if </font><font color="#ffff00">[</font>&nbsp;<font color="#ffff00">&quot;</font><font color="#ff40ff">$USE_CACHE</font><font color="#ffff00">&quot;</font>&nbsp;<font color="#ffff00">=</font>&nbsp;<font color="#ff6060">&quot;true&quot;</font>&nbsp;<font color="#ffff00">]</font><font color="#ffff00">;</font>&nbsp;<font color="#ffff00">then</font>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;cat /tmp/cached_IP_addresses
<font color="#ffff00">else</font>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;curl <font color="#ffff00">-s</font>&nbsp;<font color="#ff40ff">$APNIC</font>&nbsp;<font color="#ff40ff">$AFRINIC</font>&nbsp;<font color="#ff40ff">$LACNIC</font>&nbsp;<font color="#ff40ff">$RIPENCC</font>&nbsp;<font color="#ffff00">|</font>\
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;awk <font color="#ffff00">-F</font><font color="#ffff00">'</font><font color="#ff6060">|</font><font color="#ffff00">'</font>&nbsp;<font color="#ffff00">'</font><font color="#ff6060">{print $4}</font><font color="#ffff00">'|</font>\
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="#ffff00">fgrep</font>&nbsp;<font color="#ffff00">&quot;</font><font color="#ff6060">.0.0.0</font><font color="#ffff00">&quot;</font>&nbsp;<font color="#ffff00">|</font>\
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="#ffff00">sed</font>&nbsp;<font color="#ffff00">-e</font>&nbsp;<font color="#ffff00">'</font><font color="#ff6060">s:$:/8:g</font><font color="#ffff00">'</font>
<font color="#ffff00">fi</font>
<font color="#00ffff">}</font>

checkcache

ipfeeder | tee /tmp/cached_IP_addresses | <font color="#ff40ff">{</font>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="#ffff00">while </font><font color="#ffff00">read</font><font color="#ffff00">&nbsp;IP</font><font color="#ffff00">;</font><font color="#ffff00">&nbsp;</font><font color="#ffff00">do</font>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="#8080ff">#Drop inbound packets from $IP</font>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;iptables <font color="#ffff00">-A</font>&nbsp;INPUT <font color="#ffff00">-s</font>&nbsp;<font color="#ff40ff">$IP</font>&nbsp;<font color="#ffff00">-j</font>&nbsp;DROP 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="#8080ff">#Drop outbound packets to $IP</font>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;iptables <font color="#ffff00">-A</font>&nbsp;OUTPUT <font color="#ffff00">-d</font>&nbsp;<font color="#ff40ff">$IP</font>&nbsp;<font color="#ffff00">-j</font>&nbsp;DROP
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="#ffff00">done</font>
<font color="#ff40ff">}</font>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 

<font color="#8080ff">#Rate limit some protocols</font>

iptables <font color="#ff40ff">-A</font>&nbsp;INPUT <font color="#ff40ff">-p</font>&nbsp;tcp <font color="#ff40ff">--dport</font>&nbsp;<font color="#ff6060">22</font>&nbsp;<font color="#ff40ff">-i</font>&nbsp;eth0 <font color="#ff40ff">-m</font>&nbsp;state <font color="#ff40ff">--state</font>&nbsp;NEW <font color="#ff40ff">-m</font>&nbsp;recent <font color="#ff40ff">--set</font>
iptables <font color="#ff40ff">-A</font>&nbsp;INPUT <font color="#ff40ff">-p</font>&nbsp;tcp <font color="#ff40ff">--dport</font>&nbsp;<font color="#ff6060">22</font>&nbsp;<font color="#ff40ff">-i</font>&nbsp;eth0 <font color="#ff40ff">-m</font>&nbsp;state <font color="#ff40ff">--state</font>&nbsp;NEW <font color="#ff40ff">-m</font>&nbsp;recent <font color="#ff40ff">--update</font>&nbsp;<font color="#ff40ff">--seconds</font>&nbsp;<font color="#ff6060">1800</font>&nbsp;<font color="#ff40ff">--hitcount</font>&nbsp;<font color="#ff6060">10</font>&nbsp;<font color="#ff40ff">-j</font>&nbsp;DROP
</font>
</pre>
</div>
<p>This is fairly self-explanatory. Basically, you&#8217;re telling iptables to drop any inbound and outbound packets to any of the networks listed in the ipfeeder() function, and just for good measure, we rate limit new incoming ssh connections to 10 every 30 minutes. (If you have port 22 opened to the outside world, have a look in /var/log/secure or /var/log/auth &#8212; there&#8217;s probably a shitload of break-in attempts that have been logged; grep for sshd and you&#8217;ll see what I mean.) </p>
<p>Remember, iptables rules don&#8217;t survive reboots! So make sure that this script runs on system startup (e.g., insert a call to the script in /etc/rc.local.)</p>
<p>For detailed lists of all networks in the apnic, afrinic, lacnic, and ripe-ncc registries, visit the following urls:</p>
<p>ftp://ftp.apnic.net/public/stats/apnic/delegated-apnic-latest<br />
ftp://ftp.apnic.net/public/stats/afrinic/delegated-afrinic-latest<br />
ftp://ftp.apnic.net/public/stats/lacnic/delegated-lacnic-latest<br />
ftp://ftp.apnic.net/public/stats/ripe-ncc/delegated-ripencc-latest</p>
]]></content:encoded>
			<wfw:commentRss>http://nefaria.com/2010/02/how-to-make-your-gnulinux-servers-just-a-bit-more-secure-using-iptables/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Configuring &#8220;Per User&#8221; licensing in Terminal Services, remotely *without* Remote Desktop access</title>
		<link>http://nefaria.com/2010/01/configuring-per-user-licensing-in-terminal-services-remotely-without-remote-desktop-access/</link>
		<comments>http://nefaria.com/2010/01/configuring-per-user-licensing-in-terminal-services-remotely-without-remote-desktop-access/#comments</comments>
		<pubDate>Thu, 07 Jan 2010 23:48:00 +0000</pubDate>
		<dc:creator>musashi</dc:creator>
				<category><![CDATA[I.T.]]></category>
		<category><![CDATA[Terminal Services]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://nefaria.com/?p=796</guid>
		<description><![CDATA[So the other day I was trying to connect to one of the terminal servers that I manage (for the purpose of this post, we&#8217;ll call the server &#8216;TERMSVR01&#8242;) and I got the following error message and was promptly disconnected:

The remote session was disconnected because there are no Terminal Server client access licenses available for [...]]]></description>
			<content:encoded><![CDATA[<p>So the other day I was trying to connect to one of the terminal servers that I manage (for the purpose of this post, we&#8217;ll call the server &#8216;TERMSVR01&#8242;) and I got the following error message and was promptly disconnected:</p>
<div class="code_block">
The remote session was disconnected because there are no Terminal Server client access licenses available for this computer
</div>
<p>At first glance, this seems as though the server ran out of TS CALS (Terminal Server Client Access Licenses). I was pretty sure that the server was configured to use the &#8220;Per User&#8221; licensing mode. However, a Windows Server 2003 Terminal Server operating in the &#8220;Per User&#8221; licensing mode can&#8217;t run out of licenses to the extent that it prevents the user from connecting (and instead, giving them the aforementioned error message). To the best of my knowledge, it can <em>only</em> do this when it is operating in &#8220;Per Device&#8221; mode. So this was the assumption that I ran with &#8212; that somehow, this server was never configured for &#8220;Per User&#8221; -or- it was, but the setting was either changed, reset, or corrupted somehow.</p>
<p>So, even though I wasn&#8217;t able to connect to TERMSVR01 via Remote Desktop, I <em>was</em> able to &#8220;Manage&#8221; it remotely by doing the following:</p>
<ol>
<li>Open &#8220;Active Directory Users and Computers&#8221; on any Domain Controller</li>
<li>Expand the &#8220;Computers&#8221; node</li>
<li>Right-click TERMSVR01 and select &#8216;Manage&#8217;</li>
</ol>
<p>Now we can do a few things (not many) on the server. One thing I wanted was to have a look at the Event Viewer. There were a few error messages like the following:</p>
<div class="code_block">
Event Type: Information<br />
Event Source: TermService<br />
Event Category: None<br />
Event ID: 1004<br />
Date: 1/5/2010<br />
Time: 6:18:23 PM<br />
User: N/A<br />
Computer: TERMSVR01<br />
Description:<br />
The terminal server cannot issue a client license.  It was unable to issue the license due to a changed (mismatched) client license, insufficient memory, or an internal error. Further details for this problem may have been reported at the client&#8217;s computer.</p>
<p>For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp.
</p></div>
<p>The more of these I saw, the more confident I was that my assumption was correct &#8212; the server was operating in &#8220;Per Device&#8221; mode and it had finally run out of licenses. I had the following options:</p>
<ol>
<li>Wait for someone to go onsite and reconfigure the licensing mode (easy, but it would have to wait until tomorrow) or&#8230;</li>
<li>Attempt to reconfigure this setting <em>and</em> restart the service remotely (so that the setting takes takes effect) &#8230; all without having &#8220;Remote Desktop&#8221; access to the server.</li>
</ol>
<p>Care to guess which option I chose?  <img src='http://nefaria.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p><strong>Step #1: Override the licensing mode setting using group policy</strong></p>
<ol>
<li>Click &#8216;Start&#8217;</li>
<li>Click &#8216;Run&#8217;</li>
<li>Type the following command:
<div class="code_block">
gpedit.msc /gpcomputer:TERMSVR01
</div>
</li>
<li>Click &#8216;OK&#8217;</li>
</ol>
<p>Those four steps open the group policy (remotely) for TERMSVR01. Next we need to actually change the setting:</p>
<ol>
<li>In the left-hand panel, expand &#8220;Administrative Templates&#8221;</li>
<li>Expand &#8220;Windows Components&#8221;</li>
<li>Click on &#8220;Terminal Services&#8221;</li>
<li>Locate the following setting in the right-hand panel:
<div class="code_block">
Set the Terminal Server licensing mode
</div>
</li>
<li>Double-click the aforementioned setting</li>
<li>Change the option (directly below the heading) to &#8220;Enabled&#8221;</li>
<li>Select &#8220;Per User&#8221; from the drop-down box (below the heading: &#8220;Specify the licensing mode for the terminal server&#8221;.)</li>
<li>Click &#8216;OK&#8217;</li>
<li>Close the &#8220;Group Policy Object Editor&#8221; window</li>
</ol>
<p>Great. The licensing mode has been changed but the setting won&#8217;t take effect until the service is restarted. We <em>could</em> open &#8217;services.msc&#8217; and connect to &#8216;TERMSVR01&#8242; by using the &#8216;Connect to another computer &#8230;&#8217; option in the &#8216;Action&#8217; menu. This will allow us to administer almost all running services on TERMSVR01 &#8230; almost all. You&#8217;ll notice immediately that you cannot start/stop the &#8216;Terminal Services&#8217; service from this management console, so we need to find another way to do it.</p>
<p>The easiest way I know to accomplish this task is to use the WMIC command from the command prompt.</p>
<p><strong>Step #2: Restart a remote service using WMIC</strong></p>
<ol>
<li>Open a command prompt</li>
<li>Type the following command (then hit enter) to stop the service:
<div class="code_block">
wmic /node:TERMSVR01 service where &#8220;caption=&#8217;Terminal Services&#8217;&#8221; call StopService
</div>
</li>
<li>Then, type the following command to start the service:
<div class="code_block">
wmic /node:TERMSVR01 service where &#8220;caption=&#8217;Terminal Services&#8217;&#8221; call StartService
</div>
</li>
<li>Close the command prompt</li>
</ol>
<p>If everything was successful (and my assumption about the nature of the problem was correct), then I should be able to connect to the server using the Remote Desktop client. I fired up the client and voilà! It worked perfectly.</p>
]]></content:encoded>
			<wfw:commentRss>http://nefaria.com/2010/01/configuring-per-user-licensing-in-terminal-services-remotely-without-remote-desktop-access/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>How to upgrade ClamAV on Ubuntu (Intrepid)</title>
		<link>http://nefaria.com/2009/10/how-to-upgrade-clamav-on-ubuntu-intrepid/</link>
		<comments>http://nefaria.com/2009/10/how-to-upgrade-clamav-on-ubuntu-intrepid/#comments</comments>
		<pubDate>Thu, 08 Oct 2009 14:22:48 +0000</pubDate>
		<dc:creator>musashi</dc:creator>
				<category><![CDATA[I.T.]]></category>
		<category><![CDATA[ClamAV]]></category>
		<category><![CDATA[GNU/Linux]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://nefaria.com/?p=725</guid>
		<description><![CDATA[On October 5th, the Clam Antivirus team announced that ClamAV 0.94.x is now entering its end-of-life phase. What&#8217;s worse, versions of ClamAV earlier than 0.95 will no longer be able to receive CVD updates; basically rendering any older versions of ClamAV nearly worthless. This is all supposed to happen by April 2010&#8212;soon. You can read [...]]]></description>
			<content:encoded><![CDATA[<p>On October 5th, the Clam Antivirus team announced that ClamAV 0.94.x is now entering its end-of-life phase. What&#8217;s worse, versions of ClamAV earlier than 0.95 will no longer be able to receive CVD updates; basically rendering any older versions of ClamAV nearly worthless. This is all supposed to happen by April 2010&#8212;soon. You can read more about it <a href="http://www.clamav.net/2009/10/05/eol-clamav-094/">here</a>. </p>
<p>Good news though, the upgrade process on Ubuntu is pretty easy:</p>
<p>If you haven&#8217;t already done so, enable the &#8216;<a href="https://help.ubuntu.com/community/UbuntuBackports">backports</a>&#8216; repo by editing your /etc/apt/sources.list file and uncommenting (or, inserting) the following two lines:</p>
<div class='code_block'>
<pre>
deb http://us.archive.ubuntu.com/ubuntu/ intrepid-backports main restricted universe multiverse
deb-src http://us.archive.ubuntu.com/ubuntu/ intrepid-backports main restricted universe multiverse
</pre>
</div>
<p>Then, resynchronize the package index files with the following command:</p>
<div class='code_block'>
<pre>
sudo apt-get update
</pre>
</div>
<p>Next, upgrade ClamAV:</p>
<div class='code_block'>
<pre>
sudo apt-get install clamav-daemon
</pre>
</div>
<p>This command will [sometimes] install apparmor as well; I don&#8217;t use apparmor so I uninstall it afterwards:</p>
<div class='code_block'>
<pre>
/etc/init.d/apparmor stop
update-rc.d -f apparmor remove
apt-get remove apparmor apparmor-utils
</pre>
</div>
<p>That&#8217;s all there is to it!</p>
<div class='code_block'>
<pre>
root@localhost:~# clamd -V
ClamAV 0.95.2/9874/Thu Oct  8 06:24:12 2009
</pre>
</div>
]]></content:encoded>
			<wfw:commentRss>http://nefaria.com/2009/10/how-to-upgrade-clamav-on-ubuntu-intrepid/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Adding &#8220;Trusted Sites&#8221; to Internet Explorer, via the registry</title>
		<link>http://nefaria.com/2009/10/adding-trusted-sites-for-ie-via-the-registry/</link>
		<comments>http://nefaria.com/2009/10/adding-trusted-sites-for-ie-via-the-registry/#comments</comments>
		<pubDate>Thu, 01 Oct 2009 18:28:57 +0000</pubDate>
		<dc:creator>musashi</dc:creator>
				<category><![CDATA[I.T.]]></category>
		<category><![CDATA[registry]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://nefaria.com/?p=702</guid>
		<description><![CDATA[A while ago I needed to add a list of websites to the Internet Explorer&#8217;s &#8220;Trusted Sites&#8221; zone for multiple users, scattered across multiple terminal servers. IE&#8217;s &#8220;Enhanced Security Configuration&#8221; (ESC) is configured by default on windows terminal services and it&#8217;s normally a good idea to leave it intact. 
However, this can have unintended consequences [...]]]></description>
			<content:encoded><![CDATA[<p>A while ago I needed to add a list of websites to the Internet Explorer&#8217;s &#8220;Trusted Sites&#8221; zone for multiple users, scattered across multiple terminal servers. IE&#8217;s &#8220;Enhanced Security Configuration&#8221; (ESC) is configured by default on windows terminal services and it&#8217;s normally a good idea to leave it intact. </p>
<p>However, this can have unintended consequences for users who require the use of websites that employ ActiveX, javascript, etc. because, by default, ESC does not allow those items to run. Sometimes, this means that the site in question will only be partially non-functioning. Other times, the entire site will be completely unusable. Furthermore, most users on terminal services have only a limited ability to actually modify the settings for an entire zone. Normally the best thing they can do is add the site to their trusted sites zone, if in fact the site is legitimate (i.e., &#8220;trusted&#8221;). </p>
<p>Originally, I explained to the users the steps involved in adding a site to their trusted sites, however many of the users used many of the same websites that other users were using. Also, new users needed to be trained on how to do this as well. Needless to say, it got very repetitive, very fast; so I came up with a &#8220;global&#8221; list of sites that can be trusted, and imported them to the registry on each terminal server. The list consisted of about 40+ sites, and I was able to generate the list mostly by exporting the following registry key:</p>
<div class="code_block">
<pre>
HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings\ZoneMap\EscDomains
</pre>
</div>
<p>&#8230;from a few user accounts who had already added most of the sites to their trusted sites zone. After grepping out the duplicates (among other things), I had my list.</p>
<p>Now, I&#8217;m going to cover two ways of making this list of domains &#8220;globally trusted&#8221;&#8212;both of them involve writing to the following registry key:</p>
<div class="code_block">
<pre>
HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings\ZoneMap\EscDomains
</pre>
</div>
<p>Pay attention! This is not the same key as previously mentioned. This key resides in the &#8216;HKEY_LOCAL_MACHINE&#8217; hive, whereas the previous key resides in the &#8216;HKEY_CURRENT_USER&#8217; hive.</p>
<p>The first way is via the following visual basic script:</p>
<div class="code_block">
<pre>
<font color="#ffff00">Option</font>&nbsp;<font color="#ffff00">Explicit</font>

<font color="#ffff00">Dim</font>&nbsp;DomainArray<font color="#ffff00">(</font><font color="#ff6060">5</font><font color="#ffff00">),</font>&nbsp;strComputer<font color="#ffff00">,</font>&nbsp;strHTTP<font color="#ffff00">,</font>&nbsp;strHTTPS
<font color="#ffff00">Dim</font>&nbsp;dwordZone<font color="#ffff00">,</font>&nbsp;regPath<font color="#ffff00">,</font>&nbsp;objReg<font color="#ffff00">,</font>&nbsp;counter<font color="#ffff00">,</font>&nbsp;subkeyPath
<font color="#ffff00">Dim</font>&nbsp;subkeyValue
<font color="#ffff00">Const</font>&nbsp;HKEY_LOCAL_MACHINE <font color="#ffff00">=</font>&nbsp;<font color="#ffff00">&amp;</font>H80000002

DomainArray<font color="#ffff00">(</font><font color="#ff6060">0</font><font color="#ffff00">)</font>&nbsp;<font color="#ffff00">=</font>&nbsp;<font color="#ff6060">&quot;testdomain0.com&quot;</font>
DomainArray<font color="#ffff00">(</font><font color="#ff6060">1</font><font color="#ffff00">)</font>&nbsp;<font color="#ffff00">=</font>&nbsp;<font color="#ff6060">&quot;testdomain1.com&quot;</font>
DomainArray<font color="#ffff00">(</font><font color="#ff6060">2</font><font color="#ffff00">)</font>&nbsp;<font color="#ffff00">=</font>&nbsp;<font color="#ff6060">&quot;testdomain2.com&quot;</font>
DomainArray<font color="#ffff00">(</font><font color="#ff6060">3</font><font color="#ffff00">)</font>&nbsp;<font color="#ffff00">=</font>&nbsp;<font color="#ff6060">&quot;testdomain3.com&quot;</font>
DomainArray<font color="#ffff00">(</font><font color="#ff6060">4</font><font color="#ffff00">)</font>&nbsp;<font color="#ffff00">=</font>&nbsp;<font color="#ff6060">&quot;testdomain4.com&quot;</font>

strComputer <font color="#ffff00">=</font>&nbsp;<font color="#ff6060">&quot;.&quot;</font>
strHTTP <font color="#ffff00">=</font>&nbsp;<font color="#ff6060">&quot;http&quot;</font>
strHTTPS <font color="#ffff00">=</font>&nbsp;<font color="#ff6060">&quot;https&quot;</font>
dwordZone <font color="#ffff00">=</font>&nbsp;<font color="#ff6060">&quot;2&quot;</font>
regPath <font color="#ffff00">=</font>&nbsp;<font color="#ff6060">&quot;SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings&quot;</font>&nbsp;<font color="#ffff00">&amp;</font>_
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="#ff6060">&quot;\ZoneMap\EscDomains\&quot;</font>
<font color="#ffff00">Set</font>&nbsp;objReg <font color="#ffff00">=</font>&nbsp;<font color="#00ffff">GetObject</font><font color="#ffff00">(</font><font color="#ff6060">&quot;winmgmts:{impersonationLevel = impersonate}!\\&quot;</font>&nbsp;<font color="#ffff00">&amp; _</font>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;strComputer <font color="#ffff00">&amp;</font>&nbsp;<font color="#ff6060">&quot;\root\default:StdRegProv&quot;</font><font color="#ffff00">)</font>

<font color="#ffff00">For</font>&nbsp;counter <font color="#ffff00">=</font>&nbsp;<font color="#ff6060">0</font>&nbsp;<font color="#ffff00">to</font>&nbsp;<font color="#ff6060">4</font>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;subkeyPath <font color="#ffff00">=</font>&nbsp;regPath <font color="#ffff00">&amp;</font>&nbsp;DomainArray<font color="#ffff00">(</font>counter<font color="#ffff00">)</font>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;objReg<font color="#ffff00">.</font>CreateKey HKEY_LOCAL_MACHINE<font color="#ffff00">,</font>subkeyPath
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;objReg<font color="#ffff00">.</font>SetDWORDValue HKEY_LOCAL_MACHINE<font color="#ffff00">,</font>subkeyPath<font color="#ffff00">,</font>strHTTP<font color="#ffff00">,</font>dwordZone
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;objReg<font color="#ffff00">.</font>SetDWORDValue HKEY_LOCAL_MACHINE<font color="#ffff00">,</font>subkeyPath<font color="#ffff00">,</font>strHTTPS<font color="#ffff00">,</font>dwordZone
<font color="#ffff00">Next</font>
</pre>
</div>
<p>This script will insert &#8216;testdomain0.com&#8217;, &#8216;testdomain1.com&#8217;, [...] into IE&#8217;s trusted sites zone when run on any machine. It must be run by an Administrator (or another user who has access to write to the HKEY_LOCAL_MACHINE registry hive), and the changes are global (to the machine).</p>
<p>The next way involves creating a &#8220;registry entries&#8221; (.reg) file:</p>
<div class="code_block">
<pre>
Windows Registry Editor Version 5<font color="#ff40ff">.</font>00

[<font color="#ff6060">HKEY_LOCAL_MACHINE</font><font color="#ff40ff">\</font>SOFTWARE<font color="#ff40ff">\</font>Microsoft<font color="#ff40ff">\</font>Windows<font color="#ff40ff">\</font>CurrentVersion<font color="#ff40ff">\</font>Internet Settings<font color="#ff40ff">\</font>ZoneMap<font color="#ff40ff">\</font>EscDomains]

[<font color="#ff6060">HKEY_LOCAL_MACHINE</font><font color="#ff40ff">\</font>SOFTWARE<font color="#ff40ff">\</font>Microsoft<font color="#ff40ff">\</font>Windows<font color="#ff40ff">\</font>CurrentVersion<font color="#ff40ff">\</font>Internet Settings<font color="#ff40ff">\</font>ZoneMap<font color="#ff40ff">\</font>EscDomains<font color="#ff40ff">\</font>testdomain0<font color="#ff40ff">.</font>com]
&quot;http&quot;=<font color="#ff6060">dword</font><font color="#ff40ff">:</font><font color="#ff6060">00000002</font>
&quot;https&quot;=<font color="#ff6060">dword</font><font color="#ff40ff">:</font><font color="#ff6060">00000002</font>

[<font color="#ff6060">HKEY_LOCAL_MACHINE</font><font color="#ff40ff">\</font>SOFTWARE<font color="#ff40ff">\</font>Microsoft<font color="#ff40ff">\</font>Windows<font color="#ff40ff">\</font>CurrentVersion<font color="#ff40ff">\</font>Internet Settings<font color="#ff40ff">\</font>ZoneMap<font color="#ff40ff">\</font>EscDomains<font color="#ff40ff">\</font>testdomain1<font color="#ff40ff">.</font>com]
&quot;http&quot;=<font color="#ff6060">dword</font><font color="#ff40ff">:</font><font color="#ff6060">00000002</font>
&quot;https&quot;=<font color="#ff6060">dword</font><font color="#ff40ff">:</font><font color="#ff6060">00000002</font>

[<font color="#ff6060">HKEY_LOCAL_MACHINE</font><font color="#ff40ff">\</font>SOFTWARE<font color="#ff40ff">\</font>Microsoft<font color="#ff40ff">\</font>Windows<font color="#ff40ff">\</font>CurrentVersion<font color="#ff40ff">\</font>Internet Settings<font color="#ff40ff">\</font>ZoneMap<font color="#ff40ff">\</font>EscDomains<font color="#ff40ff">\</font>testdomain2<font color="#ff40ff">.</font>com]
&quot;http&quot;=<font color="#ff6060">dword</font><font color="#ff40ff">:</font><font color="#ff6060">00000002</font>
&quot;https&quot;=<font color="#ff6060">dword</font><font color="#ff40ff">:</font><font color="#ff6060">00000002</font>

[<font color="#ff6060">HKEY_LOCAL_MACHINE</font><font color="#ff40ff">\</font>SOFTWARE<font color="#ff40ff">\</font>Microsoft<font color="#ff40ff">\</font>Windows<font color="#ff40ff">\</font>CurrentVersion<font color="#ff40ff">\</font>Internet Settings<font color="#ff40ff">\</font>ZoneMap<font color="#ff40ff">\</font>EscDomains<font color="#ff40ff">\</font>testdomain3<font color="#ff40ff">.</font>com]
&quot;http&quot;=<font color="#ff6060">dword</font><font color="#ff40ff">:</font><font color="#ff6060">00000002</font>
&quot;https&quot;=<font color="#ff6060">dword</font><font color="#ff40ff">:</font><font color="#ff6060">00000002</font>

[<font color="#ff6060">HKEY_LOCAL_MACHINE</font><font color="#ff40ff">\</font>SOFTWARE<font color="#ff40ff">\</font>Microsoft<font color="#ff40ff">\</font>Windows<font color="#ff40ff">\</font>CurrentVersion<font color="#ff40ff">\</font>Internet Settings<font color="#ff40ff">\</font>ZoneMap<font color="#ff40ff">\</font>EscDomains<font color="#ff40ff">\</font>testdomain4<font color="#ff40ff">.</font>com]
&quot;http&quot;=<font color="#ff6060">dword</font><font color="#ff40ff">:</font><font color="#ff6060">00000002</font>
&quot;https&quot;=<font color="#ff6060">dword</font><font color="#ff40ff">:</font><font color="#ff6060">00000002</font>
</pre>
</div>
<p>Just like the previous script, this must also be run by a user with Administrator privileges and any changes will be global to all users on the machine.</p>
<p>(Of course, you would want to customize these snippets of code to suit your needs.)</p>
<p>For more information, please visit the following sites:</p>
<p><a href="http://support.microsoft.com/kb/815141">Internet Explorer Enhanced Security Configuration changes the browsing experience</a><br />
<a href="http://msdn.microsoft.com/en-us/library/ms537180(VS.85).aspx">Enhanced Security Configuration for Internet Explorer</a><br />
<a href="http://support.microsoft.com/kb/182569">Internet Explorer security zones registry entries for advanced users</a></p>
]]></content:encoded>
			<wfw:commentRss>http://nefaria.com/2009/10/adding-trusted-sites-for-ie-via-the-registry/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Alternate SMTP port with iptables</title>
		<link>http://nefaria.com/2009/09/alternate-smtp-port-with-iptables/</link>
		<comments>http://nefaria.com/2009/09/alternate-smtp-port-with-iptables/#comments</comments>
		<pubDate>Tue, 29 Sep 2009 21:04:59 +0000</pubDate>
		<dc:creator>musashi</dc:creator>
				<category><![CDATA[I.T.]]></category>
		<category><![CDATA[e-mail]]></category>
		<category><![CDATA[GNU/Linux]]></category>
		<category><![CDATA[iptables]]></category>
		<category><![CDATA[SMTP]]></category>

		<guid isPermaLink="false">http://nefaria.com/?p=696</guid>
		<description><![CDATA[Nowadays, more and more ISPs are blocking outbound port 25 (SMTP) for spam prevention or reduction purposes. This should be of concern to sysadmins who have users scattered across multiple ISPs (such as webhosting services) or corporate sysadmins who maintain e-mail for mobile users, for example. The workaround is to use the mail submission agent [...]]]></description>
			<content:encoded><![CDATA[<p>Nowadays, more and more ISPs are blocking outbound port 25 (SMTP) for spam prevention or reduction purposes. This should be of concern to sysadmins who have users scattered across multiple ISPs (such as webhosting services) or corporate sysadmins who maintain e-mail for mobile users, for example. The workaround is to use the <a href="http://en.wikipedia.org/wiki/Mail_submission_agent">mail submission agent (MSA)</a> port, 587. Most ISPs do not block outbound traffic for this port. On GNU/Linux, we can use <a href="http://www.netfilter.org/">iptables</a> for this task. With a single command, we can configure any inbound traffic, destined for port 587 traffic to be redirected to port 25:</p>
<div class="code_block">
<pre>iptables -t nat -I PREROUTING -p tcp --dport 587 -j REDIRECT --to-port 25</pre>
</div>
]]></content:encoded>
			<wfw:commentRss>http://nefaria.com/2009/09/alternate-smtp-port-with-iptables/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
